r222151 - Fixing a use of stringstream to use an LLVM helper function. Drive-by fixing header include order. NFC.

Aaron Ballman aaron at aaronballman.com
Mon Nov 17 10:17:19 PST 2014


Author: aaronballman
Date: Mon Nov 17 12:17:19 2014
New Revision: 222151

URL: http://llvm.org/viewvc/llvm-project?rev=222151&view=rev
Log:
Fixing a use of stringstream to use an LLVM helper function. Drive-by fixing header include order. NFC.

Modified:
    cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp

Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?rev=222151&r1=222150&r2=222151&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Mon Nov 17 12:17:19 2014
@@ -12,8 +12,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/TableGen/Error.h"
 #include "llvm/TableGen/Record.h"
@@ -1880,13 +1881,8 @@ static void GenerateHasAttrSpellingStrin
       // present in the caller.
       Test = "LangOpts.CPlusPlus11";
 
-    // FIXME: When MinGW support is dropped, or they gain support for
-    // std::to_string, this hack can be dropped as well.
-    std::stringstream ss;
-    ss << Version;
-
     std::string TestStr =
-        !Test.empty() ? Test + " ? " + ss.str() + " : 0" : "1";
+        !Test.empty() ? Test + " ? " + llvm::itostr(Version) + " : 0" : "1";
     std::vector<FlattenedSpelling> Spellings = GetFlattenedSpellings(*Attr);
     for (const auto &S : Spellings)
       if (Variety.empty() || (Variety == S.variety() &&





More information about the cfe-commits mailing list