clang  8.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  const PathDiagnosticConsumers &PDC,
19  StoreManagerCreator storemgr,
20  ConstraintManagerCreator constraintmgr,
21  CheckerManager *checkerMgr,
22  AnalyzerOptions &Options,
23  CodeInjector *injector)
24  : AnaCtxMgr(
25  ASTCtx, Options.UnoptimizedCFG,
26  Options.ShouldIncludeImplicitDtorsInCFG,
27  /*AddInitializers=*/true,
28  Options.ShouldIncludeTemporaryDtorsInCFG,
29  Options.ShouldIncludeLifetimeInCFG,
30  // Adding LoopExit elements to the CFG is a requirement for loop
31  // unrolling.
32  Options.ShouldIncludeLoopExitInCFG ||
33  Options.ShouldUnrollLoops,
34  Options.ShouldIncludeScopesInCFG,
35  Options.ShouldSynthesizeBodies,
36  Options.ShouldConditionalizeStaticInitializers,
37  /*addCXXNewAllocator=*/true,
38  Options.ShouldIncludeRichConstructorsInCFG,
39  Options.ShouldElideConstructors, injector),
40  Ctx(ASTCtx), Diags(diags), LangOpts(ASTCtx.getLangOpts()),
41  PathConsumers(PDC), CreateStoreMgr(storemgr),
42  CreateConstraintMgr(constraintmgr), CheckerMgr(checkerMgr),
43  options(Options) {
44  AnaCtxMgr.getCFGBuildOptions().setAllAlwaysAdd();
45 }
46 
49  for (PathDiagnosticConsumers::iterator I = PathConsumers.begin(),
50  E = PathConsumers.end(); I != E; ++I) {
51  delete *I;
52  }
53 }
54 
57  for (PathDiagnosticConsumers::iterator I = PathConsumers.begin(),
58  E = PathConsumers.end();
59  I != E; ++I) {
60  (*I)->FlushDiagnostics(&filesMade);
61  }
62 }
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:154
AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, const PathDiagnosticConsumers &Consumers, StoreManagerCreator storemgr, ConstraintManagerCreator constraintmgr, CheckerManager *checkerMgr, AnalyzerOptions &Options, CodeInjector *injector=nullptr)
std::unique_ptr< StoreManager >(* StoreManagerCreator)(ProgramStateManager &)
Definition: ProgramState.h:45
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:149
std::unique_ptr< ConstraintManager >(* ConstraintManagerCreator)(ProgramStateManager &, SubEngine *)
Definition: ProgramState.h:43
CFG::BuildOptions & getCFGBuildOptions()
std::vector< PathDiagnosticConsumer * > PathDiagnosticConsumers
BuildOptions & setAllAlwaysAdd()
Definition: CFG.h:1042
Dataflow Directional Tag Classes.
CodeInjector is an interface which is responsible for injecting AST of function definitions that may ...
Definition: CodeInjector.h:36
const LangOptions & getLangOpts() const
Stores options for the analyzer from the command line.
#define true
Definition: stdbool.h:32