class SVal
Declaration
class SVal { /* full declaration omitted */ };
Description
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:73
Member Variables
- protected const void* Data = nullptr
- protected unsigned int Kind = 0
- The lowest 2 bits are a BaseKind (0 -- 3). The higher bits are an unsigned "kind" value.
Method Overview
- public void Profile(llvm::FoldingSetNodeID & ID) const
- protected SVal(clang::ento::SVal::BaseKind k, const void * D = nullptr)
- public SVal()
- protected SVal(const void * d, bool isLoc, unsigned int ValKind)
- public template <typename T>T castAs() const
- public void dump() const
- public void dumpToStream(llvm::raw_ostream & OS) const
- public template <typename T>Optional<T> getAs() const
- public const clang::FunctionDecl * getAsFunctionDecl() const
- public const llvm::APSInt * getAsInteger() const
- public clang::ento::SymbolRef getAsLocSymbol(bool IncludeBaseRegions = false) const
- public const clang::ento::MemRegion * getAsRegion() const
- public clang::ento::SymbolRef getAsSymbol(bool IncludeBaseRegions = false) const
- public clang::ento::SVal::BaseKind getBaseKind() const
- public clang::ento::SymbolRef getLocSymbolInBase() const
- public unsigned int getRawKind() const
- public unsigned int getSubKind() const
- public clang::QualType getType(const clang::ASTContext &) const
- public bool isConstant(int I) const
- public bool isConstant() const
- public bool isUndef() const
- public bool isUnknown() const
- public bool isUnknownOrUndef() const
- public bool isValid() const
- public bool isZeroConstant() const
- public void printJson(llvm::raw_ostream & Out, bool AddQuotes) const
- public SymExpr::symbol_iterator symbol_begin() const
- public SymExpr::symbol_iterator symbol_end() const
Methods
¶void Profile(llvm::FoldingSetNodeID& ID) const
void Profile(llvm::FoldingSetNodeID& ID) const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:114
Parameters
¶SVal(clang::ento::SVal::BaseKind k,
const void* D = nullptr)
SVal(clang::ento::SVal::BaseKind k,
const void* D = nullptr)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:93
Parameters
- clang::ento::SVal::BaseKind k
- const void* D = nullptr
¶SVal()
SVal()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:96
¶SVal(const void* d,
bool isLoc,
unsigned int ValKind)
SVal(const void* d,
bool isLoc,
unsigned int ValKind)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:90
Parameters
- const void* d
- bool isLoc
- unsigned int ValKind
¶template <typename T>
T castAs() const
template <typename T>
T castAs() const
Description
Convert to the specified SVal type, asserting that this SVal is of the desired type.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:100
Templates
- T
¶void dump() const
void dump() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:182
¶void dumpToStream(llvm::raw_ostream& OS) const
void dumpToStream(llvm::raw_ostream& OS) const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:181
Parameters
¶template <typename T>
Optional<T> getAs() const
template <typename T>
Optional<T> getAs() const
Description
Convert to the specified SVal type, returning None if this SVal is not of the desired type.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:104
Templates
- T
¶const clang::FunctionDecl* getAsFunctionDecl()
const
const clang::FunctionDecl* getAsFunctionDecl()
const
Description
getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a CodeTextRegion wrapping a FunctionDecl, return that FunctionDecl. Otherwise return 0.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:150
¶const llvm::APSInt* getAsInteger() const
const llvm::APSInt* getAsInteger() const
Description
If this SVal is loc::ConcreteInt or nonloc::ConcreteInt, return a pointer to APSInt which is held in it. Otherwise, return nullptr.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:174
¶clang::ento::SymbolRef getAsLocSymbol(
bool IncludeBaseRegions = false) const
clang::ento::SymbolRef getAsLocSymbol(
bool IncludeBaseRegions = false) const
Description
If this SVal is a location and wraps a symbol, return that SymbolRef. Otherwise return 0. Casts are ignored during lookup.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:158
Parameters
- bool IncludeBaseRegions = false
- The boolean that controls whether the search should continue to the base regions if the region is not symbolic.
¶const clang::ento::MemRegion* getAsRegion() const
const clang::ento::MemRegion* getAsRegion() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:176
¶clang::ento::SymbolRef getAsSymbol(
bool IncludeBaseRegions = false) const
clang::ento::SymbolRef getAsSymbol(
bool IncludeBaseRegions = false) const
Description
If this SVal wraps a symbol return that SymbolRef. Otherwise, return 0. Casts are ignored during lookup.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:169
Parameters
- bool IncludeBaseRegions = false
- The boolean that controls whether the search should continue to the base regions if the region is not symbolic.
¶clang::ento::SVal::BaseKind getBaseKind() const
clang::ento::SVal::BaseKind getBaseKind() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:109
¶clang::ento::SymbolRef getLocSymbolInBase() const
clang::ento::SymbolRef getLocSymbolInBase() const
Description
Get the symbol in the SVal or its base region.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:161
¶unsigned int getRawKind() const
unsigned int getRawKind() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:108
¶unsigned int getSubKind() const
unsigned int getSubKind() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:110
¶clang::QualType getType(
const clang::ASTContext&) const
clang::QualType getType(
const clang::ASTContext&) const
Description
Try to get a reasonable type for the given value.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:207
Parameters
- const clang::ASTContext&
Returns
The best approximation of the value type or Null. In theory, all symbolic values should be typed, but this function is still a WIP and might have a few blind spots.
¶bool isConstant(int I) const
bool isConstant(int I) const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:143
Parameters
- int I
¶bool isConstant() const
bool isConstant() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:141
¶bool isUndef() const
bool isUndef() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:129
¶bool isUnknown() const
bool isUnknown() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:125
¶bool isUnknownOrUndef() const
bool isUnknownOrUndef() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:133
¶bool isValid() const
bool isValid() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:137
¶bool isZeroConstant() const
bool isZeroConstant() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:145
¶void printJson(llvm::raw_ostream& Out,
bool AddQuotes) const
void printJson(llvm::raw_ostream& Out,
bool AddQuotes) const
Description
printJson - Pretty-prints in JSON format.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:179
Parameters
- llvm::raw_ostream& Out
- bool AddQuotes
¶SymExpr::symbol_iterator symbol_begin() const
SymExpr::symbol_iterator symbol_begin() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:184
¶SymExpr::symbol_iterator symbol_end() const
SymExpr::symbol_iterator symbol_end() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h:192