14 #ifndef LLVM_CLANG_STATICANALYZER_CORE_ANALYZEROPTIONS_H 15 #define LLVM_CLANG_STATICANALYZER_CORE_ANALYZEROPTIONS_H 18 #include "llvm/ADT/IntrusiveRefCntPtr.h" 19 #include "llvm/ADT/Optional.h" 20 #include "llvm/ADT/StringMap.h" 21 #include "llvm/ADT/StringRef.h" 22 #include "llvm/ADT/StringSwitch.h" 37 #define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE) NAME, 38 #include "clang/StaticAnalyzer/Core/Analyses.def" 44 #define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) NAME##Model, 45 #include "clang/StaticAnalyzer/Core/Analyses.def" 51 #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) NAME##Model, 52 #include "clang/StaticAnalyzer/Core/Analyses.def" 59 #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN) PD_##NAME, 60 #include "clang/StaticAnalyzer/Core/Analyses.def" 67 #define ANALYSIS_PURGE(NAME, CMDFLAG, DESC) NAME, 68 #include "clang/StaticAnalyzer/Core/Analyses.def" 74 #define ANALYSIS_INLINING_MODE(NAME, CMDFLAG, DESC) NAME, 75 #include "clang/StaticAnalyzer/Core/Analyses.def" 166 static std::vector<StringRef>
167 getRegisteredCheckers(
bool IncludeExperimental =
false);
186 static void printFormattedEntry(
187 llvm::raw_ostream &Out,
188 std::pair<StringRef, StringRef> EntryDescPair,
189 size_t EntryWidth,
size_t InitialPad,
size_t MinLineWidth = 0);
253 unsigned InlineMaxStackDepth = 5;
259 #define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \ 260 SHALLOW_VAL, DEEP_VAL) \ 261 ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, SHALLOW_VAL) 263 #define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \ 266 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.def" 267 #undef ANALYZER_OPTION 268 #undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE 272 std::vector<StringRef> AnalyzerConfigCmdFlags = {
273 #define ANALYZER_OPTION_DEPENDS_ON_USER_MODE(TYPE, NAME, CMDFLAG, DESC, \ 274 SHALLOW_VAL, DEEP_VAL) \ 275 ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, SHALLOW_VAL) 277 #define ANALYZER_OPTION(TYPE, NAME, CMDFLAG, DESC, DEFAULT_VAL) \ 280 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.def" 281 #undef ANALYZER_OPTION 282 #undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE 287 assert(std::is_sorted(AnalyzerConfigCmdFlags.begin(),
288 AnalyzerConfigCmdFlags.end()));
290 return !std::binary_search(AnalyzerConfigCmdFlags.begin(),
291 AnalyzerConfigCmdFlags.end(), Name);
295 : DisableAllChecks(
false), ShowCheckerHelp(
false),
296 ShowCheckerHelpAlpha(
false), ShowCheckerHelpDeveloper(
false),
297 ShowCheckerOptionList(
false), ShowCheckerOptionAlphaList(
false),
298 ShowCheckerOptionDeveloperList(
false), ShowEnabledCheckerList(
false),
299 ShowConfigOptionsList(
false), AnalyzeAll(
false),
300 AnalyzerDisplayProgress(
false), AnalyzeNestedBlocks(
false),
301 eagerlyAssumeBinOpBifurcation(
false), TrimGraph(
false),
302 visualizeExplodedGraphWithGraphViz(
false), UnoptimizedCFG(
false),
304 llvm::sort(AnalyzerConfigCmdFlags);
322 bool getCheckerBooleanOption(StringRef CheckerName, StringRef OptionName,
323 bool SearchInParents =
false)
const;
326 bool SearchInParents =
false)
const;
342 int getCheckerIntegerOption(StringRef CheckerName, StringRef OptionName,
343 bool SearchInParents =
false)
const;
346 bool SearchInParents =
false)
const;
362 StringRef getCheckerStringOption(StringRef CheckerName, StringRef OptionName,
363 bool SearchInParents =
false)
const;
366 StringRef OptionName,
367 bool SearchInParents =
false)
const;
399 auto K = llvm::StringSwitch<llvm::Optional<UserModeKind>>(UserMode)
403 assert(K.hasValue() &&
"User mode is invalid.");
409 #endif // LLVM_CLANG_STATICANALYZER_CORE_ANALYZEROPTIONS_H
Inline C functions and blocks when their definitions are available.
IPAKind
Describes the different modes of inter-procedural analysis.
unsigned ShowCheckerHelpDeveloper
unsigned visualizeExplodedGraphWithGraphViz
Perform only intra-procedural analysis.
UserModeKind getUserMode() const
Retrieves and sets the UserMode.
A dummy mode in which no C++ inlining is enabled.
Inline callees(C, C++, ObjC) when their definitions are available.
std::string DumpExplodedGraphTo
File path to which the exploded graph should be dumped.
unsigned eagerlyAssumeBinOpBifurcation
unsigned ShowCheckerHelpAlpha
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
unsigned ShowCheckerOptionList
std::string FullCompilerInvocation
Store full compiler invocation for reproducible instructions in the generated report.
std::vector< std::pair< std::string, bool > > CheckersControlList
Pair of checker name and enable/disable.
AnalysisStores
AnalysisStores - Set of available analysis store models.
unsigned ShowEnabledCheckerList
Refers to regular member function and operator calls.
unsigned ShowConfigOptionsList
AnalysisInliningMode
AnalysisInlineFunctionSelection - Set of inlining function selection heuristics.
Refers to constructors (implicit or explicit).
unsigned AnalyzerWerror
Emit analyzer warnings as errors.
Enable inlining of dynamically dispatched methods.
UserModeKind
Describes the kinds for high-level analyzer mode.
AnalysisConstraints
AnalysisConstraints - Set of available constraint models.
llvm::StringMap< std::string > ConfigTable
ConfigTable Config
A key-value table of use-specified configuration values.
unsigned ShowCheckerOptionDeveloperList
Refers to destructors (implicit or explicit).
bool isUnknownAnalyzerConfig(StringRef Name) const
unsigned maxBlockVisitOnPath
The maximum number of times the analyzer visits a block.
unsigned DisableAllChecks
Disable all analyzer checks.
Dataflow Directional Tag Classes.
Perform shallow but fast analyzes.
std::string AnalyzeSpecificFunction
AnalysisPurgeMode
AnalysisPurgeModes - Set of available strategies for dead symbol removal.
Stores options for the analyzer from the command line.
unsigned AnalyzerDisplayProgress
unsigned ShowCheckerOptionAlphaList
unsigned AnalyzeNestedBlocks
unsigned NoRetryExhausted
Do not re-analyze paths leading to exhausted nodes with a different strategy.
Analyses
Analysis - Set of available source code analyses.
CXXInlineableMemberKind
Describes the different kinds of C++ member functions which can be considered for inlining by the ana...
unsigned ShouldEmitErrorsOnInvalidConfigValue
Enable inlining of dynamically dispatched methods, bifurcate paths when exact type info is unavailabl...
AnalysisDiagClients
AnalysisDiagClients - Set of available diagnostic clients for rendering analysis results.