[llvm] r228340 - InstrProf: Avoid using std::to_string

Justin Bogner mail at justinbogner.com
Thu Feb 5 11:54:28 PST 2015


Author: bogner
Date: Thu Feb  5 13:54:27 2015
New Revision: 228340

URL: http://llvm.org/viewvc/llvm-project?rev=228340&view=rev
Log:
InstrProf: Avoid using std::to_string

Apparently std::to_string doesn't exist in mingw32:

    http://lab.llvm.org:8011/builders/clang-native-mingw32-win7/builds/7990
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015

Modified:
    llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp

Modified: llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp?rev=228340&r1=228339&r2=228340&view=diff
==============================================================================
--- llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp (original)
+++ llvm/trunk/unittests/ProfileData/CoverageMappingTest.cpp Thu Feb  5 13:54:27 2015
@@ -13,7 +13,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include "gtest/gtest.h"
 
-#include <string>
+#include <sstream>
 
 using namespace llvm;
 using namespace coverage;
@@ -52,7 +52,9 @@ readCoverageRegions(std::string Coverage
   SmallVector<std::string, 8> Filenames;
   SmallVector<StringRef, 8> FilenameRefs;
   for (int I = 0; I < NumFiles; ++I) {
-    Filenames.push_back("file" + std::to_string(I));
+    std::ostringstream S;
+    S << "file" << I;
+    Filenames.push_back(S.str());
     FilenameRefs.push_back(Filenames.back());
   }
 





More information about the llvm-commits mailing list