20 using namespace clang;
25 class BuiltinFunctionChecker :
public Checker<eval::Call> {
32 bool BuiltinFunctionChecker::evalCall(
const CallExpr *CE,
44 case Builtin::BI__builtin_unpredictable:
45 case Builtin::BI__builtin_expect:
46 case Builtin::BI__builtin_assume_aligned:
47 case Builtin::BI__builtin_addressof: {
58 case Builtin::BI__builtin_alloca: {
73 svalBuilder.evalEQ(state, Extent, Size);
74 state = state->assume(extentMatchesSizeArg,
true);
75 assert(state &&
"The region should not have any previous constraints");
81 case Builtin::BI__builtin_object_size: {
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
nonloc::ConcreteInt makeIntVal(const IntegerLiteral *integer)
ExplodedNode * addTransition(ProgramStateRef State=nullptr, const ProgramPointTag *Tag=nullptr)
Generates a new transition in the program state graph (ExplodedGraph).
Strictly evaluate the expression.
AllocaRegion - A region that represents an untyped blob of bytes created by a call to 'alloca'...
const FunctionDecl * getCalleeDecl(const CallExpr *CE) const
Get the declaration of the called function (path-sensitive).
unsigned blockCount() const
Returns the number of times the current block has been visited along the analyzed path...
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
const AllocaRegion * getAllocaRegion(const Expr *Ex, unsigned Cnt, const LocationContext *LC)
getAllocaRegion - Retrieve a region associated with a call to alloca().
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
const ProgramStateRef & getState() const
bool EvaluateAsInt(llvm::APSInt &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
EvaluateAsInt - Return true if this is a constant which we can fold and convert to an integer...
The result type of a method or function.
CHECKER * registerChecker()
Used to register checkers.
StoreManager & getStoreManager()
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
unsigned getBuiltinID() const
Returns a value indicating whether this function corresponds to a builtin function.
ASTContext & getASTContext()
MemRegionManager & getRegionManager()
getRegionManager - Returns the internal RegionManager object that is used to query and manipulate Mem...
BasicValueFactory & getBasicValueFactory()
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
SValBuilder & getSValBuilder()
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
APSIntType getAPSIntType(QualType T) const
Returns the type of the APSInt used to store values of the given QualType.
Defines enum values for all the target-independent builtin functions.
const LocationContext * getLocationContext() const