[llvm-commits] [llvm] r58962 - in /llvm/trunk/lib: CodeGen/AsmPrinter/AsmPrinter.cpp VMCore/AsmWriter.cpp

Chris Lattner sabre at nondot.org
Sun Nov 9 20:30:27 PST 2008


Author: lattner
Date: Sun Nov  9 22:30:26 2008
New Revision: 58962

URL: http://llvm.org/viewvc/llvm-project?rev=58962&view=rev
Log:
Use utohex_buffer instead of utohexstr to avoid creating a temporary
string in the .ll and .s printers.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/VMCore/AsmWriter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=58962&r1=58961&r2=58962&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Sun Nov  9 22:30:26 2008
@@ -564,7 +564,9 @@
 /// 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

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=58962&r1=58961&r2=58962&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Sun Nov  9 22:30:26 2008
@@ -662,7 +662,8 @@
       // 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;
     }
     





More information about the llvm-commits mailing list