Use utohex_buffer instead of utohexstr to avoid creating a temporary
authorChris Lattner <sabre@nondot.org>
Mon, 10 Nov 2008 04:30:26 +0000 (04:30 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 10 Nov 2008 04:30:26 +0000 (04:30 +0000)
string in the .ll and .s printers.

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

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/VMCore/AsmWriter.cpp

index 018544150902066b594c91ec690e531e1752fd30..a9b297375f60b6e425a8f9dc32d33fdbcb23417e 100644 (file)
@@ -564,7 +564,9 @@ void AsmPrinter::PrintSLEB128(int Value) const {
 /// PrintHex - Print a value as a hexidecimal value.
 ///
 void AsmPrinter::PrintHex(int Value) const { 
-  O << "0x" << utohexstr(static_cast<unsigned>(Value));
+  char Buffer[20];
+  
+  O << "0x" << utohex_buffer(static_cast<unsigned>(Value), Buffer+20);
 }
 
 /// EOL - Print a newline character to asm stream.  If a comment is present
index 34e9716f68773f0675a92d7a3db7803f89fc23b8..2f6c1cc0f27b71a32a42a652d82c452e9f9729a1 100644 (file)
@@ -662,7 +662,8 @@ static void WriteConstantInt(raw_ostream &Out, const Constant *CV,
       // output the string in hexadecimal format!
       assert(sizeof(double) == sizeof(uint64_t) &&
              "assuming that double is 64 bits!");
-      Out << "0x" << utohexstr(DoubleToBits(Val));
+      char Buffer[40];
+      Out << "0x" << utohex_buffer(uint64_t(DoubleToBits(Val)), Buffer+40);
       return;
     }