[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Tue Mar 6 11:25:20 PST 2007
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.153 -> 1.154
---
Log message:
Small eye-candy: use asciz directive everywhere, where possible.
---
Diffs of the changes: (+10 -3)
AsmPrinter.cpp | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.153 llvm/lib/CodeGen/AsmPrinter.cpp:1.154
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.153 Wed Feb 21 16:48:45 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp Tue Mar 6 13:25:02 2007
@@ -559,13 +559,20 @@
/// Special characters are emitted properly.
/// \literal (Eg. '\t') \endliteral
void AsmPrinter::EmitString(const std::string &String) const {
- O << TAI->getAsciiDirective()
- << "\"";
+ const char* AscizDirective = TAI->getAscizDirective();
+ if (AscizDirective)
+ O << AscizDirective;
+ else
+ O << TAI->getAsciiDirective();
+ O << "\"";
for (unsigned i = 0, N = String.size(); i < N; ++i) {
unsigned char C = String[i];
printStringChar(O, C);
}
- O << "\\0\"";
+ if (AscizDirective)
+ O << "\"";
+ else
+ O << "\\0\"";
}
More information about the llvm-commits
mailing list