// 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;
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);
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());