]> granicus.if.org Git - clang/commitdiff
[CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 23 Feb 2018 22:49:25 +0000 (22:49 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 23 Feb 2018 22:49:25 +0000 (22:49 +0000)
Don't use fancy initialization and member access in a DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325969 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFG.cpp

index c65a6521721a53f3cc739c4006f36112a37214aa..7431c19cceed4504771e8e3188d1cd6044721885 100644 (file)
@@ -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::findConstructionContexts(
       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());