clang API Documentation
#include <SValBuilder.h>

Definition at line 31 of file SValBuilder.h.
| clang::ento::SValBuilder::SValBuilder | ( | llvm::BumpPtrAllocator & | alloc, |
| ASTContext & | context, | ||
| ProgramStateManager & | stateMgr | ||
| ) | [inline] |
Definition at line 62 of file SValBuilder.h.
| virtual clang::ento::SValBuilder::~SValBuilder | ( | ) | [inline, virtual] |
Definition at line 71 of file SValBuilder.h.
Definition at line 75 of file SValBuilder.cpp.
References ArrayIndexTy, ArrayIndexWidth, evalCastFromNonLoc(), and clang::ento::SVal::isUnknownOrUndef().
Referenced by clang::ento::StoreManager::getLValueElement().
Referenced by clang::ento::StoreManager::CastRetrievedVal(), and evalCast().
| SVal clang::ento::SValBuilder::evalBinOp | ( | ProgramStateRef | state, |
| BinaryOperator::Opcode | op, | ||
| SVal | lhs, | ||
| SVal | rhs, | ||
| QualType | type | ||
| ) |
Referenced by clang::ento::ExprEngine::evalBinOp(), and evalEQ().
| virtual SVal clang::ento::SValBuilder::evalBinOpLL | ( | ProgramStateRef | state, |
| BinaryOperator::Opcode | op, | ||
| Loc | lhs, | ||
| Loc | rhs, | ||
| QualType | resultTy | ||
| ) | [pure virtual] |
Create a new value which represents a binary expression with two memory location operands.
Referenced by clang::ento::loc::ConcreteInt::evalBinOp().
| virtual SVal clang::ento::SValBuilder::evalBinOpLN | ( | ProgramStateRef | state, |
| BinaryOperator::Opcode | op, | ||
| Loc | lhs, | ||
| NonLoc | rhs, | ||
| QualType | resultTy | ||
| ) | [pure virtual] |
Create a new value which represents a binary expression with a memory location and non location operands. For example, this would be used to evaluate a pointer arithmetic operation.
Referenced by clang::ento::loc::ConcreteInt::evalBinOp().
| virtual SVal clang::ento::SValBuilder::evalBinOpNN | ( | ProgramStateRef | state, |
| BinaryOperator::Opcode | op, | ||
| NonLoc | lhs, | ||
| NonLoc | rhs, | ||
| QualType | resultTy | ||
| ) | [pure virtual] |
Create a new value which represents a binary expression with two non location operands.
Referenced by clang::ento::ProgramState::assumeInBound(), clang::ento::ExprEngine::evalBinOp(), and clang::ento::loc::ConcreteInt::evalBinOp().
Definition at line 286 of file SValBuilder.cpp.
References clang::ento::ProgramStateManager::ArrayToPointer(), clang::ento::StoreManager::castRegion(), Context, dispatchCast(), evalCastFromLoc(), clang::ento::SVal::getAsRegion(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getPointerType(), clang::ento::ProgramStateManager::getStoreManager(), haveSimilarTypes(), clang::ento::Loc::isLocType(), clang::ento::SVal::isUnknownOrUndef(), and StateMgr.
Referenced by clang::ento::ExprEngine::VisitCast().
| virtual SVal clang::ento::SValBuilder::evalCastFromLoc | ( | Loc | val, |
| QualType | castTy | ||
| ) | [protected, pure virtual] |
Referenced by evalCast().
| virtual SVal clang::ento::SValBuilder::evalCastFromNonLoc | ( | NonLoc | val, |
| QualType | castTy | ||
| ) | [protected, pure virtual] |
Referenced by convertToArrayIndex().
Referenced by clang::ento::ExprEngine::evalComplement().
| DefinedOrUnknownSVal SValBuilder::evalEQ | ( | ProgramStateRef | state, |
| DefinedOrUnknownSVal | lhs, | ||
| DefinedOrUnknownSVal | rhs | ||
| ) |
Definition at line 254 of file SValBuilder.cpp.
References clang::BO_EQ, Context, evalBinOp(), and clang::ASTContext::IntTy.
Referenced by clang::ento::SubEngine::processSwitch(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
Referenced by clang::ento::ExprEngine::evalMinus().
| QualType clang::ento::SValBuilder::getArrayIndexType | ( | ) | const [inline] |
Definition at line 129 of file SValBuilder.h.
References ArrayIndexTy.
Referenced by clang::ento::FieldRegion::getExtent().
| BasicValueFactory& clang::ento::SValBuilder::getBasicValueFactory | ( | ) | [inline] |
Definition at line 133 of file SValBuilder.h.
References BasicVals.
Referenced by clang::ento::ProgramState::assumeInBound(), and clang::ento::StoreManager::getLValueElement().
| const BasicValueFactory& clang::ento::SValBuilder::getBasicValueFactory | ( | ) | const [inline] |
Definition at line 134 of file SValBuilder.h.
References BasicVals.
| DefinedSVal SValBuilder::getBlockPointer | ( | const BlockDecl * | block, |
| CanQualType | locTy, | ||
| const LocationContext * | locContext | ||
| ) |
Definition at line 186 of file SValBuilder.cpp.
References clang::LocationContext::getAnalysisDeclContext(), clang::ento::MemRegionManager::getBlockDataRegion(), clang::ento::MemRegionManager::getBlockTextRegion(), and MemMgr.
Referenced by clang::ento::ExprEngine::VisitBlockExpr().
| QualType clang::ento::SValBuilder::getConditionType | ( | ) | const [inline] |
Definition at line 125 of file SValBuilder.h.
References getContext(), and clang::ASTContext::IntTy.
| const SymbolConjured* clang::ento::SValBuilder::getConjuredSymbol | ( | const Stmt * | stmt, |
| const LocationContext * | LCtx, | ||
| QualType | type, | ||
| unsigned | visitCount, | ||
| const void * | symbolTag = 0 |
||
| ) | [inline] |
Definition at line 144 of file SValBuilder.h.
References clang::ento::SymbolManager::getConjuredSymbol(), and SymMgr.
| const SymbolConjured* clang::ento::SValBuilder::getConjuredSymbol | ( | const Expr * | expr, |
| const LocationContext * | LCtx, | ||
| unsigned | visitCount, | ||
| const void * | symbolTag = 0 |
||
| ) | [inline] |
Definition at line 152 of file SValBuilder.h.
References clang::ento::SymbolManager::getConjuredSymbol(), and SymMgr.
| DefinedOrUnknownSVal SValBuilder::getConjuredSymbolVal | ( | const void * | symbolTag, |
| const Expr * | expr, | ||
| const LocationContext * | LCtx, | ||
| unsigned | count | ||
| ) |
Create a new symbol with a unique 'name'.
We resort to conjured symbols when we cannot construct a derived symbol. The advantage of symbols derived/built from other symbols is that we preserve the relation between related(or even equivalent) expressions, so conjured symbols should be used sparingly.
Definition at line 109 of file SValBuilder.cpp.
References clang::Expr::getType().
Referenced by clang::ento::ExprEngine::evalObjCMessage(), clang::ento::ExprEngine::VisitCallExpr(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCXXCatchStmt(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitDeclStmt(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
| DefinedOrUnknownSVal SValBuilder::getConjuredSymbolVal | ( | const void * | symbolTag, |
| const Expr * | expr, | ||
| const LocationContext * | LCtx, | ||
| QualType | type, | ||
| unsigned | count | ||
| ) |
Definition at line 118 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getConjuredSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), MemMgr, and SymMgr.
| DefinedOrUnknownSVal SValBuilder::getConjuredSymbolVal | ( | const Stmt * | stmt, |
| const LocationContext * | LCtx, | ||
| QualType | type, | ||
| unsigned | visitCount | ||
| ) |
Definition at line 136 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getConjuredSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), MemMgr, and SymMgr.
| ASTContext& clang::ento::SValBuilder::getContext | ( | ) | [inline] |
Definition at line 120 of file SValBuilder.h.
References Context.
Referenced by clang::ento::ProgramState::assumeInBound(), clang::ento::StoreManager::CastRetrievedVal(), getConditionType(), clang::ento::FieldRegion::getExtent(), and clang::ento::StoreManager::MakeElementRegion().
| const ASTContext& clang::ento::SValBuilder::getContext | ( | ) | const [inline] |
Definition at line 121 of file SValBuilder.h.
References Context.
| DefinedOrUnknownSVal SValBuilder::getDerivedRegionValueSymbolVal | ( | SymbolRef | parentSymbol, |
| const TypedValueRegion * | region | ||
| ) |
Definition at line 167 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getDerivedSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::TypedValueRegion::getValueType(), clang::ento::Loc::isLocType(), MemMgr, and SymMgr.
| DefinedSVal SValBuilder::getFunctionPointer | ( | const FunctionDecl * | func | ) |
Definition at line 182 of file SValBuilder.cpp.
References clang::ento::MemRegionManager::getFunctionTextRegion(), and MemMgr.
Referenced by clang::ento::ExprEngine::VisitCommonDeclRefExpr().
| virtual const llvm::APSInt* clang::ento::SValBuilder::getKnownValue | ( | ProgramStateRef | state, |
| SVal | val | ||
| ) | [pure virtual] |
| DefinedSVal SValBuilder::getMetadataSymbolVal | ( | const void * | symbolTag, |
| const MemRegion * | region, | ||
| const Expr * | expr, | ||
| QualType | type, | ||
| unsigned | count | ||
| ) |
Definition at line 151 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getMetadataSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), MemMgr, and SymMgr.
| MemRegionManager& clang::ento::SValBuilder::getRegionManager | ( | ) | [inline] |
Definition at line 139 of file SValBuilder.h.
References MemMgr.
Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::ento::ExprEngine::getCXXThisRegion(), clang::ento::ExprEngine::VisitCXXConstructExpr(), and clang::ento::ExprEngine::VisitCXXThisExpr().
| const MemRegionManager& clang::ento::SValBuilder::getRegionManager | ( | ) | const [inline] |
Definition at line 140 of file SValBuilder.h.
References MemMgr.
| DefinedOrUnknownSVal SValBuilder::getRegionValueSymbolVal | ( | const TypedValueRegion * | region | ) |
Make a unique symbol for value of region.
Definition at line 94 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getRegionValueSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::TypedValueRegion::getValueType(), clang::ento::Loc::isLocType(), MemMgr, and SymMgr.
| ProgramStateManager & GRBugReporter::getStateManager | ( | ) | [inline] |
Definition at line 123 of file SValBuilder.h.
References StateMgr.
| SymbolManager& clang::ento::SValBuilder::getSymbolManager | ( | ) | [inline] |
Definition at line 136 of file SValBuilder.h.
References SymMgr.
Referenced by clang::ento::FieldRegion::getExtent(), and clang::ento::CheckerContext::getSymbolManager().
| const SymbolManager& clang::ento::SValBuilder::getSymbolManager | ( | ) | const [inline] |
Definition at line 137 of file SValBuilder.h.
References SymMgr.
Definition at line 73 of file SValBuilder.h.
References Context, and clang::ento::SymExpr::getType().
Definition at line 77 of file SValBuilder.h.
References Context, and clang::ASTContext::getCanonicalType().
| NonLoc clang::ento::SValBuilder::makeArrayIndex | ( | uint64_t | idx | ) | [inline] |
Definition at line 212 of file SValBuilder.h.
References ArrayIndexTy, BasicVals, and clang::ento::BasicValueFactory::getValue().
Referenced by clang::ento::StoreManager::MakeElementRegion(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
| nonloc::ConcreteInt clang::ento::SValBuilder::makeBoolVal | ( | const ObjCBoolLiteralExpr * | boolean | ) | [inline] |
Definition at line 224 of file SValBuilder.h.
References clang::ObjCBoolLiteralExpr::getValue(), and makeTruthVal().
| nonloc::ConcreteInt SValBuilder::makeBoolVal | ( | const CXXBoolLiteralExpr * | boolean | ) |
Definition at line 89 of file SValBuilder.cpp.
References clang::CXXBoolLiteralExpr::getValue(), and makeTruthVal().
| NonLoc clang::ento::SValBuilder::makeCompoundVal | ( | QualType | type, |
| llvm::ImmutableList< SVal > | vals | ||
| ) | [inline] |
Definition at line 198 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getCompoundValData().
Referenced by clang::ento::ExprEngine::VisitInitListExpr().
| loc::ConcreteInt clang::ento::SValBuilder::makeIntLocVal | ( | const llvm::APSInt & | integer | ) | [inline] |
Definition at line 234 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getValue().
| nonloc::ConcreteInt clang::ento::SValBuilder::makeIntVal | ( | const IntegerLiteral * | integer | ) | [inline] |
Definition at line 218 of file SValBuilder.h.
References BasicVals, clang::Expr::getType(), clang::ento::BasicValueFactory::getValue(), and clang::APIntStorage::getValue().
Referenced by clang::ento::nonloc::ConcreteInt::evalComplement(), clang::ento::ExprEngine::evalEagerlyAssume(), clang::ento::nonloc::ConcreteInt::evalMinus(), clang::ento::FieldRegion::getExtent(), makeZeroVal(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::ExprEngine::VisitObjCForCollectionStmt(), and clang::ento::ExprEngine::VisitOffsetOfExpr().
| nonloc::ConcreteInt clang::ento::SValBuilder::makeIntVal | ( | const llvm::APSInt & | integer | ) | [inline] |
Definition at line 230 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getValue().
| NonLoc clang::ento::SValBuilder::makeIntVal | ( | const llvm::APInt & | integer, |
| bool | isUnsigned | ||
| ) | [inline] |
Definition at line 238 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getValue().
| DefinedSVal clang::ento::SValBuilder::makeIntVal | ( | uint64_t | integer, |
| QualType | type | ||
| ) | [inline] |
Definition at line 242 of file SValBuilder.h.
References BasicVals, clang::ento::BasicValueFactory::getValue(), and clang::ento::Loc::isLocType().
| NonLoc clang::ento::SValBuilder::makeIntVal | ( | uint64_t | integer, |
| bool | isUnsigned | ||
| ) | [inline] |
Definition at line 249 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getIntValue().
| NonLoc clang::ento::SValBuilder::makeIntVal | ( | uint64_t | integer, |
| unsigned | bitWidth, | ||
| bool | isUnsigned | ||
| ) | [inline] |
Definition at line 258 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getValue().
| NonLoc clang::ento::SValBuilder::makeIntValWithPtrWidth | ( | uint64_t | integer, |
| bool | isUnsigned | ||
| ) | [inline] |
Definition at line 253 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getIntWithPtrWidth().
| NonLoc clang::ento::SValBuilder::makeLazyCompoundVal | ( | const StoreRef & | store, |
| const TypedValueRegion * | region | ||
| ) | [inline] |
Definition at line 202 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getLazyCompoundValData().
Definition at line 291 of file SValBuilder.h.
References clang::ento::MemRegionManager::getSymbolicRegion(), and MemMgr.
Referenced by clang::ento::StoreManager::getLValueVar(), and clang::ento::ExprEngine::VisitObjCForCollectionStmt().
Definition at line 295 of file SValBuilder.h.
| Loc clang::ento::SValBuilder::makeLoc | ( | const AddrLabelExpr * | expr | ) | [inline] |
Definition at line 299 of file SValBuilder.h.
References clang::AddrLabelExpr::getLabel().
| Loc clang::ento::SValBuilder::makeLoc | ( | const llvm::APSInt & | integer | ) | [inline] |
Definition at line 303 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getValue().
Definition at line 263 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getPersistentSValWithData().
| NonLoc SValBuilder::makeNonLoc | ( | const SymExpr * | lhs, |
| BinaryOperator::Opcode | op, | ||
| const llvm::APSInt & | rhs, | ||
| QualType | type | ||
| ) |
Definition at line 43 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getSymIntExpr(), clang::ento::Loc::isLocType(), and SymMgr.
Referenced by makeSymExprValNN().
| NonLoc clang::ento::SValBuilder::makeNonLoc | ( | const llvm::APSInt & | rhs, |
| BinaryOperator::Opcode | op, | ||
| const SymExpr * | lhs, | ||
| QualType | type | ||
| ) |
| NonLoc SValBuilder::makeNonLoc | ( | const SymExpr * | lhs, |
| BinaryOperator::Opcode | op, | ||
| const SymExpr * | rhs, | ||
| QualType | type | ||
| ) |
Definition at line 61 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getSymSymExpr(), clang::ento::Loc::isLocType(), and SymMgr.
Create a NonLoc value for cast.
Definition at line 68 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getCastSymbol(), clang::ento::Loc::isLocType(), and SymMgr.
| Loc clang::ento::SValBuilder::makeNull | ( | ) | [inline] |
Definition at line 287 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getZeroWithPtrWidth().
Referenced by makeZeroVal(), and clang::ento::ExprEngine::VisitCast().
| SVal SValBuilder::makeSymExprValNN | ( | ProgramStateRef | state, |
| BinaryOperator::Opcode | op, | ||
| NonLoc | lhs, | ||
| NonLoc | rhs, | ||
| QualType | resultTy | ||
| ) |
Constructs a symbolic expression for two non-location values.
Definition at line 197 of file SValBuilder.cpp.
References clang::ento::SymExpr::computeComplexity(), clang::ento::SVal::getAsSymExpr(), and makeNonLoc().
| nonloc::ConcreteInt clang::ento::SValBuilder::makeTruthVal | ( | bool | b, |
| QualType | type | ||
| ) | [inline] |
Definition at line 279 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getTruthValue().
Referenced by makeBoolVal(), and clang::ento::ExprEngine::VisitObjCForCollectionStmt().
| nonloc::ConcreteInt clang::ento::SValBuilder::makeTruthVal | ( | bool | b | ) | [inline] |
Definition at line 283 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getTruthValue().
| NonLoc clang::ento::SValBuilder::makeZeroArrayIndex | ( | ) | [inline] |
Definition at line 208 of file SValBuilder.h.
References ArrayIndexTy, BasicVals, and clang::ento::BasicValueFactory::getValue().
Referenced by clang::ento::StoreManager::GetElementZeroRegion().
| DefinedOrUnknownSVal SValBuilder::makeZeroVal | ( | QualType | type | ) |
Construct an SVal representing '0' for the specified type.
Definition at line 31 of file SValBuilder.cpp.
References clang::ento::Loc::isLocType(), makeIntVal(), and makeNull().
Referenced by clang::ento::SubEngine::getInitialState(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
const QualType clang::ento::SValBuilder::ArrayIndexTy [protected] |
The scalar type to use for array indices.
Definition at line 48 of file SValBuilder.h.
Referenced by convertToArrayIndex(), getArrayIndexType(), makeArrayIndex(), and makeZeroArrayIndex().
const unsigned clang::ento::SValBuilder::ArrayIndexWidth [protected] |
The width of the scalar type used for array indices.
Definition at line 51 of file SValBuilder.h.
Referenced by convertToArrayIndex().
BasicValueFactory clang::ento::SValBuilder::BasicVals [protected] |
Manager of APSInt values.
Definition at line 37 of file SValBuilder.h.
Referenced by getBasicValueFactory(), makeArrayIndex(), makeCompoundVal(), makeIntLocVal(), makeIntVal(), makeIntValWithPtrWidth(), makeLazyCompoundVal(), makeLoc(), makeLocAsInteger(), makeNull(), makeTruthVal(), and makeZeroArrayIndex().
ASTContext& clang::ento::SValBuilder::Context [protected] |
Definition at line 34 of file SValBuilder.h.
Referenced by evalCast(), evalEQ(), getContext(), and haveSameType().
MemRegionManager clang::ento::SValBuilder::MemMgr [protected] |
Manages the creation of memory regions.
Definition at line 43 of file SValBuilder.h.
Referenced by getBlockPointer(), getConjuredSymbolVal(), getDerivedRegionValueSymbolVal(), getFunctionPointer(), getMetadataSymbolVal(), getRegionManager(), getRegionValueSymbolVal(), and makeLoc().
ProgramStateManager& clang::ento::SValBuilder::StateMgr [protected] |
Definition at line 45 of file SValBuilder.h.
Referenced by evalCast(), and getStateManager().
SymbolManager clang::ento::SValBuilder::SymMgr [protected] |
Manages the creation of symbols.
Definition at line 40 of file SValBuilder.h.
Referenced by getConjuredSymbol(), getConjuredSymbolVal(), getDerivedRegionValueSymbolVal(), getMetadataSymbolVal(), getRegionValueSymbolVal(), getSymbolManager(), and makeNonLoc().