clang  6.0.0svn
AnalysisManager.cpp
Go to the documentation of this file.
1 //===-- AnalysisManager.cpp -------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
11 
12 using namespace clang;
13 using namespace ento;
14 
15 void AnalysisManager::anchor() { }
16 
18  ASTContext &ASTCtx, DiagnosticsEngine &diags, const LangOptions &lang,
19  const PathDiagnosticConsumers &PDC, StoreManagerCreator storemgr,
20  ConstraintManagerCreator constraintmgr, CheckerManager *checkerMgr,
21  AnalyzerOptions &Options, CodeInjector *injector)
22  : AnaCtxMgr(ASTCtx, Options.UnoptimizedCFG,
23  Options.includeImplicitDtorsInCFG(),
24  /*AddInitializers=*/true, Options.includeTemporaryDtorsInCFG(),
25  Options.includeLifetimeInCFG(),
26  // Adding LoopExit elements to the CFG is a requirement for loop
27  // unrolling.
28  Options.includeLoopExitInCFG() || Options.shouldUnrollLoops(),
29  Options.shouldSynthesizeBodies(),
30  Options.shouldConditionalizeStaticInitializers(),
31  /*addCXXNewAllocator=*/true,
32  injector),
33  Ctx(ASTCtx), Diags(diags), LangOpts(lang), PathConsumers(PDC),
34  CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr),
35  CheckerMgr(checkerMgr), options(Options) {
36  AnaCtxMgr.getCFGBuildOptions().setAllAlwaysAdd();
37 }
38 
41  for (PathDiagnosticConsumers::iterator I = PathConsumers.begin(),
42  E = PathConsumers.end(); I != E; ++I) {
43  delete *I;
44  }
45 }
46 
49  for (PathDiagnosticConsumers::iterator I = PathConsumers.begin(),
50  E = PathConsumers.end();
51  I != E; ++I) {
52  (*I)->FlushDiagnostics(&filesMade);
53  }
54 }
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:149
std::unique_ptr< StoreManager >(* StoreManagerCreator)(ProgramStateManager &)
Definition: ProgramState.h:44
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:48
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:147
std::unique_ptr< ConstraintManager >(* ConstraintManagerCreator)(ProgramStateManager &, SubEngine *)
Definition: ProgramState.h:42
CFG::BuildOptions & getCFGBuildOptions()
std::vector< PathDiagnosticConsumer * > PathDiagnosticConsumers
BuildOptions & setAllAlwaysAdd()
Definition: CFG.h:870
Dataflow Directional Tag Classes.
CodeInjector is an interface which is responsible for injecting AST of function definitions that may ...
Definition: CodeInjector.h:36
AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, const LangOptions &lang, const PathDiagnosticConsumers &Consumers, StoreManagerCreator storemgr, ConstraintManagerCreator constraintmgr, CheckerManager *checkerMgr, AnalyzerOptions &Options, CodeInjector *injector=nullptr)
#define true
Definition: stdbool.h:32