Small eye-candy: use asciz directive everywhere, where possible.
authorAnton Korobeynikov <asl@math.spbu.ru>
Tue, 6 Mar 2007 19:25:02 +0000 (19:25 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Tue, 6 Mar 2007 19:25:02 +0000 (19:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34981 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index 8db6a5b29be064ec232b531b76d4915d0cc7140f..4dce674575cbe78f68ee7fb31669eb344dca1796 100644 (file)
@@ -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\"";
 }