Fix a bug daniel pointed out to me, where asmprinter started
authorChris Lattner <sabre@nondot.org>
Mon, 18 Aug 2008 19:41:26 +0000 (19:41 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 18 Aug 2008 19:41:26 +0000 (19:41 +0000)
printing ascii code for hex numbers instead of the hex numbers
themselves.

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

lib/VMCore/AsmWriter.cpp

index f16ae08ef1f10f9bb10c94a5327ed39c21f63b16..93b69b913e9460ef1c0e9c5d85391863ac9d1eb4 100644 (file)
@@ -252,17 +252,17 @@ static void PrintLLVMName(std::ostream &OS, const ValueName *Name,
     } else if (isprint(C)) {
       OS << C;
     } else {
-      OS << "\\";
+      OS << '\\';
       char hex1 = (C >> 4) & 0x0F;
       if (hex1 < 10)
-        OS << (hex1 + '0');
+        OS << (char)(hex1 + '0');
       else 
-        OS << (hex1 - 10 + 'A');
+        OS << (char)(hex1 - 10 + 'A');
       char hex2 = C & 0x0F;
       if (hex2 < 10)
-        OS << (hex2 + '0');
+        OS << (char)(hex2 + '0');
       else 
-        OS << (hex2 - 10 + 'A');
+        OS << (char)(hex2 - 10 + 'A');
     }
   }
   OS << '"';