summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-18 19:41:26 +0000
committerChris Lattner <sabre@nondot.org>2008-08-18 19:41:26 +0000
commitd7cbd1574f1fa04a19d4fc3c82d78cf2f1e7c309 (patch)
tree8827d4bdb7ae5ce723ac0d3e4c7433b0550ab2c7 /lib/VMCore
parent8dc2cbe793ff577f69c17426d6dfaef94ad69191 (diff)
downloadllvm-d7cbd1574f1fa04a19d4fc3c82d78cf2f1e7c309.tar.gz
llvm-d7cbd1574f1fa04a19d4fc3c82d78cf2f1e7c309.tar.bz2
llvm-d7cbd1574f1fa04a19d4fc3c82d78cf2f1e7c309.tar.xz
Fix a bug daniel pointed out to me, where asmprinter started
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
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index f16ae08ef1..93b69b913e 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -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 << '"';