remove one form of EmitString, just use EmitBytes instead. We must

be careful to add a \0 at the end though, because EmitString didn't
do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94277 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-01-23 03:11:46 +00:00
parent 4fe5d72765
commit 4cf202ba06
5 changed files with 27 additions and 46 deletions

View File

@@ -715,29 +715,6 @@ static void printStringChar(formatted_raw_ostream &O, unsigned char C) {
}
}
/// EmitString - Emit a string with quotes and a null terminator.
/// Special characters are emitted properly.
/// \literal (Eg. '\t') \endliteral
void AsmPrinter::EmitString(const StringRef String) const {
EmitString(String.data(), String.size());
}
void AsmPrinter::EmitString(const char *String, unsigned Size) const {
const char* AscizDirective = MAI->getAscizDirective();
if (AscizDirective)
O << AscizDirective;
else
O << MAI->getAsciiDirective();
O << '\"';
for (unsigned i = 0; i < Size; ++i)
printStringChar(O, String[i]);
if (AscizDirective)
O << '\"';
else
O << "\\0\"";
}
/// EmitFile - Emit a .file directive.
void AsmPrinter::EmitFile(unsigned Number, StringRef Name) const {
O << "\t.file\t" << Number << " \"";