[llvm] r242945 - IPO: Avoid brace initialization of a map, some versions of libc++ don't like it

Justin Bogner mail at justinbogner.com
Wed Jul 22 14:41:12 PDT 2015


Author: bogner
Date: Wed Jul 22 16:41:12 2015
New Revision: 242945

URL: http://llvm.org/viewvc/llvm-project?rev=242945&view=rev
Log:
IPO: Avoid brace initialization of a map, some versions of libc++ don't like it

Should fix the build failure on these darwin bots:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/12427/
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/10389/

Modified:
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=242945&r1=242944&r2=242945&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Wed Jul 22 16:41:12 2015
@@ -2000,6 +2000,9 @@ struct MutatedGlobal {
   GlobalVariable *GV;
   Constant *Initializer;
   StoreMap Pending;
+
+public:
+  MutatedGlobal(GlobalVariable *GV) : GV(GV), Initializer(nullptr) {}
 };
 
 /// MutatedGlobals - This class tracks and commits stores to globals as basic
@@ -2047,7 +2050,7 @@ void MutatedGlobals::AddStore(Constant *
 
   auto I = Globals.find(GV);
   if (I == Globals.end()) {
-    auto R = Globals.insert(std::make_pair(GV, MutatedGlobal{GV, nullptr, {}}));
+    auto R = Globals.insert(std::make_pair(GV, MutatedGlobal(GV)));
     assert(R.second && "Global value already in the map?");
     I = R.first;
   }





More information about the llvm-commits mailing list