18 #include "llvm/Support/raw_ostream.h"
19 using namespace clang;
35 if (isa<SymbolConjured>(sym))
43 if (isa<SymbolConjured>(sym))
55 if (
const FunctionDecl *FD = dyn_cast<FunctionDecl>(CTR->getDecl()))
72 return X->getLoc().getAsLocSymbol();
79 return SymR->getSymbol();
93 while (
const SubRegion *SR = dyn_cast<SubRegion>(R)) {
95 return SymR->getSymbol();
97 R = SR->getSuperRegion();
114 return X->getSymbol();
123 return X->getSymbol();
137 return X->getRegion();
140 return X->getLoc().getAsRegion();
147 return R ? R->
StripCasts(StripBaseCasts) :
nullptr;
175 return getAs<nonloc::ConcreteInt>() || getAs<loc::ConcreteInt>();
180 return LV->getValue() == I;
182 return NV->getValue() == I;
187 return isConstant(0);
198 const llvm::APSInt*
X =
242 switch (getBaseKind()) {
247 castAs<NonLoc>().dumpToStream(os);
250 castAs<Loc>().dumpToStream(os);
259 switch (getSubKind()) {
266 os <<
' ' << (C.
getValue().isUnsigned() ?
'U' :
'S')
267 << C.
getValue().getBitWidth() <<
'b';
271 os << castAs<nonloc::SymbolVal>().getSymbol();
281 os <<
"compoundVal{";
285 os <<
' '; first =
false;
290 (*I).dumpToStream(os);
297 os <<
"lazyCompoundVal{" <<
const_cast<void *
>(C.
getStore())
303 assert (
false &&
"Pretty-printed not implemented for this NonLoc.");
309 switch (getSubKind()) {
311 os << castAs<loc::ConcreteInt>().
getValue().getZExtValue() <<
" (Loc)";
314 os <<
"&&" << castAs<loc::GotoLabel>().getLabel()->getName();
317 os << '&' << castAs<loc::MemRegionVal>().getRegion()->getString();
320 llvm_unreachable(
"Pretty-printing not implemented for this Loc.");
const SymExpr * getAsSymExpr() const
TypedValueRegion - An abstract class representing regions having a typed value.
bool hasConjuredSymbol() const
hasConjuredSymbol - If this SVal wraps a conjured symbol, return true;
nonloc::ConcreteInt makeIntVal(const IntegerLiteral *integer)
MemRegion - The root abstract class for all memory regions.
const MemRegion * stripCasts(bool StripBaseCasts=true) const
Get the underlining region and strip casts.
const RegionTy * getAs() const
void dumpToStream(raw_ostream &Out) const
SymbolRef getLocSymbolInBase() const
Get the symbol in the SVal or its base region.
Value representing integer constant.
bool isZeroConstant() const
Symbolic value. These values used to capture symbolic execution of the program.
bool isComparisonOp() const
SymbolRef getAsLocSymbol(bool IncludeBaseRegions=false) const
If this SVal is a location and wraps a symbol, return that SymbolRef. Otherwise return 0...
SVal evalBinOp(BasicValueFactory &BasicVals, BinaryOperator::Opcode Op, const ConcreteInt &R) const
const FunctionDecl * getAsFunctionDecl() const
const SymbolicRegion * getSymbolicBase() const
If this is a symbolic region, returns the region. Otherwise, goes up the base chain looking for the f...
unsigned getNumBits() const
FunctionTextRegion - A region that represents code texts of function.
llvm::ImmutableList< SVal >::iterator iterator
const MemRegion * StripCasts(bool StripBaseCasts=true) const
static SVal getValue(SVal val, SValBuilder &svalBuilder)
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
SVal evalBinOp(SValBuilder &svalBuilder, BinaryOperator::Opcode Op, const ConcreteInt &R) const
void dumpToStream(raw_ostream &Out) const
const llvm::APSInt * evalAPSInt(BinaryOperator::Opcode Op, const llvm::APSInt &V1, const llvm::APSInt &V2)
ConcreteInt evalMinus(SValBuilder &svalBuilder) const
const llvm::APSInt & getValue() const
const MemRegion * getAsRegion() const
ConcreteInt evalComplement(SValBuilder &svalBuilder) const
BasicValueFactory & getBasicValueFactory()
const TypedValueRegion * getRegion() const
void dumpToStream(raw_ostream &OS) const
SymbolRef getAsSymbol(bool IncludeBaseRegions=false) const
If this SVal wraps a symbol return that SymbolRef. Otherwise, return 0.
const SymExpr * getAsSymbolicExpression() const
const llvm::APSInt & getValue() const
const MemRegion * getRegion() const
Get the underlining region.
const void * getStore() const