clang
8.0.0
|
Stores options for the analyzer from the command line. More...
#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
Public Types | |
using | ConfigTable = llvm::StringMap< std::string > |
Public Member Functions | |
bool | isUnknownAnalyzerConfig (StringRef Name) const |
AnalyzerOptions () | |
bool | getCheckerBooleanOption (StringRef Name, bool DefaultVal, const ento::CheckerBase *C, bool SearchInParents=false) const |
Interprets an option's string value as a boolean. More... | |
int | getCheckerIntegerOption (StringRef Name, int DefaultVal, const ento::CheckerBase *C, bool SearchInParents=false) const |
Interprets an option's string value as an integer value. More... | |
StringRef | getCheckerStringOption (StringRef Name, StringRef DefaultVal, const ento::CheckerBase *C, bool SearchInParents=false) const |
Query an option's string value. More... | |
UserModeKind | getUserMode () const |
Retrieves and sets the UserMode. More... | |
ExplorationStrategyKind | getExplorationStrategy () const |
IPAKind | getIPAMode () const |
Returns the inter-procedural analysis mode. More... | |
bool | mayInlineCXXMemberFunction (CXXInlineableMemberKind K) const |
Returns the option controlling which C++ member functions will be considered for inlining. More... | |
Static Public Member Functions | |
static std::vector< StringRef > | getRegisteredCheckers (bool IncludeExperimental=false) |
Public Attributes | |
std::vector< std::pair< std::string, bool > > | CheckersControlList |
Pair of checker name and enable/disable. More... | |
ConfigTable | Config |
A key-value table of use-specified configuration values. More... | |
AnalysisStores | AnalysisStoreOpt = RegionStoreModel |
AnalysisConstraints | AnalysisConstraintsOpt = RangeConstraintsModel |
AnalysisDiagClients | AnalysisDiagOpt = PD_HTML |
AnalysisPurgeMode | AnalysisPurgeOpt = PurgeStmt |
std::string | AnalyzeSpecificFunction |
std::string | DumpExplodedGraphTo |
File path to which the exploded graph should be dumped. More... | |
std::string | FullCompilerInvocation |
Store full compiler invocation for reproducible instructions in the generated report. More... | |
unsigned | maxBlockVisitOnPath |
The maximum number of times the analyzer visits a block. More... | |
unsigned | DisableAllChecks: 1 |
Disable all analyzer checks. More... | |
unsigned | ShowCheckerHelp: 1 |
unsigned | ShowEnabledCheckerList: 1 |
unsigned | ShowConfigOptionsList: 1 |
unsigned | ShouldEmitErrorsOnInvalidConfigValue: 1 |
unsigned | AnalyzeAll: 1 |
unsigned | AnalyzerDisplayProgress: 1 |
unsigned | AnalyzeNestedBlocks: 1 |
unsigned | eagerlyAssumeBinOpBifurcation: 1 |
unsigned | TrimGraph: 1 |
unsigned | visualizeExplodedGraphWithGraphViz: 1 |
unsigned | UnoptimizedCFG: 1 |
unsigned | PrintStats: 1 |
unsigned | NoRetryExhausted: 1 |
Do not re-analyze paths leading to exhausted nodes with a different strategy. More... | |
unsigned | InlineMaxStackDepth = 5 |
The inlining stack depth limit. More... | |
AnalysisInliningMode | InliningMode = NoRedundancy |
The mode of function selection used during inlining. More... | |
std::vector< StringRef > | AnalyzerConfigCmdFlags |
Stores options for the analyzer from the command line.
Some options are frontend flags (e.g.: -analyzer-output), but some are analyzer configuration options, which are preceded by -analyzer-config (e.g.: -analyzer-config notes-as-events=true).
If you'd like to add a new frontend flag, add it to include/clang/Driver/CC1Options.td, add a new field to store the value of that flag in this class, and initialize it in lib/Frontend/CompilerInvocation.cpp.
If you'd like to add a new non-checker configuration, register it in include/clang/StaticAnalyzer/Core/AnalyzerOptions.def, and refer to the top of the file for documentation.
If you'd like to add a new checker option, call getChecker*Option() whenever.
Some of the options are controlled by raw frontend flags for no good reason, and should be eventually converted into -analyzer-config flags. New analyzer options should not be implemented as frontend flags. Frontend flags still make sense for things that do not affect the actual analysis.
Definition at line 163 of file AnalyzerOptions.h.
using clang::AnalyzerOptions::ConfigTable = llvm::StringMap<std::string> |
Definition at line 165 of file AnalyzerOptions.h.
|
inline |
Definition at line 262 of file AnalyzerOptions.h.
bool AnalyzerOptions::getCheckerBooleanOption | ( | StringRef | Name, |
bool | DefaultVal, | ||
const ento::CheckerBase * | C, | ||
bool | SearchInParents = false |
||
) | const |
Interprets an option's string value as a boolean.
The "true" string is interpreted as true and the "false" string is interpreted as false.
If an option value is not provided, returns the given DefaultVal
.
[in] | Name | Name for option to retrieve. |
[in] | DefaultVal | Default value returned if no such option was specified. |
[in] | C | The checker object the option belongs to. Checker options are retrieved in the following format: `-analyzer-config <package and="" checker="" name>="">:OptionName=Value. |
[in] | SearchInParents | If set to true and the searched option was not specified for the given checker the options for the parent packages will be searched as well. The inner packages take precedence over the outer ones. |
Definition at line 131 of file AnalyzerOptions.cpp.
Referenced by clang::ento::allocation_state::markReleased(), and clang::ento::registerInnerPointerCheckerAux().
int AnalyzerOptions::getCheckerIntegerOption | ( | StringRef | Name, |
int | DefaultVal, | ||
const ento::CheckerBase * | C, | ||
bool | SearchInParents = false |
||
) | const |
Interprets an option's string value as an integer value.
If an option value is not provided, returns the given DefaultVal
.
[in] | Name | Name for option to retrieve. |
[in] | DefaultVal | Default value returned if no such option was specified. |
[in] | C | The checker object the option belongs to. Checker options are retrieved in the following format: `-analyzer-config <package and="" checker="" name>="">:OptionName=Value. |
[in] | SearchInParents | If set to true and the searched option was not specified for the given checker the options for the parent packages will be searched as well. The inner packages take precedence over the outer ones. |
Definition at line 146 of file AnalyzerOptions.cpp.
StringRef AnalyzerOptions::getCheckerStringOption | ( | StringRef | Name, |
StringRef | DefaultVal, | ||
const ento::CheckerBase * | C, | ||
bool | SearchInParents = false |
||
) | const |
Query an option's string value.
If an option value is not provided, returns the given DefaultVal
.
[in] | Name | Name for option to retrieve. |
[in] | DefaultVal | Default value returned if no such option was specified. |
[in] | C | The checker object the option belongs to. Checker options are retrieved in the following format: `-analyzer-config <package and="" checker="" name>="">:OptionName=Value. |
[in] | SearchInParents | If set to true and the searched option was not specified for the given checker the options for the parent packages will be searched as well. The inner packages take precedence over the outer ones. |
Definition at line 105 of file AnalyzerOptions.cpp.
References llvm::str().
ExplorationStrategyKind AnalyzerOptions::getExplorationStrategy | ( | ) | const |
Definition at line 53 of file AnalyzerOptions.cpp.
References clang::BFS, clang::BFSBlockDFSContents, clang::DFS, clang::UnexploredFirst, clang::UnexploredFirstLocationQueue, and clang::UnexploredFirstQueue.
Referenced by generateWorkList().
IPAKind AnalyzerOptions::getIPAMode | ( | ) | const |
Returns the inter-procedural analysis mode.
Definition at line 72 of file AnalyzerOptions.cpp.
References clang::IPAK_BasicInlining, clang::IPAK_DynamicDispatch, clang::IPAK_DynamicDispatchBifurcate, clang::IPAK_Inlining, and clang::IPAK_None.
Referenced by clang::ento::ExprEngine::bindReturnValue(), and clang::ento::AnalysisManager::shouldInlineCall().
|
static |
Definition at line 34 of file AnalyzerOptions.cpp.
|
inline |
Retrieves and sets the UserMode.
This is a high-level option, which is used to set other low-level options. It is not accessible outside of AnalyzerOptions.
Definition at line 354 of file AnalyzerOptions.h.
References clang::UMK_Deep, and clang::UMK_Shallow.
|
inline |
Definition at line 253 of file AnalyzerOptions.h.
bool AnalyzerOptions::mayInlineCXXMemberFunction | ( | CXXInlineableMemberKind | K | ) | const |
Returns the option controlling which C++ member functions will be considered for inlining.
This is controlled by the 'c++-inlining' config option.
Definition at line 86 of file AnalyzerOptions.cpp.
References clang::CIMK_Constructors, clang::CIMK_Destructors, clang::CIMK_MemberFunctions, clang::CIMK_None, and clang::IPAK_Inlining.
Referenced by clang::ento::ExprEngine::bindReturnValue().
AnalysisConstraints clang::AnalyzerOptions::AnalysisConstraintsOpt = RangeConstraintsModel |
Definition at line 177 of file AnalyzerOptions.h.
AnalysisDiagClients clang::AnalyzerOptions::AnalysisDiagOpt = PD_HTML |
Definition at line 178 of file AnalyzerOptions.h.
AnalysisPurgeMode clang::AnalyzerOptions::AnalysisPurgeOpt = PurgeStmt |
Definition at line 179 of file AnalyzerOptions.h.
Referenced by clang::ento::ExprEngine::processCallExit().
AnalysisStores clang::AnalyzerOptions::AnalysisStoreOpt = RegionStoreModel |
Definition at line 176 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::AnalyzeAll |
Definition at line 204 of file AnalyzerOptions.h.
Referenced by CompactMacroExpandedPieces().
unsigned clang::AnalyzerOptions::AnalyzeNestedBlocks |
Definition at line 206 of file AnalyzerOptions.h.
std::vector<StringRef> clang::AnalyzerOptions::AnalyzerConfigCmdFlags |
Definition at line 240 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::AnalyzerDisplayProgress |
Definition at line 205 of file AnalyzerOptions.h.
std::string clang::AnalyzerOptions::AnalyzeSpecificFunction |
Definition at line 181 of file AnalyzerOptions.h.
std::vector<std::pair<std::string, bool> > clang::AnalyzerOptions::CheckersControlList |
Pair of checker name and enable/disable.
Definition at line 171 of file AnalyzerOptions.h.
Referenced by isInPackage().
ConfigTable clang::AnalyzerOptions::Config |
A key-value table of use-specified configuration values.
Definition at line 175 of file AnalyzerOptions.h.
Referenced by clang::ento::CheckerRegistry::validateCheckerOptions().
unsigned clang::AnalyzerOptions::DisableAllChecks |
Disable all analyzer checks.
This flag allows one to disable analyzer checks on the code processed by the given analysis consumer. Note, the code will get parsed and the command-line options will get checked.
Definition at line 198 of file AnalyzerOptions.h.
std::string clang::AnalyzerOptions::DumpExplodedGraphTo |
File path to which the exploded graph should be dumped.
Definition at line 184 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::eagerlyAssumeBinOpBifurcation |
Definition at line 208 of file AnalyzerOptions.h.
std::string clang::AnalyzerOptions::FullCompilerInvocation |
Store full compiler invocation for reproducible instructions in the generated report.
Definition at line 188 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::InlineMaxStackDepth = 5 |
The inlining stack depth limit.
Definition at line 221 of file AnalyzerOptions.h.
Referenced by mayInlineDecl().
AnalysisInliningMode clang::AnalyzerOptions::InliningMode = NoRedundancy |
The mode of function selection used during inlining.
Definition at line 224 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::maxBlockVisitOnPath |
The maximum number of times the analyzer visits a block.
Definition at line 191 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::NoRetryExhausted |
Do not re-analyze paths leading to exhausted nodes with a different strategy.
We get better code coverage when retry is enabled.
Definition at line 217 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::PrintStats |
Definition at line 213 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::ShouldEmitErrorsOnInvalidConfigValue |
Definition at line 203 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::ShowCheckerHelp |
Definition at line 200 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::ShowConfigOptionsList |
Definition at line 202 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::ShowEnabledCheckerList |
Definition at line 201 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::TrimGraph |
Definition at line 210 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::UnoptimizedCFG |
Definition at line 212 of file AnalyzerOptions.h.
unsigned clang::AnalyzerOptions::visualizeExplodedGraphWithGraphViz |
Definition at line 211 of file AnalyzerOptions.h.
Referenced by clang::ento::AnalysisManager::shouldVisualize().