[llvm-commits] [llvm] r77617 - in /llvm/trunk: include/llvm/ADT/Twine.h lib/Support/Twine.cpp unittests/ADT/TwineTest.cpp

Daniel Dunbar daniel at zuster.org
Thu Jul 30 11:30:19 PDT 2009


Author: ddunbar
Date: Thu Jul 30 13:30:19 2009
New Revision: 77617

URL: http://llvm.org/viewvc/llvm-project?rev=77617&view=rev
Log:
Twine: Use raw_ostream::write_hex, remove unused itohexstr method.

Modified:
    llvm/trunk/include/llvm/ADT/Twine.h
    llvm/trunk/lib/Support/Twine.cpp
    llvm/trunk/unittests/ADT/TwineTest.cpp

Modified: llvm/trunk/include/llvm/ADT/Twine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Twine.h?rev=77617&r1=77616&r2=77617&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/Twine.h (original)
+++ llvm/trunk/include/llvm/ADT/Twine.h Thu Jul 30 13:30:19 2009
@@ -303,13 +303,6 @@
       return Twine(&Val, UHexKind, 0, EmptyKind);
     }
 
-    // Construct a twine to print \arg Val as an unsigned hexadecimal
-    // integer. This routine is provided as a convenience to sign extend values
-    // before printing.
-    static Twine itohexstr(const int64_t &Val) {
-      return Twine(&Val, UHexKind, 0, EmptyKind);
-    }
-
     /// @}
     /// @name String Operations
     /// @{

Modified: llvm/trunk/lib/Support/Twine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Twine.cpp?rev=77617&r1=77616&r2=77617&view=diff

==============================================================================
--- llvm/trunk/lib/Support/Twine.cpp (original)
+++ llvm/trunk/lib/Support/Twine.cpp Thu Jul 30 13:30:19 2009
@@ -60,8 +60,7 @@
     OS << *static_cast<const int64_t*>(Ptr);
     break;
   case Twine::UHexKind:
-    // FIXME: Add raw_ostream functionality for this.
-    OS << ::utohexstr(*static_cast<const uint64_t*>(Ptr));
+    OS.write_hex(*static_cast<const uint64_t*>(Ptr));
     break;
   }
 }

Modified: llvm/trunk/unittests/ADT/TwineTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/TwineTest.cpp?rev=77617&r1=77616&r2=77617&view=diff

==============================================================================
--- llvm/trunk/unittests/ADT/TwineTest.cpp (original)
+++ llvm/trunk/unittests/ADT/TwineTest.cpp Thu Jul 30 13:30:19 2009
@@ -39,8 +39,7 @@
   EXPECT_EQ("123", Twine((char) 123).str());
   EXPECT_EQ("-123", Twine((signed char) -123).str());
 
-  EXPECT_EQ("7B", Twine::utohexstr(123).str());
-  EXPECT_EQ("FFFFFFFFFFFFFF85", Twine::itohexstr(-123).str());
+  EXPECT_EQ("7b", Twine::utohexstr(123).str());
 }
 
 TEST(TwineTest, Concat) {





More information about the llvm-commits mailing list