From: Artem Dergachev Date: Fri, 23 Feb 2018 22:49:25 +0000 (+0000) Subject: [CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91c8aa8a6bfc4f9083f71881ca0941fe5cea590e;p=clang [CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot. 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 --- diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index c65a652172..7431c19cce 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -476,7 +476,7 @@ class CFGBuilder { // This is set in the construction trigger and read when the constructor // itself is being visited. llvm::DenseMap - 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 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(Child)) { findConstructionContexts(ContextSoFar, Cleanups->getSubExpr());