diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-03-06 19:25:02 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-03-06 19:25:02 +0000 |
commit | fb269cf3e7893e1e5265db818e7ce78b6b2f75b5 (patch) | |
tree | b12c2679b1cbe32315058d5df5852bef6fcec425 | |
parent | c37177eb72d13205d2ad07d32fc8a06a36e2ca9e (diff) |
Small eye-candy: use asciz directive everywhere, where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34981 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 8db6a5b29b..4dce674575 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -559,13 +559,20 @@ static void printStringChar(std::ostream &O, unsigned char C) { /// 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\""; } |