From b8797a2d0fc1c306c51b1c393403007d2c88c065 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 17 Nov 2014 18:17:19 +0000 Subject: [PATCH] Fixing a use of stringstream to use an LLVM helper function. Drive-by fixing header include order. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222151 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/ClangAttrEmitter.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/utils/TableGen/ClangAttrEmitter.cpp b/utils/TableGen/ClangAttrEmitter.cpp index efb0b9b906..10b70fcee1 100644 --- a/utils/TableGen/ClangAttrEmitter.cpp +++ b/utils/TableGen/ClangAttrEmitter.cpp @@ -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 GenerateHasAttrSpellingStringSwitch( // 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 Spellings = GetFlattenedSpellings(*Attr); for (const auto &S : Spellings) if (Variety.empty() || (Variety == S.variety() && -- 2.40.0