[llvm-commits] CVS: llvm/lib/VMCore/ValueTypes.cpp

Dan Gohman djg at cray.com
Tue Jun 26 08:15:20 PDT 2007



Changes in directory llvm/lib/VMCore:

ValueTypes.cpp updated: 1.19 -> 1.20
---
Log message:

Use utostr from StringExtras.h instead of ostringstream from <sstream>.


---
Diffs of the changes:  (+4 -7)

 ValueTypes.cpp |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)


Index: llvm/lib/VMCore/ValueTypes.cpp
diff -u llvm/lib/VMCore/ValueTypes.cpp:1.19 llvm/lib/VMCore/ValueTypes.cpp:1.20
--- llvm/lib/VMCore/ValueTypes.cpp:1.19	Mon Jun 25 11:23:39 2007
+++ llvm/lib/VMCore/ValueTypes.cpp	Tue Jun 26 10:14:48 2007
@@ -11,10 +11,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/Type.h"
 #include "llvm/DerivedTypes.h"
-#include <sstream>
 using namespace llvm;
 
 /// MVT::getValueTypeString - This function returns value type as a string,
@@ -22,12 +22,9 @@
 std::string MVT::getValueTypeString(MVT::ValueType VT) {
   switch (VT) {
   default:
-    if (isExtendedValueType(VT)) {
-      std::ostringstream OS;
-      OS << "v" << getVectorNumElements(VT)
-         << getValueTypeString(getVectorElementType(VT));
-      return OS.str();
-    }
+    if (isExtendedValueType(VT))
+      return "v" + utostr(getVectorNumElements(VT)) +
+             getValueTypeString(getVectorElementType(VT));
     assert(0 && "Invalid ValueType!");
   case MVT::i1:    return "i1";
   case MVT::i8:    return "i8";






More information about the llvm-commits mailing list