Author: dergachev
Date: Fri Feb 23 14:49:25 2018
New Revision: 325969

URL: http://llvm.org/viewvc/llvm-project?rev=325969&view=rev
Log:
[CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot.

Don't use fancy initialization and member access in a DenseMap.

Modified:
    cfe/trunk/lib/Analysis/CFG.cpp

Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=325969&r1=325968&r2=325969&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Fri Feb 23 14:49:25 2018
@@ -476,7 +476,7 @@ class CFGBuilder {
   // This is set in the construction trigger and read when the constructor
   // itself is being visited.
   llvm::DenseMap<CXXConstructExpr *, const ConstructionContext *>
-      ConstructionContextMap{};
+      ConstructionContextMap;
 
   bool badCFG = false;
   const CFG::BuildOptions &BuildOpts;
@@ -497,7 +497,8 @@ public:
   explicit CFGBuilder(ASTContext *astContext,
                       const CFG::BuildOptions &buildOpts)
       : Context(astContext), cfg(new CFG()), // crew a new CFG
-        BuildOpts(buildOpts) {}
+        ConstructionContextMap(), BuildOpts(buildOpts) {}
+
 
   // buildCFG - Used by external clients to construct the CFG.
   std::unique_ptr<CFG> buildCFG(const Decl *D, Stmt *Statement);
@@ -1162,7 +1163,9 @@ void CFGBuilder::findConstructionContext
       assert(PreviousContext->isStrictlyMoreSpecificThan(ContextSoFar) &&
              "Already within a different construction context!");
     } else {
-      ConstructionContextMap[CE] = ContextSoFar;
+      auto Pair =
+          ConstructionContextMap.insert(std::make_pair(CE, ContextSoFar));
+      assert(Pair.second && "Already within a construction context!");
     }
   } else if (auto *Cleanups = dyn_cast<ExprWithCleanups>(Child)) {
     findConstructionContexts(ContextSoFar, Cleanups->getSubExpr());


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to