[Support] Move PrintEscapedString into the library its declaration is in

llvm-svn: 323558
This commit is contained in:
Benjamin Kramer 2018-01-26 20:21:02 +00:00
parent a03d3198ee
commit d15b2898d3
2 changed files with 10 additions and 10 deletions

View File

@ -383,16 +383,6 @@ static void PrintCallingConv(unsigned cc, raw_ostream &Out) {
}
}
void llvm::PrintEscapedString(StringRef Name, raw_ostream &Out) {
for (unsigned i = 0, e = Name.size(); i != e; ++i) {
unsigned char C = Name[i];
if (isprint(C) && C != '\\' && C != '"')
Out << C;
else
Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
}
}
enum PrefixType {
GlobalPrefix,
ComdatPrefix,

View File

@ -58,6 +58,16 @@ void llvm::SplitString(StringRef Source,
}
}
void llvm::PrintEscapedString(StringRef Name, raw_ostream &Out) {
for (unsigned i = 0, e = Name.size(); i != e; ++i) {
unsigned char C = Name[i];
if (isprint(C) && C != '\\' && C != '"')
Out << C;
else
Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
}
}
void llvm::printLowerCase(StringRef String, raw_ostream &Out) {
for (const char C : String)
Out << toLower(C);