29 if (isa<SymbolData>(Sym))
33 if (
const SymIntExpr *SIE = dyn_cast<SymIntExpr>(Sym)) {
49 if (
const auto *SSE = dyn_cast<SymSymExpr>(Sym)) {
66 SymMgr.
getSymSymExpr(SSE->getRHS(), BO_Sub, SSE->getLHS(), DiffTy);
80 SymMgr.
getSymSymExpr(SSE->getLHS(), BO_EQ, SSE->getRHS(), ExprType);
82 bool WasEqual = SSE->
getOpcode() == BO_EQ;
83 bool IsExpectedEqual = WasEqual == Assumption;
87 if (IsExpectedEqual) {
113 computeAdjustment(AdjustedSym, Adjustment);
123 Adjustment.setIsSigned(
false);
127 ConvertedTo, Adjustment);
129 ConvertedTo, Adjustment);
157 "Non-comparison ops should be rewritten as comparisons to zero.");
164 if (Int == 0 && (Op == BO_EQ || Op == BO_NE)) {
182 computeAdjustment(Sym, Adjustment);
191 Adjustment.setIsSigned(
false);
195 llvm_unreachable(
"invalid operation not caught by assertion above");
217 void RangedConstraintManager::computeAdjustment(
SymbolRef &Sym,
220 if (
const SymIntExpr *SE = dyn_cast<SymIntExpr>(Sym)) {
222 if (Op == BO_Add || Op == BO_Sub) {
230 Adjustment = -Adjustment;
243 return SimplifiedSym;
__DEVICE__ int max(int __a, int __b)
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
bool isComparisonOp() const
static Opcode negateComparisonOp(Opcode Opc)
static Opcode reverseComparisonOp(Opcode Opc)
bool isEqualityOp() const
A (possibly-)qualified type.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
A record of the "type" of an APSInt, used for conversions.
llvm::APSInt getZeroValue() const LLVM_READONLY
Returns an all-zero value for this type.
uint32_t getBitWidth() const
llvm::APSInt convert(const llvm::APSInt &Value) const LLVM_READONLY
Convert and return a new APSInt with the given value, but this type's bit width and signedness.
APSIntType getAPSIntType(QualType T) const
Returns the type of the APSInt used to store values of the given QualType.
Template implementation for all binary symbolic expressions.
Represents a symbolic expression involving a binary operator.
BinaryOperator::Opcode getOpcode() const
static bool isLocType(QualType T)
virtual ProgramStateRef assumeSymNE(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0
~RangedConstraintManager() override
virtual ProgramStateRef assumeSymLE(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &V, const llvm::APSInt &Adjustment)=0
virtual ProgramStateRef assumeSymWithinInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &From, const llvm::APSInt &To, const llvm::APSInt &Adjustment)=0
ProgramStateRef assumeSym(ProgramStateRef State, SymbolRef Sym, bool Assumption) override
Given a symbolic expression that can be reasoned about, assume that it is true/false and generate the...
virtual ProgramStateRef assumeSymRel(ProgramStateRef State, SymbolRef Sym, BinaryOperator::Opcode op, const llvm::APSInt &Int)
Assume a constraint between a symbolic expression and a concrete integer.
ProgramStateRef assumeSymUnsupported(ProgramStateRef State, SymbolRef Sym, bool Assumption) override
Given a symbolic expression that cannot be reasoned about, assume that it is zero/nonzero and add it ...
virtual ProgramStateRef assumeSymOutsideInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &From, const llvm::APSInt &To, const llvm::APSInt &Adjustment)=0
virtual ProgramStateRef assumeSymGE(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
ProgramStateRef assumeSymInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &From, const llvm::APSInt &To, bool InRange) override
Given a symbolic expression within the range [From, To], assume that it is true/false and generate th...
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
DefinedSVal makeSymbolVal(SymbolRef Sym)
Make an SVal that represents the given symbol.
virtual SVal simplifySVal(ProgramStateRef State, SVal Val)=0
Simplify symbolic expressions within a given SVal.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
SymbolRef getAsSymbol(bool IncludeBaseRegions=false) const
If this SVal wraps a symbol return that SymbolRef.
BasicValueFactory & getBasicVals() const
SymbolManager & getSymbolManager() const
virtual QualType getType() const =0
ASTContext & getContext()
const SymSymExpr * getSymSymExpr(const SymExpr *lhs, BinaryOperator::Opcode op, const SymExpr *rhs, QualType t)
SVal simplifyToSVal(ProgramStateRef State, SymbolRef Sym)
Try to simplify a given symbolic expression's associated SVal based on the constraints in State.
SymbolRef simplify(ProgramStateRef State, SymbolRef Sym)
Try to simplify a given symbolic expression based on the constraints in State.
bool InRange(InterpState &S, CodePtr OpPC)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T