clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
clang::AnalyzerOptions Class Reference

Stores options for the analyzer from the command line. More...

#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"

Inheritance diagram for clang::AnalyzerOptions:
Inheritance graph
[legend]

Public Types

using ConfigTable = llvm::StringMap< std::string >
 

Public Member Functions

bool isUnknownAnalyzerConfig (llvm::StringRef Name)
 
 AnalyzerOptions ()
 
bool getCheckerBooleanOption (StringRef CheckerName, StringRef OptionName, bool SearchInParents=false) const
 Interprets an option's string value as a boolean.
 
bool getCheckerBooleanOption (const ento::CheckerBase *C, StringRef OptionName, bool SearchInParents=false) const
 
int getCheckerIntegerOption (StringRef CheckerName, StringRef OptionName, bool SearchInParents=false) const
 Interprets an option's string value as an integer value.
 
int getCheckerIntegerOption (const ento::CheckerBase *C, StringRef OptionName, bool SearchInParents=false) const
 
StringRef getCheckerStringOption (StringRef CheckerName, StringRef OptionName, bool SearchInParents=false) const
 Query an option's string value.
 
StringRef getCheckerStringOption (const ento::CheckerBase *C, StringRef OptionName, bool SearchInParents=false) const
 
ExplorationStrategyKind getExplorationStrategy () const
 
CTUPhase1InliningKind getCTUPhase1Inlining () const
 
IPAKind getIPAMode () const
 Returns the inter-procedural analysis mode.
 
bool mayInlineCXXMemberFunction (CXXInlineableMemberKind K) const
 Returns the option controlling which C++ member functions will be considered for inlining.
 
ento::PathDiagnosticConsumerOptions getDiagOpts () const
 

Static Public Member Functions

static std::vector< StringRef > getRegisteredCheckers (bool IncludeExperimental=false)
 Retrieves the list of checkers generated from Checkers.td.
 
static std::vector< StringRef > getRegisteredPackages (bool IncludeExperimental=false)
 Retrieves the list of packages generated from Checkers.td.
 
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.
 

Public Attributes

std::vector< std::pair< std::string, bool > > CheckersAndPackages
 Pairs of checker/package name and enable/disable.
 
std::vector< std::string > SilencedCheckersAndPackages
 Vector of checker/package names which will not emit warnings.
 
ConfigTable Config
 A key-value table of use-specified configuration values.
 
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.
 
std::string FullCompilerInvocation
 Store full compiler invocation for reproducible instructions in the generated report.
 
unsigned maxBlockVisitOnPath
 The maximum number of times the analyzer visits a block.
 
unsigned DisableAllCheckers: 1
 Disable all analyzer checkers.
 
unsigned ShowCheckerHelp: 1
 
unsigned ShowCheckerHelpAlpha: 1
 
unsigned ShowCheckerHelpDeveloper: 1
 
unsigned ShowCheckerOptionList: 1
 
unsigned ShowCheckerOptionAlphaList: 1
 
unsigned ShowCheckerOptionDeveloperList: 1
 
unsigned ShowEnabledCheckerList: 1
 
unsigned ShowConfigOptionsList: 1
 
unsigned ShouldEmitErrorsOnInvalidConfigValue: 1
 
unsigned AnalyzeAll: 1
 
unsigned AnalyzerDisplayProgress: 1
 
unsigned AnalyzerNoteAnalysisEntryPoints: 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.
 
bool AnalyzerWerror: 1
 Emit analyzer warnings as errors.
 
unsigned InlineMaxStackDepth
 The inlining stack depth limit.
 
AnalysisInliningMode InliningMode = NoRedundancy
 The mode of function selection used during inlining.
 

Detailed Description

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.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 179 of file