llvm.org GIT mirror llvm / 38e5989
Don't pass StringRef by reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108366 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 9 years ago
37 changed file(s) with 74 addition(s) and 76 deletion(s). Raw diff Collapse all Expand all
456456 may have embedded null characters. Therefore, they cannot simply take
457457 a const char *, and taking a const std::string& requires
458458 clients to perform a heap allocation which is usually unnecessary. Instead,
459 many LLVM APIs use a const StringRef& or a const
460 Twine& for passing strings efficiently.

459 many LLVM APIs use a StringRef or a const Twine& for
460 passing strings efficiently.

461461
462462
463463
476476 an std::string, or explicitly with a character pointer and length.
477477 For example, the StringRef find function is declared as:

478478
479
480 iterator find(const StringRef &Key);
481 </div>
479 <pre class="doc_code">
480 iterator find(StringRef Key);
481
482482
483483

and clients can call it using any one of:

484484
485
486 >
485 class="doc_code">
487486 Map.find("foo"); // Lookup "foo"
488487 Map.find(std::string("bar")); // Lookup "bar"
489488 Map.find(StringRef("\0baz", 4)); // Lookup "\0baz"
490489
491
492490
493491

Similarly, APIs which need to return a string may return a StringRef

494492 instance, which can be used directly or converted to an std::string
498496
499497

You should rarely use the StringRef class directly, because it contains

500498 pointers to external memory it is not generally safe to store an instance of the
501 class (unless you know that the external storage will not be freed).

499 class (unless you know that the external storage will not be freed). StringRef is
500 small and pervasive enough in LLVM that it should always be passed by value.

502501
503502
504503
178178
179179 // Constructors.
180180 APFloat(const fltSemantics &); // Default construct to 0.0
181 APFloat(const fltSemantics &, const StringRef &);
181 APFloat(const fltSemantics &, StringRef);
182182 APFloat(const fltSemantics &, integerPart);
183183 APFloat(const fltSemantics &, fltCategory, bool negative);
184184 APFloat(const fltSemantics &, uninitializedTag);
281281 bool, roundingMode);
282282 opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
283283 bool, roundingMode);
284 opStatus convertFromString(const StringRef&, roundingMode);
284 opStatus convertFromString(StringRef, roundingMode);
285285 APInt bitcastToAPInt() const;
286286 double convertToDouble() const;
287287 float convertToFloat() const;
385385 roundingMode, bool *) const;
386386 opStatus convertFromUnsignedParts(const integerPart *, unsigned int,
387387 roundingMode);
388 opStatus convertFromHexadecimalString(const StringRef&, roundingMode);
389 opStatus convertFromDecimalString (const StringRef&, roundingMode);
388 opStatus convertFromHexadecimalString(StringRef, roundingMode);
389 opStatus convertFromDecimalString(StringRef, roundingMode);
390390 char *convertNormalToHexString(char *, unsigned int, bool,
391391 roundingMode) const;
392392 opStatus roundSignificandWithExponent(const integerPart *, unsigned int,
161161 ///
162162 /// @param radix 2, 8, 10, or 16
163163 /// @brief Convert a char array into an APInt
164 void fromString(unsigned numBits, const StringRef &str, uint8_t radix);
164 void fromString(unsigned numBits, StringRef str, uint8_t radix);
165165
166166 /// This is used by the toString method to divide by the radix. It simply
167167 /// provides a more convenient form of divide for internal use since KnuthDiv
247247 /// @param str the string to be interpreted
248248 /// @param radix the radix to use for the conversion
249249 /// @brief Construct an APInt from a string representation.
250 APInt(unsigned numBits, const StringRef &str, uint8_t radix);
250 APInt(unsigned numBits, StringRef str, uint8_t radix);
251251
252252 /// Simply makes *this a copy of that.
253253 /// @brief Copy Constructor.
11521152 /// This method determines how many bits are required to hold the APInt
11531153 /// equivalent of the string given by \arg str.
11541154 /// @brief Get bits required for string value.
1155 static unsigned getBitsNeeded(const StringRef& str, uint8_t radix);
1155 static unsigned getBitsNeeded(StringRef str, uint8_t radix);
11561156
11571157 /// countLeadingZeros - This function is an APInt version of the
11581158 /// countLeadingZeros_{32,64} functions in MathExtras.h. It counts the number
106106
107107 void EatToEndOfStatement();
108108
109 bool ParseAssignment(const StringRef &Name);
109 bool ParseAssignment(StringRef Name);
110110
111111 bool ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc);
112112 bool ParseBinOpRHS(unsigned Precedence, const MCExpr *&Res, SMLoc &EndLoc);
3535 /// Compiles the given POSIX Extended Regular Expression \arg Regex.
3636 /// This implementation supports regexes and matching strings with embedded
3737 /// NUL characters.
38 Regex(const StringRef &Regex, unsigned Flags = NoFlags);
38 Regex(StringRef Regex, unsigned Flags = NoFlags);
3939 ~Regex();
4040
4141 /// isValid - returns the error encountered during regex compilation, or
5454 /// the first group is always the entire pattern.
5555 ///
5656 /// This returns true on a successful match.
57 bool match(const StringRef &String, SmallVectorImpl *Matches=0);
57 bool match(StringRef String, SmallVectorImpl *Matches = 0);
5858
5959 /// sub - Return the result of replacing the first match of the regex in
6060 /// \arg String with the \arg Repl string. Backreferences like "\0" in the
6363 /// intern - Adds a string to the pool and returns a reference-counted
6464 /// pointer to it. No additional memory is allocated if the string already
6565 /// exists in the pool.
66 PooledStringPtr intern(const StringRef &Str);
66 PooledStringPtr intern(StringRef Str);
6767
6868 /// empty - Checks whether the pool is empty. Returns true if so.
6969 ///
4848 /// \param Operands [out] - The list of parsed operands, this returns
4949 /// ownership of them to the caller.
5050 /// \return True on failure.
51 virtual bool ParseInstruction(const StringRef &Name, SMLoc NameLoc,
51 virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
5252 SmallVectorImpl &Operands) = 0;
5353
5454 /// ParseDirective - Parse a target specific assembler directive
711711 return HadError;
712712 }
713713
714 bool AsmParser::ParseAssignment(const StringRef &Name) {
714 bool AsmParser::ParseAssignment(StringRef Name) {
715715 // FIXME: Use better location, we should use proper tokens.
716716 SMLoc EqualLoc = Lexer.getLoc();
717717
760760 makeNaN();
761761 }
762762
763 APFloat::APFloat(const fltSemantics &ourSemantics, const StringRef& text)
763 APFloat::APFloat(const fltSemantics &ourSemantics, StringRef text)
764764 {
765765 assertArithmeticOK(ourSemantics);
766766 initialize(&ourSemantics);
21842184 }
21852185
21862186 APFloat::opStatus
2187 APFloat::convertFromHexadecimalString(const StringRef &s,
2188 roundingMode rounding_mode)
2187 APFloat::convertFromHexadecimalString(StringRef s, roundingMode rounding_mode)
21892188 {
21902189 lostFraction lost_fraction = lfExactlyZero;
21912190 integerPart *significand;
23602359 }
23612360
23622361 APFloat::opStatus
2363 APFloat::convertFromDecimalString(const StringRef &str, roundingMode rounding_mode)
2362 APFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode)
23642363 {
23652364 decimalInfo D;
23662365 opStatus fs;
24702469 }
24712470
24722471 APFloat::opStatus
2473 APFloat::convertFromString(const StringRef &str, roundingMode rounding_mode)
2472 APFloat::convertFromString(StringRef str, roundingMode rounding_mode)
24742473 {
24752474 assertArithmeticOK(*semantics);
24762475 assert(!str.empty() && "Invalid string length");
101101 clearUnusedBits();
102102 }
103103
104 APInt::APInt(unsigned numbits, const StringRef& Str, uint8_t radix)
104 APInt::APInt(unsigned numbits, StringRef Str, uint8_t radix)
105105 : BitWidth(numbits), VAL(0) {
106106 assert(BitWidth && "Bitwidth too small");
107107 fromString(numbits, Str, radix);
612612 return *this;
613613 }
614614
615 unsigned APInt::getBitsNeeded(const StringRef& str, uint8_t radix) {
615 unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) {
616616 assert(!str.empty() && "Invalid string length");
617617 assert((radix == 10 || radix == 8 || radix == 16 || radix == 2) &&
618618 "Radix should be 2, 8, 10, or 16!");
20452045 divide(LHS, lhsWords, RHS, rhsWords, &Quotient, &Remainder);
20462046 }
20472047
2048 void APInt::fromString(unsigned numbits, const StringRef& str, uint8_t radix) {
2048 void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) {
20492049 // Check our assumptions here
20502050 assert(!str.empty() && "Invalid string length");
20512051 assert((radix == 10 || radix == 8 || radix == 16 || radix == 2) &&
1818 #include
1919 using namespace llvm;
2020
21 Regex::Regex(const StringRef &regex, unsigned Flags) {
21 Regex::Regex(StringRef regex, unsigned Flags) {
2222 unsigned flags = 0;
2323 preg = new llvm_regex();
2424 preg->re_endp = regex.end();
5151 return preg->re_nsub;
5252 }
5353
54 bool Regex::match(const StringRef &String, SmallVectorImpl *Matches){
54 bool Regex::match(StringRef String, SmallVectorImpl *Matches){
5555 unsigned nmatch = Matches ? preg->re_nsub+1 : 0;
5656
5757 // pmatch needs to have at least one element.
2121 assert(InternTable.empty() && "PooledStringPtr leaked!");
2222 }
2323
24 PooledStringPtr StringPool::intern(const StringRef &Key) {
24 PooledStringPtr StringPool::intern(StringRef Key) {
2525 table_t::iterator I = InternTable.find(Key);
2626 if (I != InternTable.end())
2727 return PooledStringPtr(&*I);
8787 /// its register number, or -1 if there is no match. To allow return values
8888 /// to be used directly in register lists, arm registers have values between
8989 /// 0 and 15.
90 int MatchRegisterName(const StringRef &Name);
90 int MatchRegisterName(StringRef Name);
9191
9292 /// }
9393
9696 ARMAsmParser(const Target &T, MCAsmParser &_Parser)
9797 : TargetAsmParser(T), Parser(_Parser) {}
9898
99 virtual bool ParseInstruction(const StringRef &Name, SMLoc NameLoc,
99 virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
100100 SmallVectorImpl &Operands);
101101
102102 virtual bool ParseDirective(AsmToken DirectiveID);
516516 const AsmToken &Tok = Parser.getTok();
517517 if (Tok.isNot(AsmToken::Identifier))
518518 return true;
519 const StringRef &ShiftName = Tok.getString();
519 StringRef ShiftName = Tok.getString();
520520 if (ShiftName == "lsl" || ShiftName == "LSL")
521521 St = Lsl;
522522 else if (ShiftName == "lsr" || ShiftName == "LSR")
548548 }
549549
550550 /// A hack to allow some testing, to be replaced by a real table gen version.
551 int ARMAsmParser::MatchRegisterName(const StringRef &Name) {
551 int ARMAsmParser::MatchRegisterName(StringRef Name) {
552552 if (Name == "r0" || Name == "R0")
553553 return 0;
554554 else if (Name == "r1" || Name == "R1")
592592 MCInst &Inst) {
593593 ARMOperand &Op0 = *(ARMOperand*)Operands[0];
594594 assert(Op0.Kind == ARMOperand::Token && "First operand not a Token");
595 const StringRef &Mnemonic = Op0.getToken();
595 StringRef Mnemonic = Op0.getToken();
596596 if (Mnemonic == "add" ||
597597 Mnemonic == "stmfd" ||
598598 Mnemonic == "str" ||
657657 }
658658
659659 /// Parse an arm instruction mnemonic followed by its operands.
660 bool ARMAsmParser::ParseInstruction(const StringRef &Name, SMLoc NameLoc,
660 bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
661661 SmallVectorImpl &Operands) {
662662 OwningPtr Op;
663663 ARMOperand::CreateToken(Op, Name, NameLoc);
760760 const AsmToken &Tok = Parser.getTok();
761761 if (Tok.isNot(AsmToken::Identifier))
762762 return Error(L, "unexpected token in .syntax directive");
763 const StringRef &Mode = Tok.getString();
763 StringRef Mode = Tok.getString();
764764 if (Mode == "unified" || Mode == "UNIFIED")
765765 Parser.Lex();
766766 else if (Mode == "divided" || Mode == "DIVIDED")
1313 #include "AlphaMCAsmInfo.h"
1414 using namespace llvm;
1515
16 AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, const StringRef &TT) {
16 AlphaMCAsmInfo::AlphaMCAsmInfo(const Target &T, StringRef TT) {
1717 AlignmentIsInBytes = false;
1818 PrivateGlobalPrefix = "$";
1919 GPRel32Directive = ".gprel32";
1313 #ifndef ALPHATARGETASMINFO_H
1414 #define ALPHATARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
2121
2222 struct AlphaMCAsmInfo : public MCAsmInfo {
23 explicit AlphaMCAsmInfo(const Target &T, const StringRef &TT);
23 explicit AlphaMCAsmInfo(const Target &T, StringRef TT);
2424 };
2525
2626 } // namespace llvm
1414
1515 using namespace llvm;
1616
17 BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, const StringRef &TT) {
17 BlackfinMCAsmInfo::BlackfinMCAsmInfo(const Target &T, StringRef TT) {
1818 GlobalPrefix = "_";
1919 CommentString = "//";
2020 HasSetDirective = false;
1313 #ifndef BLACKFINTARGETASMINFO_H
1414 #define BLACKFINTARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
2121
2222 struct BlackfinMCAsmInfo : public MCAsmInfo {
23 explicit BlackfinMCAsmInfo(const Target &T, const StringRef &TT);
23 explicit BlackfinMCAsmInfo(const Target &T, StringRef TT);
2424 };
2525
2626 } // namespace llvm
1313 #include "SPUMCAsmInfo.h"
1414 using namespace llvm;
1515
16 SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, const StringRef &TT) {
16 SPULinuxMCAsmInfo::SPULinuxMCAsmInfo(const Target &T, StringRef TT) {
1717 ZeroDirective = "\t.space\t";
1818 Data64bitsDirective = "\t.quad\t";
1919 AlignmentIsInBytes = false;
1313 #ifndef SPUTARGETASMINFO_H
1414 #define SPUTARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
2121
2222 struct SPULinuxMCAsmInfo : public MCAsmInfo {
23 explicit SPULinuxMCAsmInfo(const Target &T, const StringRef &TT);
23 explicit SPULinuxMCAsmInfo(const Target &T, StringRef TT);
2424 };
2525 } // namespace llvm
2626
1313 #include "MBlazeMCAsmInfo.h"
1414 using namespace llvm;
1515
16 MBlazeMCAsmInfo::MBlazeMCAsmInfo(const Target &T, const StringRef &TT) {
16 MBlazeMCAsmInfo::MBlazeMCAsmInfo(const Target &T, StringRef TT) {
1717 AlignmentIsInBytes = false;
1818 Data16bitsDirective = "\t.half\t";
1919 Data32bitsDirective = "\t.word\t";
1313 #ifndef MBLAZETARGETASMINFO_H
1414 #define MBLAZETARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
2121
2222 class MBlazeMCAsmInfo : public MCAsmInfo {
2323 public:
24 explicit MBlazeMCAsmInfo(const Target &T, const StringRef &TT);
24 explicit MBlazeMCAsmInfo(const Target &T, StringRef TT);
2525 };
2626
2727 } // namespace llvm
16201620 }
16211621
16221622
1623 const char* MSILWriter::getLibraryForSymbol(const StringRef &Name,
1624 bool isFunction,
1623 const char* MSILWriter::getLibraryForSymbol(StringRef Name, bool isFunction,
16251624 CallingConv::ID CallingConv) {
16261625 // TODO: Read *.def file with function and libraries definitions.
16271626 return "MSVCRT.DLL";
245245
246246 const char* getLibraryName(const GlobalVariable* GV);
247247
248 const char* getLibraryForSymbol(const StringRef &Name, bool isFunction,
248 const char* getLibraryForSymbol(StringRef Name, bool isFunction,
249249 CallingConv::ID CallingConv);
250250
251251 void printExternals();
1313 #include "MSP430MCAsmInfo.h"
1414 using namespace llvm;
1515
16 MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
16 MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, StringRef TT) {
1717 PrivateGlobalPrefix = ".L";
1818 WeakRefDirective ="\t.weak\t";
1919 PCSymbol=".";
1313 #ifndef MSP430TARGETASMINFO_H
1414 #define MSP430TARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
21
2122 struct MSP430MCAsmInfo : public MCAsmInfo {
22 explicit MSP430MCAsmInfo(const Target &T, const StringRef &TT);
23 explicit MSP430MCAsmInfo(const Target &T, StringRef TT);
2324 };
2425
2526 } // namespace llvm
1313 #include "MipsMCAsmInfo.h"
1414 using namespace llvm;
1515
16 MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, const StringRef &TT) {
16 MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, StringRef TT) {
1717 AlignmentIsInBytes = false;
1818 Data16bitsDirective = "\t.half\t";
1919 Data32bitsDirective = "\t.word\t";
1313 #ifndef MIPSTARGETASMINFO_H
1414 #define MIPSTARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
2121
2222 class MipsMCAsmInfo : public MCAsmInfo {
2323 public:
24 explicit MipsMCAsmInfo(const Target &T, const StringRef &TT);
24 explicit MipsMCAsmInfo(const Target &T, StringRef TT);
2525 };
2626
2727 } // namespace llvm
1919 #include "PIC16ISelLowering.h"
2020 using namespace llvm;
2121
22 PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, const StringRef &TT) {
22 PIC16MCAsmInfo::PIC16MCAsmInfo(const Target &T, StringRef TT) {
2323 CommentString = ";";
2424 GlobalPrefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
2525 GlobalDirective = "\tglobal\t";
2424 const char *RomData16bitsDirective;
2525 const char *RomData32bitsDirective;
2626 public:
27 PIC16MCAsmInfo(const Target &T, const StringRef &TT);
27 PIC16MCAsmInfo(const Target &T, StringRef TT);
2828
2929 virtual const char *getDataASDirective(unsigned size, unsigned AS) const;
3030 };
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "SparcMCAsmInfo.h"
14 #include "llvm/ADT/SmallVector.h"
1514 using namespace llvm;
1615
17 SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, const StringRef &TT) {
16 SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, StringRef TT) {
1817 Data16bitsDirective = "\t.half\t";
1918 Data32bitsDirective = "\t.word\t";
2019 Data64bitsDirective = 0; // .xword is only supported by V9.
1313 #ifndef SPARCTARGETASMINFO_H
1414 #define SPARCTARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
21
2122 struct SparcELFMCAsmInfo : public MCAsmInfo {
22 explicit SparcELFMCAsmInfo(const Target &T, const StringRef &TT);
23 explicit SparcELFMCAsmInfo(const Target &T, StringRef TT);
2324 };
2425
2526 } // namespace llvm
1515 #include "llvm/MC/MCSectionELF.h"
1616 using namespace llvm;
1717
18 SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, const StringRef &TT) {
18 SystemZMCAsmInfo::SystemZMCAsmInfo(const Target &T, StringRef TT) {
1919 PrivateGlobalPrefix = ".L";
2020 WeakRefDirective = "\t.weak\t";
2121 PCSymbol = ".";
2020 class StringRef;
2121
2222 struct SystemZMCAsmInfo : public MCAsmInfo {
23 explicit SystemZMCAsmInfo(const Target &T, const StringRef &TT);
23 explicit SystemZMCAsmInfo(const Target &T, StringRef TT);
2424 virtual const MCSection *getNonexecutableStackSection(MCContext &Ctx) const;
2525 };
2626
6464 X86ATTAsmParser(const Target &T, MCAsmParser &_Parser)
6565 : TargetAsmParser(T), Parser(_Parser) {}
6666
67 virtual bool ParseInstruction(const StringRef &Name, SMLoc NameLoc,
67 virtual bool ParseInstruction(StringRef Name, SMLoc NameLoc,
6868 SmallVectorImpl &Operands);
6969
7070 virtual bool ParseDirective(AsmToken DirectiveID);
601601 }
602602
603603 bool X86ATTAsmParser::
604 ParseInstruction(const StringRef &Name, SMLoc NameLoc,
604 ParseInstruction(StringRef Name, SMLoc NameLoc,
605605 SmallVectorImpl &Operands) {
606606 // The various flavors of pushf and popf use Requires and
607607 // Requires, but the assembler doesn't yet implement that.
99 #include "XCoreMCAsmInfo.h"
1010 using namespace llvm;
1111
12 XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, const StringRef &TT) {
12 XCoreMCAsmInfo::XCoreMCAsmInfo(const Target &T, StringRef TT) {
1313 SupportsDebugInformation = true;
1414 Data16bitsDirective = "\t.short\t";
1515 Data32bitsDirective = "\t.long\t";
1313 #ifndef XCORETARGETASMINFO_H
1414 #define XCORETARGETASMINFO_H
1515
16 #include "llvm/ADT/StringRef.h"
1617 #include "llvm/MC/MCAsmInfo.h"
1718
1819 namespace llvm {
1920 class Target;
20 class StringRef;
21
2122 class XCoreMCAsmInfo : public MCAsmInfo {
2223 public:
23 explicit XCoreMCAsmInfo(const Target &T, const StringRef &TT);
24 explicit XCoreMCAsmInfo(const Target &T, StringRef TT);
2425 };
2526
2627 } // namespace llvm
8989 /// PrintLLVMName - Turn the specified name into an 'LLVM name', which is either
9090 /// prefixed with % (if the string only contains simple characters) or is
9191 /// surrounded with ""'s (if it has special chars in it). Print it out.
92 static void PrintLLVMName(raw_ostream &OS, const StringRef &Name,
93 PrefixType Prefix) {
92 static void PrintLLVMName(raw_ostream &OS, StringRef Name, PrefixType Prefix) {
9493 assert(Name.data() && "Cannot get empty name!");
9594 switch (Prefix) {
9695 default: llvm_unreachable("Bad prefix!");