StoreManagerCreator CreateStoreMgr;
ConstraintManagerCreator CreateConstraintMgr;
+ llvm::OwningPtr<AnalysisManager> Mgr;
+
AnalysisConsumer(Diagnostic &diags, Preprocessor* pp,
PreprocessorFactory* ppf,
const LangOptions& lopts,
virtual void Initialize(ASTContext &Context) {
Ctx = &Context;
+ Mgr.reset(new AnalysisManager(*Ctx, Diags, LOpts, PD.get(),
+ CreateStoreMgr, CreateConstraintMgr,
+ Opts.AnalyzerDisplayProgress,
+ Opts.VisualizeEGDot, Opts.VisualizeEGUbi,
+ Opts.PurgeDead, Opts.EagerlyAssume,
+ Opts.TrimGraph));
}
virtual void HandleTopLevelDecl(DeclGroupRef D) {
void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
if(!TranslationUnitActions.empty()) {
- AnalysisManager mgr(*Ctx, Diags, LOpts, PD.get(),
- CreateStoreMgr, CreateConstraintMgr,
- Opts.AnalyzerDisplayProgress, Opts.VisualizeEGDot,
- Opts.VisualizeEGUbi, Opts.PurgeDead, Opts.EagerlyAssume,
- Opts.TrimGraph);
for (Actions::iterator I = TranslationUnitActions.begin(),
E = TranslationUnitActions.end(); I != E; ++I)
- (*I)(mgr);
+ (*I)(*Mgr);
}
if (!ObjCImplementationActions.empty()) {
!Ctx->getSourceManager().isFromMainFile(D->getLocation()))
return;
- // Create an AnalysisManager that will manage the state for analyzing
- // this method/function.
- AnalysisManager mgr(D, *Ctx, Diags, LOpts, PD.get(),
- CreateStoreMgr, CreateConstraintMgr,
- Opts.AnalyzerDisplayProgress, Opts.VisualizeEGDot,
- Opts.VisualizeEGUbi, Opts.PurgeDead, Opts.EagerlyAssume,
- Opts.TrimGraph);
+ Mgr->setContext(D);
// Dispatch on the actions.
for (Actions::iterator I = actions.begin(), E = actions.end(); I != E; ++I)
- (*I)(mgr);
+ (*I)(*Mgr);
}
//===----------------------------------------------------------------------===//