diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-10 04:35:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-10 04:35:24 +0000 |
commit | 09487cd4371d7c0041a08d677d4cef45da76c0cf (patch) | |
tree | 70660c34fc854dd68160d0e599de7bfc6b3b773e | |
parent | 5505eed5ac9a44dd182cc0a3462ae478556c8f59 (diff) | |
download | bcm5719-llvm-09487cd4371d7c0041a08d677d4cef45da76c0cf.tar.gz bcm5719-llvm-09487cd4371d7c0041a08d677d4cef45da76c0cf.zip |
eliminate a couple more uses of utohexstr.
llvm-svn: 58963
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index a9b297375f6..a641d0bf9ef 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -532,11 +532,12 @@ void AsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) { /// PrintULEB128 - Print a series of hexidecimal values (separated by commas) /// representing an unsigned leb128 value. void AsmPrinter::PrintULEB128(unsigned Value) const { + char Buffer[20]; do { - unsigned Byte = Value & 0x7f; + unsigned char Byte = static_cast<unsigned char>(Value & 0x7f); Value >>= 7; if (Value) Byte |= 0x80; - O << "0x" << utohexstr(Byte); + O << "0x" << utohex_buffer(Byte, Buffer+20); if (Value) O << ", "; } while (Value); } @@ -546,13 +547,14 @@ void AsmPrinter::PrintULEB128(unsigned Value) const { void AsmPrinter::PrintSLEB128(int Value) const { int Sign = Value >> (8 * sizeof(Value) - 1); bool IsMore; + char Buffer[20]; do { - unsigned Byte = Value & 0x7f; + unsigned char Byte = static_cast<unsigned char>(Value & 0x7f); Value >>= 7; IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; if (IsMore) Byte |= 0x80; - O << "0x" << utohexstr(Byte); + O << "0x" << utohex_buffer(Byte, Buffer+20); if (IsMore) O << ", "; } while (IsMore); } @@ -565,7 +567,6 @@ void AsmPrinter::PrintSLEB128(int Value) const { /// void AsmPrinter::PrintHex(int Value) const { char Buffer[20]; - O << "0x" << utohex_buffer(static_cast<unsigned>(Value), Buffer+20); } @@ -749,7 +750,10 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV, unsigned FillValue = TAI->getTextAlignFillValue(); UseFillExpr &= IsInTextSection && FillValue; - if (UseFillExpr) O << ",0x" << utohexstr(FillValue); + if (UseFillExpr) { + O << ','; + PrintHex(FillValue); + } O << '\n'; } |