[llvm-commits] [llvm] r54936 - /llvm/trunk/lib/VMCore/AsmWriter.cpp
Chris Lattner
sabre at nondot.org
Mon Aug 18 12:41:26 PDT 2008
Author: lattner
Date: Mon Aug 18 14:41:26 2008
New Revision: 54936
URL: http://llvm.org/viewvc/llvm-project?rev=54936&view=rev
Log:
Fix a bug daniel pointed out to me, where asmprinter started
printing ascii code for hex numbers instead of the hex numbers
themselves.
Modified:
llvm/trunk/lib/VMCore/AsmWriter.cpp
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=54936&r1=54935&r2=54936&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Mon Aug 18 14:41:26 2008
@@ -252,17 +252,17 @@
} 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 << '"';
More information about the llvm-commits
mailing list