(std::optional<Loc> LV = Cond.
getAs<
Loc>()) {
31 SValBuilder&SVB = State->getStateManager().getSValBuilder();
34 if(
const TypedRegion*TR = dyn_cast_or_null<TypedRegion>(MR))
35 T= TR->getLocationType();
42 returnassume(State, Cond.
castAs<
NonLoc>(), Assumption);
46 NonLocCond,
boolAssumption) {
47State = assumeAux(State, Cond, Assumption);
66 switch(Cond.getKind()) {
68llvm_unreachable(
"'Assume' not implemented for this NonLoc");
70 casenonloc::SymbolValKind: {
71nonloc::SymbolVal SV = Cond.castAs<nonloc::SymbolVal>();
74 return assumeSym(State, Sym, Assumption);
77 casenonloc::ConcreteIntKind: {
78 bool b= *Cond.castAs<nonloc::ConcreteInt>().getValue().get() != 0;
79 boolisFeasible =
b? Assumption : !Assumption;
80 returnisFeasible ? State :
nullptr;
83 casenonloc::PointerToMemberKind: {
84 bool IsNull= !Cond.castAs<nonloc::PointerToMember>().isNullMemberPointer();
85 boolIsFeasible =
IsNull? Assumption : !Assumption;
86 returnIsFeasible ? State :
nullptr;
89 casenonloc::LocAsIntegerKind:
90 return assumeInternal(State, Cond.castAs<nonloc::LocAsInteger>().getLoc(),
97 constllvm::APSInt &To,
boolInRange) {
99assert(From.isUnsigned() == To.isUnsigned() &&
100From.getBitWidth() == To.getBitWidth() &&
101 "Values should have same types!");
112llvm_unreachable(
"'assumeInclusiveRange' is not implemented" 115 casenonloc::LocAsIntegerKind:
116 casenonloc::SymbolValKind: {
122 casenonloc::ConcreteIntKind: {
124 boolIsInRange = IntVal >= From && IntVal <= To;
125 boolisFeasible = (IsInRange == InRange);
126 returnisFeasible ? State :
nullptr;
A (possibly-)qualified type.
virtual bool canReasonAbout(SVal X) const =0
canReasonAbout - Not all ConstraintManagers can accurately reason about all SVal values.
ProgramStateRef processAssume(ProgramStateRef state, SVal cond, bool assumption)
evalAssume - Callback function invoked by the ConstraintManager when making assumptions about state v...
MemRegion - The root abstract class for all memory regions.
ASTContext & getContext()
SVal evalCast(SVal V, QualType CastTy, QualType OriginalTy)
Cast a given SVal to another SVal using given QualType's.
std::optional< T > getAs() const
Convert to the specified SVal type, returning std::nullopt if this SVal is not of the desired type.
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
ProgramStateRef assumeInclusiveRangeInternal(ProgramStateRef State, NonLoc Value, const llvm::APSInt &From, const llvm::APSInt &To, bool InRange) override
virtual ProgramStateRef assumeSym(ProgramStateRef State, SymbolRef Sym, bool Assumption)=0
Given a symbolic expression that can be reasoned about, assume that it is true/false and generate the...
~SimpleConstraintManager() override
virtual ProgramStateRef assumeSymUnsupported(ProgramStateRef State, SymbolRef Sym, bool Assumption)=0
Given a symbolic expression that cannot be reasoned about, assume that it is zero/nonzero and add it ...
virtual ProgramStateRef assumeSymInclusiveRange(ProgramStateRef State, SymbolRef Sym, const llvm::APSInt &From, const llvm::APSInt &To, bool InRange)=0
Given a symbolic expression within the range [From, To], assume that it is true/false and generate th...
ProgramStateRef assumeInternal(ProgramStateRef State, DefinedSVal Cond, bool Assumption) override
Ensures that the DefinedSVal conditional is expressed as a NonLoc by creating boolean casts to handle...
TypedRegion - An abstract class representing regions that are typed.
Value representing integer constant.
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
const SymExpr * SymbolRef
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4