clang API Documentation
#include <BasicValueFactory.h>
Public Member Functions | |
BasicValueFactory (ASTContext &ctx, llvm::BumpPtrAllocator &Alloc) | |
~BasicValueFactory () | |
ASTContext & | getContext () const |
const llvm::APSInt & | getValue (const llvm::APSInt &X) |
const llvm::APSInt & | getValue (const llvm::APInt &X, bool isUnsigned) |
const llvm::APSInt & | getValue (uint64_t X, QualType T) |
APSIntType | getAPSIntType (QualType T) const |
Returns the type of the APSInt used to store values of the given QualType. | |
const llvm::APSInt & | Convert (const llvm::APSInt &To, const llvm::APSInt &From) |
const llvm::APSInt & | Convert (QualType T, const llvm::APSInt &From) |
const llvm::APSInt & | getIntValue (uint64_t X, bool isUnsigned) |
const llvm::APSInt & | getMaxValue (const llvm::APSInt &v) |
const llvm::APSInt & | getMinValue (const llvm::APSInt &v) |
const llvm::APSInt & | getMaxValue (QualType T) |
const llvm::APSInt & | getMinValue (QualType T) |
const llvm::APSInt & | Add1 (const llvm::APSInt &V) |
const llvm::APSInt & | Sub1 (const llvm::APSInt &V) |
const llvm::APSInt & | getZeroWithPtrWidth (bool isUnsigned=true) |
const llvm::APSInt & | getIntWithPtrWidth (uint64_t X, bool isUnsigned) |
const llvm::APSInt & | getTruthValue (bool b, QualType T) |
const llvm::APSInt & | getTruthValue (bool b) |
const CompoundValData * | getCompoundValData (QualType T, llvm::ImmutableList< SVal > Vals) |
const LazyCompoundValData * | getLazyCompoundValData (const StoreRef &store, const TypedValueRegion *region) |
llvm::ImmutableList< SVal > | getEmptySValList () |
llvm::ImmutableList< SVal > | consVals (SVal X, llvm::ImmutableList< SVal > L) |
const llvm::APSInt * | evalAPSInt (BinaryOperator::Opcode Op, const llvm::APSInt &V1, const llvm::APSInt &V2) |
const std::pair< SVal, uintptr_t > & | getPersistentSValWithData (const SVal &V, uintptr_t Data) |
const std::pair< SVal, SVal > & | getPersistentSValPair (const SVal &V1, const SVal &V2) |
const SVal * | getPersistentSVal (SVal X) |
Definition at line 62 of file BasicValueFactory.h.
clang::ento::BasicValueFactory::BasicValueFactory | ( | ASTContext & | ctx, |
llvm::BumpPtrAllocator & | Alloc | ||
) | [inline] |
Definition at line 82 of file BasicValueFactory.h.
Definition at line 61 of file BasicValueFactory.cpp.
const llvm::APSInt& clang::ento::BasicValueFactory::Add1 | ( | const llvm::APSInt & | V | ) | [inline] |
Definition at line 141 of file BasicValueFactory.h.
References X.
llvm::ImmutableList<SVal> clang::ento::BasicValueFactory::consVals | ( | SVal | X, |
llvm::ImmutableList< SVal > | L | ||
) | [inline] |
Definition at line 179 of file BasicValueFactory.h.
Referenced by clang::ento::ExprEngine::VisitInitListExpr().
const llvm::APSInt& clang::ento::BasicValueFactory::Convert | ( | const llvm::APSInt & | To, |
const llvm::APSInt & | From | ||
) | [inline] |
Convert - Create a new persistent APSInt with the same value as 'From' but with the bitwidth and signedness of 'To'.
Definition at line 103 of file BasicValueFactory.h.
References clang::ento::APSIntType::convert().
Referenced by clang::ento::ProgramState::getSVal().
const llvm::APSInt& clang::ento::BasicValueFactory::Convert | ( | QualType | T, |
const llvm::APSInt & | From | ||
) | [inline] |
Definition at line 112 of file BasicValueFactory.h.
References clang::ento::APSIntType::convert(), and getAPSIntType().
const llvm::APSInt * BasicValueFactory::evalAPSInt | ( | BinaryOperator::Opcode | Op, |
const llvm::APSInt & | V1, | ||
const llvm::APSInt & | V2 | ||
) |
Definition at line 146 of file BasicValueFactory.cpp.
References clang::BO_Add, clang::BO_And, clang::BO_Div, clang::BO_EQ, clang::BO_GE, clang::BO_GT, clang::BO_LE, clang::BO_LT, clang::BO_Mul, clang::BO_NE, clang::BO_Or, clang::BO_Rem, clang::BO_Shl, clang::BO_Shr, clang::BO_Sub, clang::BO_Xor, and getTruthValue().
Referenced by clang::ento::nonloc::ConcreteInt::evalBinOp(), and clang::ento::loc::ConcreteInt::evalBinOp().
APSIntType clang::ento::BasicValueFactory::getAPSIntType | ( | QualType | T | ) | const [inline] |
Returns the type of the APSInt used to store values of the given QualType.
Definition at line 95 of file BasicValueFactory.h.
References clang::ASTContext::getTypeSize(), clang::Type::isIntegralOrEnumerationType(), clang::ento::Loc::isLocType(), and clang::Type::isSignedIntegerOrEnumerationType().
Referenced by clang::ento::SimpleConstraintManager::assumeSymRel(), Convert(), getMaxValue(), getMinValue(), and getValue().
const CompoundValData * BasicValueFactory::getCompoundValData | ( | QualType | T, |
llvm::ImmutableList< SVal > | Vals | ||
) |
Definition at line 108 of file BasicValueFactory.cpp.
References clang::ento::CompoundValData::Profile().
Referenced by clang::ento::SValBuilder::makeCompoundVal().
ASTContext& clang::ento::BasicValueFactory::getContext | ( | ) | const [inline] |
Definition at line 88 of file BasicValueFactory.h.
llvm::ImmutableList<SVal> clang::ento::BasicValueFactory::getEmptySValList | ( | ) | [inline] |
Definition at line 175 of file BasicValueFactory.h.
Referenced by clang::ento::ExprEngine::VisitInitListExpr().
const llvm::APSInt& clang::ento::BasicValueFactory::getIntValue | ( | uint64_t | X, |
bool | isUnsigned | ||
) | [inline] |
Definition at line 120 of file BasicValueFactory.h.
References clang::ASTContext::IntTy, and clang::ASTContext::UnsignedIntTy.
Referenced by clang::ento::SValBuilder::makeIntVal().
const llvm::APSInt& clang::ento::BasicValueFactory::getIntWithPtrWidth | ( | uint64_t | X, |
bool | isUnsigned | ||
) | [inline] |
Definition at line 157 of file BasicValueFactory.h.
References clang::ASTContext::getTypeSize(), and clang::ASTContext::VoidPtrTy.
Referenced by clang::ento::SValBuilder::makeIntValWithPtrWidth().
const LazyCompoundValData * BasicValueFactory::getLazyCompoundValData | ( | const StoreRef & | store, |
const TypedValueRegion * | region | ||
) |
Definition at line 127 of file BasicValueFactory.cpp.
References clang::ento::LazyCompoundValData::Profile().
Referenced by clang::ento::SValBuilder::makeLazyCompoundVal().
const llvm::APSInt& clang::ento::BasicValueFactory::getMaxValue | ( | const llvm::APSInt & | v | ) | [inline] |
Definition at line 125 of file BasicValueFactory.h.
Referenced by getMaxValue().
const llvm::APSInt& clang::ento::BasicValueFactory::getMaxValue | ( | QualType | T | ) | [inline] |
Definition at line 133 of file BasicValueFactory.h.
References getAPSIntType(), and getMaxValue().
const llvm::APSInt& clang::ento::BasicValueFactory::getMinValue | ( | const llvm::APSInt & | v | ) | [inline] |
Definition at line 129 of file BasicValueFactory.h.
Referenced by clang::ento::ProgramState::assumeInBound(), and getMinValue().
const llvm::APSInt& clang::ento::BasicValueFactory::getMinValue | ( | QualType | T | ) | [inline] |
Definition at line 137 of file BasicValueFactory.h.
References getAPSIntType(), and getMinValue().
const SVal * BasicValueFactory::getPersistentSVal | ( | SVal | X | ) |
Definition at line 286 of file BasicValueFactory.cpp.
References getPersistentSValWithData().
const std::pair< SVal, SVal > & BasicValueFactory::getPersistentSValPair | ( | const SVal & | V1, |
const SVal & | V2 | ||
) |
Definition at line 262 of file BasicValueFactory.cpp.
References P, and clang::ento::SVal::Profile().
const std::pair< SVal, uintptr_t > & BasicValueFactory::getPersistentSValWithData | ( | const SVal & | V, |
uintptr_t | Data | ||
) |
Definition at line 237 of file BasicValueFactory.cpp.
References P, and clang::ento::SVal::Profile().
Referenced by getPersistentSVal(), and clang::ento::SValBuilder::makeLocAsInteger().
const llvm::APSInt& clang::ento::BasicValueFactory::getTruthValue | ( | bool | b, |
QualType | T | ||
) | [inline] |
Definition at line 161 of file BasicValueFactory.h.
References clang::ASTContext::getTypeSize().
Referenced by evalAPSInt(), getTruthValue(), and clang::ento::SValBuilder::makeTruthVal().
const llvm::APSInt& clang::ento::BasicValueFactory::getTruthValue | ( | bool | b | ) | [inline] |
Definition at line 165 of file BasicValueFactory.h.
References clang::ASTContext::getLogicalOperationType(), and getTruthValue().
const llvm::APSInt & BasicValueFactory::getValue | ( | const llvm::APSInt & | X | ) |
Definition at line 72 of file BasicValueFactory.cpp.
References P.
const llvm::APSInt & BasicValueFactory::getValue | ( | const llvm::APInt & | X, |
bool | isUnsigned | ||
) |
Definition at line 89 of file BasicValueFactory.cpp.
const llvm::APSInt & BasicValueFactory::getValue | ( | uint64_t | X, |
QualType | T | ||
) |
Definition at line 102 of file BasicValueFactory.cpp.
References getAPSIntType().
const llvm::APSInt& clang::ento::BasicValueFactory::getZeroWithPtrWidth | ( | bool | isUnsigned = true | ) | [inline] |
Definition at line 153 of file BasicValueFactory.h.
References clang::ASTContext::getTypeSize(), and clang::ASTContext::VoidPtrTy.
Referenced by clang::ento::SValBuilder::makeNull().
const llvm::APSInt& clang::ento::BasicValueFactory::Sub1 | ( | const llvm::APSInt & | V | ) | [inline] |
Definition at line 147 of file BasicValueFactory.h.
References X.