Go to the documentation of this file.
14 #ifndef LLVM_CLANG_STATICANALYZER_CORE_ANALYZEROPTIONS_H
15 #define LLVM_CLANG_STATICANALYZER_CORE_ANALYZEROPTIONS_H
19 #include "llvm/ADT/IntrusiveRefCntPtr.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/ADT/StringSwitch.h"
38 #define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE) NAME,
39 #include "clang/StaticAnalyzer/Core/Analyses.def"
45 #define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) NAME##Model,
46 #include "clang/StaticAnalyzer/Core/Analyses.def"
52 #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) NAME##Model,
53 #include "clang/StaticAnalyzer/Core/Analyses.def"
60 #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN) PD_##NAME,
61 #include "clang/StaticAnalyzer/Core/Analyses.def"
68 #define ANALYSIS_PURGE(NAME, CMDFLAG, DESC) NAME,
69 #include "clang/StaticAnalyzer/Core/Analyses.def"
75 #define ANALYSIS_INLINING_MODE(NAME, CMDFLAG, DESC) NAME,
76 #include "clang/StaticAnalyzer/Core/Analyses.def"
171 static std::vector<StringRef>
176 static std::vector<StringRef>
197 std::pair<StringRef, StringRef> EntryDescPair,
198 size_t InitialPad,
size_t EntryWidth,
199 size_t MinLineWidth = 0);
270 #define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \
271 SHALLOW_VAL, DEEP_VAL) \
272 ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, SHALLOW_VAL)
274 #define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \
277 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.def"
278 #undef ANALYZER_OPTION
279 #undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE
284 #define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \
285 SHALLOW_VAL, DEEP_VAL) \
286 ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, SHALLOW_VAL)
288 #define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \
289 llvm::StringLiteral(CMDFLAG),
291 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.def"
292 #undef ANALYZER_OPTION
293 #undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE
332 bool SearchInParents =
false)
const;
335 bool SearchInParents =
false)
const;
352 bool SearchInParents =
false)
const;
355 bool SearchInParents =
false)
const;
372 bool SearchInParents =
false)
const;
375 StringRef OptionName,
376 bool SearchInParents =
false)
const;
399 ShouldDisplayMacroExpansions,
400 ShouldSerializeStats,
405 ShouldWriteStableReportFilename || ShouldWriteVerboseReportFilename,
408 ShouldDisplayCheckerNameForText};
423 auto K = llvm::StringSwitch<llvm::Optional<UserModeKind>>(UserMode)
427 assert(K.hasValue() &&
"User mode is invalid.");
431 inline std::vector<StringRef>
433 static constexpr llvm::StringLiteral StaticAnalyzerCheckerNames[] = {
435 #define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI, IS_HIDDEN) \
436 llvm::StringLiteral(FULLNAME),
437 #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
441 std::vector<StringRef> Checkers;
442 for (StringRef CheckerName : StaticAnalyzerCheckerNames) {
443 if (!CheckerName.startswith(
"debug.") &&
444 (IncludeExperimental || !CheckerName.startswith(
"alpha.")))
445 Checkers.push_back(CheckerName);
450 inline std::vector<StringRef>
452 static constexpr llvm::StringLiteral StaticAnalyzerPackageNames[] = {
454 #define PACKAGE(FULLNAME) llvm::StringLiteral(FULLNAME),
455 #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
459 std::vector<StringRef> Packages;
460 for (StringRef PackageName : StaticAnalyzerPackageNames) {
461 if (PackageName !=
"debug" &&
462 (IncludeExperimental || PackageName !=
"alpha"))
463 Packages.push_back(PackageName);
470 #endif // LLVM_CLANG_STATICANALYZER_CORE_ANALYZEROPTIONS_H
These options tweak the behavior of path diangostic consumers.
@ IPAK_BasicInlining
Inline C functions and blocks when their definitions are available.
unsigned ShowCheckerOptionDeveloperList
static std::vector< StringRef > getRegisteredPackages(bool IncludeExperimental=false)
Retrieves the list of packages generated from Checkers.td.
unsigned maxBlockVisitOnPath
The maximum number of times the analyzer visits a block.
AnalysisConstraints AnalysisConstraintsOpt
unsigned DisableAllCheckers
Disable all analyzer checkers.
bool AnalyzerWerror
Emit analyzer warnings as errors.
UserModeKind getUserMode() const
Retrieves and sets the UserMode.
@ UnexploredFirstLocationQueue
@ UMK_Shallow
Perform shallow but fast analyzes.
CTUPhase1InliningKind getCTUPhase1Inlining() const
AnalysisPurgeMode AnalysisPurgeOpt
@ IPAK_Inlining
Inline callees(C, C++, ObjC) when their definitions are available.
ExplorationStrategyKind getExplorationStrategy() const
unsigned AnalyzeNestedBlocks
@ CIMK_Constructors
Refers to constructors (implicit or explicit).
StringRef getCheckerStringOption(StringRef CheckerName, StringRef OptionName, bool SearchInParents=false) const
Query an option's string value.
llvm::StringMap< std::string > ConfigTable
@ IPAK_DynamicDispatchBifurcate
Enable inlining of dynamically dispatched methods, bifurcate paths when exact type info is unavailabl...
unsigned ShowCheckerHelpAlpha
bool mayInlineCXXMemberFunction(CXXInlineableMemberKind K) const
Returns the option controlling which C++ member functions will be considered for inlining.
AnalysisDiagClients
AnalysisDiagClients - Set of available diagnostic clients for rendering analysis results.
unsigned AnalyzerDisplayProgress
@ CIMK_None
A dummy mode in which no C++ inlining is enabled.
AnalysisStores AnalysisStoreOpt
@ IPAK_DynamicDispatch
Enable inlining of dynamically dispatched methods.
AnalysisInliningMode InliningMode
The mode of function selection used during inlining.
unsigned ShowEnabledCheckerList
AnalysisDiagClients AnalysisDiagOpt
CXXInlineableMemberKind
Describes the different kinds of C++ member functions which can be considered for inlining by the ana...
int getCheckerIntegerOption(StringRef CheckerName, StringRef OptionName, bool SearchInParents=false) const
Interprets an option's string value as an integer value.
AnalysisConstraints
AnalysisConstraints - Set of available constraint models.
unsigned eagerlyAssumeBinOpBifurcation
static std::vector< StringRef > getRegisteredCheckers(bool IncludeExperimental=false)
Retrieves the list of checkers generated from Checkers.td.
@ NUM_ANALYSIS_DIAG_CLIENTS
unsigned ShowCheckerOptionList
bool isUnknownAnalyzerConfig(StringRef Name) const
std::vector< std::pair< std::string, bool > > CheckersAndPackages
Pairs of checker/package name and enable/disable.
ConfigTable Config
A key-value table of use-specified configuration values.
@ IPAK_None
Perform only intra-procedural analysis.
IPAKind getIPAMode() const
Returns the inter-procedural analysis mode.
std::string AnalyzeSpecificFunction
AnalysisInliningMode
AnalysisInlineFunctionSelection - Set of inlining function selection heuristics.
unsigned ShowCheckerHelpDeveloper
static void printFormattedEntry(llvm::raw_ostream &Out, std::pair< StringRef, StringRef > EntryDescPair, size_t InitialPad, size_t EntryWidth, size_t MinLineWidth=0)
Convenience function for printing options or checkers and their description in a formatted manner.
ento::PathDiagnosticConsumerOptions getDiagOpts() const
std::string DumpExplodedGraphTo
File path to which the exploded graph should be dumped.
Stores options for the analyzer from the command line.
unsigned ShowConfigOptionsList
unsigned InlineMaxStackDepth
The inlining stack depth limit.
std::vector< std::string > SilencedCheckersAndPackages
Vector of checker/package names which will not emit warnings.
unsigned ShouldEmitErrorsOnInvalidConfigValue
bool getCheckerBooleanOption(StringRef CheckerName, StringRef OptionName, bool SearchInParents=false) const
Interprets an option's string value as a boolean.
unsigned NoRetryExhausted
Do not re-analyze paths leading to exhausted nodes with a different strategy.
std::vector< llvm::StringLiteral > AnalyzerConfigCmdFlags
std::string FullCompilerInvocation
Store full compiler invocation for reproducible instructions in the generated report.
@ CIMK_Destructors
Refers to destructors (implicit or explicit).
@ CIMK_MemberFunctions
Refers to regular member function and operator calls.
IPAKind
Describes the different modes of inter-procedural analysis.
AnalysisStores
AnalysisStores - Set of available analysis store models.
unsigned visualizeExplodedGraphWithGraphViz
AnalysisPurgeMode
AnalysisPurgeModes - Set of available strategies for dead symbol removal.
Analyses
Analysis - Set of available source code analyses.
UserModeKind
Describes the kinds for high-level analyzer mode.
@ UMK_Deep
Perform deep analyzes.
unsigned ShowCheckerOptionAlphaList