Use utostr from StringExtras.h instead of ostringstream from <sstream>.
authorDan Gohman <gohman@apple.com>
Tue, 26 Jun 2007 15:14:48 +0000 (15:14 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 26 Jun 2007 15:14:48 +0000 (15:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37731 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/ValueTypes.cpp

index 751bd588f666891c5f071fe4ac413ea6fa8ca633..7472f888e167f54fabef0f1994c4e679f5d14692 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
+#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 @@ using namespace llvm;
 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";