clang API Documentation

Public Types | Public Member Functions | Public Attributes
clang::AnalyzerOptions Class Reference

#include <AnalyzerOptions.h>

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

List of all members.

Public Types

typedef llvm::StringMap
< std::string > 
ConfigTable

Public Member Functions

bool getBooleanOption (StringRef Name, bool DefaultVal)
bool getBooleanOption (Optional< bool > &V, StringRef Name, bool DefaultVal)
 Variant that accepts a Optional value to cache the result.
int getOptionAsInteger (StringRef Name, int DefaultVal)
 Interprets an option's string value as an integer value.
UserModeKind getUserMode ()
 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.
IPAKind getIPAMode ()
 Returns the inter-procedural analysis mode.
bool mayInlineCXXMemberFunction (CXXInlineableMemberKind K)
bool mayInlineObjCMethod ()
 Returns true if ObjectiveC inlining is enabled, false otherwise.
bool includeTemporaryDtorsInCFG ()
bool mayInlineCXXStandardLibrary ()
bool mayInlineTemplateFunctions ()
bool mayInlineCXXAllocator ()
bool mayInlineCXXContainerMethods ()
bool mayInlineCXXSharedPtrDtor ()
bool shouldSuppressNullReturnPaths ()
bool shouldAvoidSuppressingNullArgumentPaths ()
bool shouldSuppressInlinedDefensiveChecks ()
bool shouldSuppressFromCXXStandardLibrary ()
bool shouldReportIssuesInMainSourceFile ()
bool shouldWriteStableReportFilename ()
bool shouldPrunePaths ()
bool shouldConditionalizeStaticInitializers ()
unsigned getAlwaysInlineSize ()
unsigned getMaxInlinableSize ()
bool shouldSynthesizeBodies ()
unsigned getGraphTrimInterval ()
unsigned getMaxTimesInlineLarge ()
unsigned getMaxNodesPerTopLevelFunction ()
 AnalyzerOptions ()

Public Attributes

std::vector< std::pair
< std::string, bool > > 
CheckersControlList
 Pair of checker name and enable/disable.
ConfigTable Config
 A key-value table of use-specified configuration values.
AnalysisStores AnalysisStoreOpt
AnalysisConstraints AnalysisConstraintsOpt
AnalysisDiagClients AnalysisDiagOpt
AnalysisPurgeMode AnalysisPurgeOpt
std::string AnalyzeSpecificFunction
unsigned maxBlockVisitOnPath
 The maximum number of times the analyzer visits a block.
unsigned DisableAllChecks: 1
 Disable all analyzer checks.
unsigned ShowCheckerHelp: 1
unsigned AnalyzeAll: 1
unsigned AnalyzerDisplayProgress: 1
unsigned AnalyzeNestedBlocks: 1
unsigned eagerlyAssumeBinOpBifurcation: 1
 The flag regulates if we should eagerly assume evaluations of conditionals, thus, bifurcating the path.
unsigned TrimGraph: 1
unsigned visualizeExplodedGraphWithGraphViz: 1
unsigned visualizeExplodedGraphWithUbiGraph: 1
unsigned UnoptimizedCFG: 1
unsigned PrintStats: 1
unsigned NoRetryExhausted: 1
 Do not re-analyze paths leading to exhausted nodes with a different strategy. We get better code coverage when retry is enabled.
unsigned InlineMaxStackDepth
 The inlining stack depth limit.
AnalysisInliningMode InliningMode
 The mode of function selection used during inlining.

Detailed Description

Definition at line 120 of file AnalyzerOptions.h.


Member Typedef Documentation

typedef llvm::StringMap<std::string> clang::AnalyzerOptions::ConfigTable

Definition at line 122 of file AnalyzerOptions.h.


Constructor & Destructor Documentation

Definition at line 425 of file AnalyzerOptions.h.


Member Function Documentation

Definition at line 212 of file AnalyzerOptions.cpp.

bool AnalyzerOptions::getBooleanOption ( StringRef  Name,
bool  DefaultVal 
)

Interprets an option's string value as a boolean.

Accepts the strings "true" and "false". If an option value is not provided, returns the given DefaultVal.

Definition at line 101 of file AnalyzerOptions.cpp.

References toString().

Referenced by clang::ento::GRBugReporter::generatePathDiagnostic(), and clang::ento::shouldIncludeAllocationSiteInLeakDiagnostics().

bool AnalyzerOptions::getBooleanOption ( Optional< bool > &  V,
StringRef  Name,
bool  DefaultVal 
)

Variant that accepts a Optional value to cache the result.

Definition at line 112 of file AnalyzerOptions.cpp.

Returns how often nodes in the ExplodedGraph should be recycled to save memory.

This is controlled by the 'graph-trim-interval' config option. To disable node reclamation, set the option to "0".

Definition at line 239 of file AnalyzerOptions.cpp.

Definition at line 218 of file AnalyzerOptions.cpp.

Referenced by mayInlineDecl().

Returns the maximum number of nodes the analyzer can generate while exploring a top level function (for each exploded graph). 150000 is default; 0 means no limit.

This is controlled by the 'max-nodes' config option.

Definition at line 251 of file AnalyzerOptions.cpp.

Returns the maximum times a large function could be inlined.

This is controlled by the 'max-times-inline-large' config option.

Definition at line 245 of file AnalyzerOptions.cpp.

int AnalyzerOptions::getOptionAsInteger ( StringRef  Name,
int  DefaultVal 
)

Interprets an option's string value as an integer value.

Definition at line 199 of file AnalyzerOptions.cpp.

References getValue().

AnalyzerOptions::UserModeKind AnalyzerOptions::getUserMode ( )

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 24 of file AnalyzerOptions.cpp.

Returns whether or not the destructors for C++ temporary objects should be included in the CFG.

This is controlled by the 'cfg-temporary-dtors' config option, which accepts the values "true" and "false".

Definition at line 119 of file AnalyzerOptions.cpp.

Returns whether or not allocator call may be considered for inlining.

This is controlled by the 'c++-allocator-inlining' config option, which accepts the values "true" and "false".

Definition at line 137 of file AnalyzerOptions.cpp.

Referenced by mayInlineCallKind(), and clang::ento::ExprEngine::ProcessNewAllocator().

Returns whether or not methods of C++ container objects may be considered for inlining.

This is controlled by the 'c++-container-inlining' config option, which accepts the values "true" and "false".

Definition at line 143 of file AnalyzerOptions.cpp.

Referenced by mayInlineDecl().

Returns the option controlling which C++ member functions will be considered for inlining.

This is controlled by the 'c++-inlining' config option.

See also:
CXXMemberInliningMode

Definition at line 69 of file AnalyzerOptions.cpp.

References clang::CIMK_Constructors, clang::CIMK_Destructors, clang::CIMK_MemberFunctions, clang::CIMK_None, and clang::IPAK_Inlining.

Referenced by mayInlineCallKind().

Returns whether or not the destructor of C++ 'shared_ptr' may be considered for inlining.

This covers std::shared_ptr, std::tr1::shared_ptr, and boost::shared_ptr, and indeed any destructor named "~shared_ptr".

This is controlled by the 'c++-shared_ptr-inlining' config option, which accepts the values "true" and "false".

Definition at line 149 of file AnalyzerOptions.cpp.

Referenced by mayInlineDecl().

Returns whether or not C++ standard library functions may be considered for inlining.

This is controlled by the 'c++-stdlib-inlining' config option, which accepts the values "true" and "false".

Definition at line 125 of file AnalyzerOptions.cpp.

Referenced by mayInlineDecl().

Returns true if ObjectiveC inlining is enabled, false otherwise.

Definition at line 156 of file AnalyzerOptions.cpp.

Referenced by mayInlineCallKind().

Returns whether or not templated functions may be considered for inlining.

This is controlled by the 'c++-template-inlining' config option, which accepts the values "true" and "false".

Definition at line 131 of file AnalyzerOptions.cpp.

Referenced by mayInlineDecl().

Returns whether a bug report should not be suppressed if its path includes a call with a null argument, even if that call has a null return.

This option has no effect when shouldSuppressNullReturnPaths() is false.

This is a counter-heuristic to avoid false negatives.

This is controlled by the 'avoid-suppressing-null-argument-paths' config option, which accepts the values "true" and "false".

Definition at line 168 of file AnalyzerOptions.cpp.

Returns true if 'static' initializers should be in conditional logic in the CFG.

Definition at line 278 of file AnalyzerOptions.cpp.

Returns whether irrelevant parts of a bug report path should be pruned out of the final output.

This is controlled by the 'prune-paths' config option, which accepts the values "true" and "false".

Definition at line 274 of file AnalyzerOptions.cpp.

Returns whether or not the diagnostic report should be always reported in the main source file and not the headers.

This is controlled by the 'report-in-main-source-file' config option, which accepts the values "true" and "false".

Definition at line 186 of file AnalyzerOptions.cpp.

Returns whether or not diagnostics reported within the C++ standard library should be suppressed.

This is controlled by the 'suppress-c++-stdlib' config option, which accepts the values "true" and "false".

Definition at line 180 of file AnalyzerOptions.cpp.

Referenced by clang::ento::LikelyFalsePositiveSuppressionBRVisitor::getEndPath().

Returns whether or not diagnostics containing inlined defensive NULL checks should be suppressed.

This is controlled by the 'suppress-inlined-defensive-checks' config option, which accepts the values "true" and "false".

Definition at line 174 of file AnalyzerOptions.cpp.

Referenced by clang::ento::SuppressInlineDefensiveChecksVisitor::SuppressInlineDefensiveChecksVisitor().

Returns whether or not paths that go through null returns should be suppressed.

This is a heuristic for avoiding bug reports with paths that go through inlined functions that are more defensive than their callers.

This is controlled by the 'suppress-null-return-paths' config option, which accepts the values "true" and "false".

Definition at line 162 of file AnalyzerOptions.cpp.

Returns true if the analyzer engine should synthesize fake bodies for well-known functions.

Definition at line 270 of file AnalyzerOptions.cpp.

Returns whether or not the report filename should be random or not.

This is controlled by the 'stable-report-filename' config option, which accepts the values "true" and "false". Default = false

Definition at line 193 of file AnalyzerOptions.cpp.


Member Data Documentation

Definition at line 130 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 131 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 129 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 148 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 150 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 149 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 134 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

std::vector<std::pair<std::string, bool> > clang::AnalyzerOptions::CheckersControlList

Pair of checker name and enable/disable.

Definition at line 125 of file AnalyzerOptions.h.

Referenced by clang::ento::createCheckerManager(), and ParseAnalyzerArgs().

A key-value table of use-specified configuration values.

Definition at line 128 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

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 145 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

The flag regulates if we should eagerly assume evaluations of conditionals, thus, bifurcating the path.

This flag indicates how the engine should handle expressions such as: 'x = (y != 0)'. When this flag is true then the subexpression 'y != 0' will be eagerly assumed to be true or false, thus evaluating it to the integers 0 or 1 respectively. The upside is that this can increase analysis precision until we have a better way to lazily evaluate such logic. The downside is that it eagerly bifurcates paths.

Definition at line 161 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs(), and clang::ento::ExprEngine::Visit().

The inlining stack depth limit.

Definition at line 174 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

The mode of function selection used during inlining.

Definition at line 177 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

The maximum number of times the analyzer visits a block.

Definition at line 137 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs(), and clang::ento::ExprEngine::processCFGBlockEntrance().

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 171 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs(), and clang::ento::ExprEngine::processCFGBlockEntrance().

Definition at line 167 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 147 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 163 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().

Definition at line 166 of file AnalyzerOptions.h.

Referenced by ParseAnalyzerArgs().


The documentation for this class was generated from the following files: