clang 22.0.0git
AnalysisManager.cpp
Go to the documentation of this file.
1//===-- AnalysisManager.cpp -------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
11using namespace clang;
12using namespace ento;
13
14void AnalysisManager::anchor() { }
15
18 StoreManagerCreator storemgr,
19 ConstraintManagerCreator constraintmgr,
20 CheckerManager *checkerMgr,
21 AnalyzerOptions &Options,
22 std::unique_ptr<CodeInjector> injector)
23 : AnaCtxMgr(
24 ASTCtx, Options.UnoptimizedCFG,
25 Options.ShouldIncludeImplicitDtorsInCFG,
26 /*addInitializers=*/true, Options.ShouldIncludeTemporaryDtorsInCFG,
27 Options.ShouldIncludeLifetimeInCFG,
28 // Adding LoopExit elements to the CFG is a requirement for loop
29 // unrolling.
30 Options.ShouldIncludeLoopExitInCFG || Options.ShouldUnrollLoops,
31 Options.ShouldIncludeScopesInCFG, Options.ShouldSynthesizeBodies,
32 Options.ShouldConditionalizeStaticInitializers,
33 /*addCXXNewAllocator=*/true,
34 Options.ShouldIncludeRichConstructorsInCFG,
35 Options.ShouldElideConstructors,
36 /*addVirtualBaseBranches=*/true, std::move(injector)),
37 Ctx(ASTCtx), PP(PP), LangOpts(ASTCtx.getLangOpts()),
38 PathConsumers(std::move(PDC)), CreateStoreMgr(storemgr),
39 CreateConstraintMgr(constraintmgr), CheckerMgr(checkerMgr),
40 options(Options) {
44 Options.ShouldIncludeDefaultInitForAggregates;
45}
46
49}
50
53 for (const auto &Consumer : PathConsumers) {
54 Consumer->FlushDiagnostics(&filesMade);
55 }
56}
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
CFG::BuildOptions & getCFGBuildOptions()
Stores options for the analyzer from the command line.
bool OmitImplicitValueInitializers
Definition: CFG.h:1253
bool AddCXXDefaultInitExprInAggregates
Definition: CFG.h:1249
BuildOptions & setAllAlwaysAdd()
Definition: CFG.h:1266
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition: Preprocessor.h:145
AnalysisManager(ASTContext &ctx, Preprocessor &PP, PathDiagnosticConsumers Consumers, StoreManagerCreator storemgr, ConstraintManagerCreator constraintmgr, CheckerManager *checkerMgr, AnalyzerOptions &Options, std::unique_ptr< CodeInjector > injector=nullptr)
std::unique_ptr< ConstraintManager >(* ConstraintManagerCreator)(ProgramStateManager &, ExprEngine *)
Definition: ProgramState.h:42
std::unique_ptr< StoreManager >(* StoreManagerCreator)(ProgramStateManager &)
Definition: ProgramState.h:44
std::vector< std::unique_ptr< PathDiagnosticConsumer > > PathDiagnosticConsumers
The JSON file list parser is used to communicate input to InstallAPI.
#define true
Definition: stdbool.h:25