llvm.org GIT mirror llvm / 4564ec9
expose a static function as a static method on the MCSymbol class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93350 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
2 changed file(s) with 12 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
135135
136136 /// dump - Print the value to stderr.
137137 void dump() const;
138
139 /// printMangledName - Print the specified string in mangled form if it uses
140 /// any unusual characters.
141 static void printMangledName(StringRef Str, raw_ostream &OS,
142 const MCAsmInfo *MAI);
138143 };
139144
140145 } // end namespace llvm
5151 return false;
5252 }
5353
54 static void PrintMangledName(raw_ostream &OS, StringRef Str,
55 const MCAsmInfo &MAI) {
54 /// printMangledName - Print the specified string in mangled form if it uses
55 /// any unusual characters.
56 void MCSymbol::printMangledName(StringRef Str, raw_ostream &OS,
57 const MCAsmInfo *MAI) {
5658 // The first character is not allowed to be a number unless the target
5759 // explicitly allows it.
58 if (!MAI.doesAllowNameToStartWithDigit() && Str[0] >= '0' && Str[0] <= '9') {
60 if ((MAI == 0 || !MAI->doesAllowNameToStartWithDigit()) &&
61 Str[0] >= '0' && Str[0] <= '9') {
5962 MangleLetter(OS, Str[0]);
6063 Str = Str.substr(1);
6164 }
9497
9598 // On systems that do not allow quoted names, print with mangling.
9699 if (!MAI->doesAllowQuotesInName())
97 return PrintMangledName(OS, getName(), *MAI);
100 return printMangledName(getName(), OS, MAI);
98101
99102 // If the string contains a double quote or newline, we still have to mangle
100103 // it.