/// Pointer to a factory for creating and caching implementations for common
/// methods during the analysis.
- BodyFarm *BdyFrm = nullptr;
+ std::unique_ptr<BodyFarm> BdyFrm;
/// Flag to indicate whether or not bodies should be synthesized
/// for well-known functions.
bool addCXXNewAllocator = true,
CodeInjector *injector = nullptr);
- ~AnalysisDeclContextManager();
-
AnalysisDeclContext *getContext(const Decl *D);
bool getUseUnoptimizedCFG() const {
BodyFarm *AnalysisDeclContextManager::getBodyFarm() {
if (!BdyFrm)
- BdyFrm = new BodyFarm(ASTCtx, Injector.get());
- return BdyFrm;
+ BdyFrm = llvm::make_unique<BodyFarm>(ASTCtx, Injector.get());
+ return BdyFrm.get();
}
const StackFrameContext *
}
}
-AnalysisDeclContextManager::~AnalysisDeclContextManager() {
- if (BdyFrm)
- delete BdyFrm;
-}
-
LocationContext::~LocationContext() {}
LocationContextManager::~LocationContextManager() {