.string adds an implicit zero at the end. This is not what we wanted.
authorChris Lattner <sabre@nondot.org>
Sun, 19 Oct 2003 02:51:01 +0000 (02:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Oct 2003 02:51:01 +0000 (02:51 +0000)
This fixes PR#44.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9252 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/Printer.cpp
lib/Target/X86/X86AsmPrinter.cpp

index f8c006cfd1cd70d1637e72fc89b0dc08191ed283..aaebb5b84926930e060ea04f6bfb23dd4ad733d9 100644 (file)
@@ -329,7 +329,7 @@ void Printer::printConstantValueOnly(const Constant *CV) {
   } else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
     if (isStringCompatible(CVA)) {
       // print the string alone and return
-      O << "\t.string\t" << getAsCString(CVA) << "\n";
+      O << "\t.ascii\t" << getAsCString(CVA) << "\n";
     } else { // Not a string.  Print the values in successive locations
       const std::vector<Use> &constValues = CVA->getValues();
       for (unsigned i=0; i < constValues.size(); i++)
index f8c006cfd1cd70d1637e72fc89b0dc08191ed283..aaebb5b84926930e060ea04f6bfb23dd4ad733d9 100644 (file)
@@ -329,7 +329,7 @@ void Printer::printConstantValueOnly(const Constant *CV) {
   } else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
     if (isStringCompatible(CVA)) {
       // print the string alone and return
-      O << "\t.string\t" << getAsCString(CVA) << "\n";
+      O << "\t.ascii\t" << getAsCString(CVA) << "\n";
     } else { // Not a string.  Print the values in successive locations
       const std::vector<Use> &constValues = CVA->getValues();
       for (unsigned i=0; i < constValues.size(); i++)