};
class AnalysisDeclContextManager {
- typedef llvm::DenseMap<const Decl*, AnalysisDeclContext*> ContextMap;
+ typedef llvm::DenseMap<const Decl *, std::unique_ptr<AnalysisDeclContext>>
+ ContextMap;
ContextMap Contexts;
LocationContextManager LocContexts;
cfgBuildOptions.AddCXXNewAllocator = addCXXNewAllocator;
}
-void AnalysisDeclContextManager::clear() {
- llvm::DeleteContainerSeconds(Contexts);
-}
+void AnalysisDeclContextManager::clear() { Contexts.clear(); }
static BodyFarm &getBodyFarm(ASTContext &C, CodeInjector *injector = nullptr) {
static BodyFarm *BF = new BodyFarm(C, injector);
D = FD;
}
- AnalysisDeclContext *&AC = Contexts[D];
+ std::unique_ptr<AnalysisDeclContext> &AC = Contexts[D];
if (!AC)
- AC = new AnalysisDeclContext(this, D, cfgBuildOptions);
- return AC;
+ AC = llvm::make_unique<AnalysisDeclContext>(this, D, cfgBuildOptions);
+ return AC.get();
}
const StackFrameContext *
}
}
-AnalysisDeclContextManager::~AnalysisDeclContextManager() {
- llvm::DeleteContainerSeconds(Contexts);
-}
+AnalysisDeclContextManager::~AnalysisDeclContextManager() {}
LocationContext::~LocationContext() {}