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, Options.includeImplicitDtorsInCFG(),
26  /*AddInitializers=*/true, Options.includeTemporaryDtorsInCFG(),
27  Options.includeLifetimeInCFG(),
28  // Adding LoopExit elements to the CFG is a requirement for loop
29  // unrolling.
30  Options.includeLoopExitInCFG() || Options.shouldUnrollLoops(),
31  Options.includeScopesInCFG(), Options.shouldSynthesizeBodies(),
32  Options.shouldConditionalizeStaticInitializers(),
33  /*addCXXNewAllocator=*/true, Options.includeRichConstructorsInCFG(),
34  Options.shouldElideConstructors(), injector),
35  Ctx(ASTCtx), Diags(diags), LangOpts(ASTCtx.getLangOpts()),
36  PathConsumers(PDC), CreateStoreMgr(storemgr),
37  CreateConstraintMgr(constraintmgr), CheckerMgr(checkerMgr),
38  options(Options) {
39  AnaCtxMgr.getCFGBuildOptions().setAllAlwaysAdd();
40 }
41 
44  for (PathDiagnosticConsumers::iterator I = PathConsumers.begin(),
45  E = PathConsumers.end(); I != E; ++I) {
46  delete *I;
47  }
48 }
49 
52  for (PathDiagnosticConsumers::iterator I = PathConsumers.begin(),
53  E = PathConsumers.end();
54  I != E; ++I) {
55  (*I)->FlushDiagnostics(&filesMade);
56  }
57 }
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
#define true
Definition: stdbool.h:32