clang API Documentation
#include <SimpleConstraintManager.h>


Public Member Functions | |
| SimpleConstraintManager (SubEngine &subengine, BasicValueFactory &BV) | |
| virtual | ~SimpleConstraintManager () |
| ProgramStateRef | assume (ProgramStateRef state, DefinedSVal Cond, bool Assumption) |
| ProgramStateRef | assume (ProgramStateRef state, Loc Cond, bool Assumption) |
| 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 |
| bool | canReasonAbout (SVal X) const |
| ProgramStateRef | assumeAux (ProgramStateRef state, Loc Cond, bool Assumption) |
| 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, |
| BasicValueFactory & | BV | ||
| ) | [inline] |
Definition at line 28 of file SimpleConstraintManager.h.
| clang::ento::SimpleConstraintManager::~SimpleConstraintManager | ( | ) | [virtual] |
Definition at line 24 of file SimpleConstraintManager.cpp.
| ProgramStateRef clang::ento::SimpleConstraintManager::assume | ( | ProgramStateRef | state, |
| DefinedSVal | Cond, | ||
| bool | Assumption | ||
| ) | [virtual] |
Implements clang::ento::ConstraintManager.
Definition at line 58 of file SimpleConstraintManager.cpp.
| ProgramStateRef clang::ento::SimpleConstraintManager::assume | ( | ProgramStateRef | state, |
| Loc | Cond, | ||
| bool | Assumption | ||
| ) |
Definition at line 67 of file SimpleConstraintManager.cpp.
References assumeAux(), and clang::ento::SubEngine::processAssume().
| ProgramStateRef clang::ento::SimpleConstraintManager::assume | ( | ProgramStateRef | state, |
| NonLoc | Cond, | ||
| bool | Assumption | ||
| ) |
Definition at line 112 of file SimpleConstraintManager.cpp.
References assumeAux(), and clang::ento::SubEngine::processAssume().
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeAux | ( | ProgramStateRef | state, |
| Loc | Cond, | ||
| bool | Assumption | ||
| ) | [protected] |
Definition at line 73 of file SimpleConstraintManager.cpp.
References assumeSymEQ(), assumeSymNE(), clang::ento::loc::ConcreteIntKind, getBasicVals(), clang::ento::SVal::getSubKind(), clang::ento::SubRegion::getSuperRegion(), getValue(), clang::ento::BasicValueFactory::getZeroWithPtrWidth(), clang::ento::loc::GotoLabelKind, clang::ento::loc::MemRegionKind, and NULL.
Referenced by assume(), and assumeAux().
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeAux | ( | ProgramStateRef | state, |
| NonLoc | Cond, | ||
| bool | Assumption | ||
| ) | [protected] |
Definition at line 152 of file SimpleConstraintManager.cpp.
References assumeAux(), assumeAuxForSymbol(), assumeSymRel(), clang::BO_EQ, clang::BO_NE, canReasonAbout(), clang::ento::nonloc::ConcreteIntKind, clang::ento::SVal::getAsSymExpr(), getBasicVals(), clang::ento::BasicValueFactory::getContext(), clang::ento::SymIntExpr::getLHS(), clang::ento::SymIntExpr::getOpcode(), clang::ento::SymIntExpr::getRHS(), clang::ento::SVal::getSubKind(), clang::ento::nonloc::SymbolVal::getSymbol(), clang::ento::SymIntExpr::getType(), clang::ento::BasicValueFactory::getValue(), getValue(), clang::BinaryOperator::isComparisonOp(), clang::ento::nonloc::SymbolVal::isExpression(), clang::ento::nonloc::LocAsIntegerKind, clang::ento::NegateComparison(), NULL, and clang::ento::nonloc::SymbolValKind.
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeAuxForSymbol | ( | ProgramStateRef | State, |
| SymbolRef | Sym, | ||
| bool | Assumption | ||
| ) | [protected] |
Definition at line 136 of file SimpleConstraintManager.cpp.
References assumeSymEQ(), assumeSymNE(), getBasicVals(), clang::ento::BasicValueFactory::getContext(), clang::ento::SymExpr::getType(), and clang::ento::BasicValueFactory::getValue().
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 assumeAux(), 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 assumeAux(), assumeAuxForSymbol(), and assumeSymRel().
| ProgramStateRef clang::ento::SimpleConstraintManager::assumeSymRel | ( | ProgramStateRef | state, |
| const SymExpr * | LHS, | ||
| BinaryOperator::Opcode | op, | ||
| const llvm::APSInt & | Int | ||
| ) |
Definition at line 231 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::BasicValueFactory::getContext(), clang::ento::SymExpr::getType(), clang::ento::APSIntType::getZeroValue(), and clang::BinaryOperator::isComparisonOp().
Referenced by assumeAux().
| bool clang::ento::SimpleConstraintManager::canReasonAbout | ( | SVal | X | ) | const [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::nonloc::SymbolVal::getSymbol(), and clang::ento::nonloc::SymbolVal::isExpression().
Referenced by assumeAux().
| BasicValueFactory& clang::ento::SimpleConstraintManager::getBasicVals | ( | ) | const [inline, protected] |
Definition at line 84 of file SimpleConstraintManager.h.
Referenced by assumeAux(), assumeAuxForSymbol(), and assumeSymRel().