1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Fix a bug daniel pointed out to me, where asmprinter started

printing ascii code for hex numbers instead of the hex numbers 
themselves.

llvm-svn: 54936
This commit is contained in:
Chris Lattner 2008-08-18 19:41:26 +00:00
parent 751ff13625
commit 467a8dc22e

View 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 << '"';