clang API Documentation
#include <SimpleConstraintManager.h>


Public Member Functions | |
| SimpleConstraintManager (SubEngine *subengine, SValBuilder &SB) | |
| virtual | ~SimpleConstraintManager () |
| ProgramStateRef | assume (ProgramStateRef state, DefinedSVal Cond, bool Assumption) override |
| ProgramStateRef | assume (ProgramStateRef state, NonLoc Cond, bool Assumption) |
| ProgramStateRef | assumeSymRel (ProgramStateRef state, const SymExpr *LHS, BinaryOperator::Opcode op, const llvm::APSInt &Int) |
Protected Member Functions | |
| virtual ProgramStateRef | assumeSymNE (ProgramStateRef state, SymbolRef sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0 |
| virtual ProgramStateRef | assumeSymEQ (ProgramStateRef state, SymbolRef sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0 |
| virtual ProgramStateRef | assumeSymLT (ProgramStateRef state, SymbolRef sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0 |
| virtual ProgramStateRef | assumeSymGT (ProgramStateRef state, SymbolRef sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0 |
| virtual ProgramStateRef | assumeSymLE (ProgramStateRef state, SymbolRef sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0 |
| virtual ProgramStateRef | assumeSymGE (ProgramStateRef state, SymbolRef sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0 |
| BasicValueFactory & | getBasicVals () const |
| SymbolManager & | getSymbolManager () const |
| bool | canReasonAbout (SVal X) const override |
| ProgramStateRef | assumeAux (ProgramStateRef state, NonLoc Cond, bool Assumption) |
| ProgramStateRef | assumeAuxForSymbol (ProgramStateRef State, SymbolRef Sym, bool Assumption) |
Definition at line 24 of file SimpleConstraintManager.h.
| clang::ento::SimpleConstraintManager::SimpleConstraintManager | ( | SubEngine * | subengine, |
| SValBuilder & | SB | ||
| ) | [inline] |
Definition at line 28 of file SimpleConstraintManager.h.
Definition at line 24 of file SimpleConstraintManager.cpp.
| ProgramStateRef clang::ento::SimpleConstraintManager::assume | ( | ProgramStateRef | state, |
| DefinedSVal | Cond, | ||
| bool | Assumption | ||
| ) | [override, virtual] |
Implements clang::ento::ConstraintManager.
Definition at line 68 of file SimpleConstraintManager.cpp.
References clang::ASTContext::BoolTy, clang::ento::SVal::castAs(), clang::ento::SValBuilder::evalCast(), clang::ento::SVal::getAs(), clang::ento::SValBuilder::getContext(), clang::ento::SValBuilder::getStateManager(), clang::ento::ProgramStateManager::getSValBuilder(), and clang::ASTContext::VoidPtrTy.
Referenced by assumeAux().
| ProgramStateRef clang::ento::SimpleConstraintManager::assume | ( | ProgramStateRef | state, |
| NonLoc | Cond, | ||
| bool | Assumption | ||
| ) |
Definition at line 87 of file SimpleConstraintManager.cpp.
References assumeAux(), clang::ento::ConstraintManager::NotifyAssumeClients, and clang::ento::SubEngine::processAssume().
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeAux | ( | ProgramStateRef | state, |
| NonLoc | Cond, | ||
| bool | Assumption | ||
| ) | [protected] |
Definition at line 114 of file SimpleConstraintManager.cpp.
References assume(), assumeAuxForSymbol(), assumeSymRel(), clang::BO_Sub, canReasonAbout(), clang::ento::SVal::castAs(), clang::ento::nonloc::ConcreteIntKind, clang::ento::SVal::getAsSymExpr(), getBasicVals(), clang::ento::SymbolManager::getContext(), clang::ento::nonloc::LocAsInteger::getLoc(), clang::ASTContext::getPointerDiffType(), clang::ento::SVal::getSubKind(), clang::ento::nonloc::SymbolVal::getSymbol(), getSymbolManager(), clang::ento::SymbolManager::getSymSymExpr(), getValue(), clang::BinaryOperator::isComparisonOp(), clang::ento::nonloc::SymbolVal::isExpression(), clang::ento::Loc::isLocType(), clang::ento::nonloc::LocAsIntegerKind, clang::BinaryOperator::negateComparisonOp(), clang::BinaryOperator::reverseComparisonOp(), and clang::ento::nonloc::SymbolValKind.
Referenced by assume().
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeAuxForSymbol | ( | ProgramStateRef | State, |
| SymbolRef | Sym, | ||
| bool | Assumption | ||
| ) | [protected] |
Definition at line 98 of file SimpleConstraintManager.cpp.
References assumeSymEQ(), assumeSymNE(), getBasicVals(), clang::ento::SymExpr::getType(), and clang::Type::isIntegralOrEnumerationType().
Referenced by assumeAux().
| virtual ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymEQ | ( | ProgramStateRef | state, |
| SymbolRef | sym, | ||
| const llvm::APSInt & | V, | ||
| const llvm::APSInt & | Adjustment | ||
| ) | [protected, pure virtual] |
Referenced by assumeAuxForSymbol(), and assumeSymRel().
| virtual ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymGE | ( | ProgramStateRef | state, |
| SymbolRef | sym, | ||
| const llvm::APSInt & | V, | ||
| const llvm::APSInt & | Adjustment | ||
| ) | [protected, pure virtual] |
Referenced by assumeSymRel().
| virtual ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymGT | ( | ProgramStateRef | state, |
| SymbolRef | sym, | ||
| const llvm::APSInt & | V, | ||
| const llvm::APSInt & | Adjustment | ||
| ) | [protected, pure virtual] |
Referenced by assumeSymRel().
| virtual ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymLE | ( | ProgramStateRef | state, |
| SymbolRef | sym, | ||
| const llvm::APSInt & | V, | ||
| const llvm::APSInt & | Adjustment | ||
| ) | [protected, pure virtual] |
Referenced by assumeSymRel().
| virtual ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymLT | ( | ProgramStateRef | state, |
| SymbolRef | sym, | ||
| const llvm::APSInt & | V, | ||
| const llvm::APSInt & | Adjustment | ||
| ) | [protected, pure virtual] |
Referenced by assumeSymRel().
| virtual ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymNE | ( | ProgramStateRef | state, |
| SymbolRef | sym, | ||
| const llvm::APSInt & | V, | ||
| const llvm::APSInt & | Adjustment | ||
| ) | [protected, pure virtual] |
Referenced by assumeAuxForSymbol(), and assumeSymRel().
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymRel | ( | ProgramStateRef | state, |
| const SymExpr * | LHS, | ||
| BinaryOperator::Opcode | op, | ||
| const llvm::APSInt & | Int | ||
| ) |
Definition at line 210 of file SimpleConstraintManager.cpp.
References assumeSymEQ(), assumeSymGE(), assumeSymGT(), assumeSymLE(), assumeSymLT(), assumeSymNE(), clang::BO_EQ, clang::BO_GE, clang::BO_GT, clang::BO_LE, clang::BO_LT, clang::BO_NE, clang::ento::computeAdjustment(), clang::ento::APSIntType::convert(), clang::ento::BasicValueFactory::getAPSIntType(), getBasicVals(), clang::ento::APSIntType::getBitWidth(), clang::ento::SymExpr::getType(), clang::ento::APSIntType::getZeroValue(), clang::BinaryOperator::isComparisonOp(), and clang::ento::APSIntType::isUnsigned().
Referenced by assumeAux().
| bool clang::ento::SimpleConstraintManager::canReasonAbout | ( | SVal | X | ) | const [override, protected, virtual] |
canReasonAbout - Not all ConstraintManagers can accurately reason about all SVal values. This method returns true if the ConstraintManager can reasonably handle a given SVal value. This is typically queried by ExprEngine to determine if the value should be replaced with a conjured symbolic value in order to recover some precision.
Implements clang::ento::ConstraintManager.
Definition at line 26 of file SimpleConstraintManager.cpp.
References clang::BO_And, clang::BO_Div, clang::BO_Mul, clang::BO_Or, clang::BO_Rem, clang::BO_Shl, clang::BO_Shr, clang::BO_Xor, clang::ento::SVal::getAs(), clang::BinaryOperator::isComparisonOp(), and clang::ento::Loc::isLocType().
Referenced by assumeAux().
| BasicValueFactory& clang::ento::SimpleConstraintManager::getBasicVals | ( | ) | const [inline, protected] |
Definition at line 82 of file SimpleConstraintManager.h.
References clang::ento::SValBuilder::getBasicValueFactory().
Referenced by assumeAux(), assumeAuxForSymbol(), and assumeSymRel().
| SymbolManager& clang::ento::SimpleConstraintManager::getSymbolManager | ( | ) | const [inline, protected] |
Definition at line 83 of file SimpleConstraintManager.h.
References clang::ento::SValBuilder::getSymbolManager().
Referenced by assumeAux().