27 SVal L = Pred->getSVal(Callee);
44 return "anonymous block";
59 auto CompletelyMatchesParts = [II](
auto... Parts) ->
bool {
60 StringRef FName = II->
getName();
61 return (FName.consume_front(Parts) && ...) && FName.empty();
64 return CompletelyMatchesParts(
"__", Name,
"_chk") ||
65 CompletelyMatchesParts(
"__builtin_",
"__", Name,
"_chk");
91 SVal Eval = Bldr.
evalBinOp(State, ComparisonOp, LHSVal, RHSVal,
97 return StTrue && !StFalse;
static bool evalComparison(SVal LHSVal, BinaryOperatorKind ComparisonOp, SVal RHSVal, ProgramStateRef State)
Evaluate comparison and return true if it's known that condition is true.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
Represents a function declaration or definition.
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
static StringRef getImmediateMacroName(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
Retrieve the name of the immediate macro expansion.
static unsigned getSpelling(const Token &Tok, const char *&Buffer, const SourceManager &SourceMgr, const LangOptions &LangOpts, bool *Invalid=nullptr)
getSpelling - This method is used to get the spelling of a token into a preallocated buffer,...
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Encodes a location in the source.
The properties of a function declaration that determine whether it is a C library function with a giv...
bool isCLibraryFunction(StringRef Name)
Implements CheckerContext::isCLibraryFunction(FD, Name).
StringRef getDeclDescription(const Decl *D)
Returns the word that should be used to refer to the declaration in the report.
SVal getSVal(const Expr *E) const
Get the value of arbitrary expressions at this point in the path.
const SourceManager & getSourceManager()
SValBuilder & getSValBuilder()
StringRef getCalleeName(const FunctionDecl *FunDecl) const
Get the name of the called function (path-sensitive).
std::string getMacroNameOrSpelling(SourceLocation &Loc)
Depending on whether the location corresponds to a macro, return either the macro name or the token s...
ASTContext & getASTContext()
const ProgramStateRef & getState() const
bool isNegative(const Expr *E)
Returns true if the value of E is negative.
bool isGreaterOrEqual(const Expr *E, unsigned long long Val)
Returns true if the value of E is greater than or equal to Val under unsigned comparison.
static bool isCLibraryFunction(const FunctionDecl *FD, StringRef Name=StringRef())
Returns true if the given function is an externally-visible function in the top-level namespace,...
const FunctionDecl * getCalleeDecl(const CallExpr *CE) const
Get the declaration of the called function (path-sensitive).
const LangOptions & getLangOpts() const
static bool isHardenedVariantOf(const FunctionDecl *FD, StringRef Name)
In builds that use source hardening (-D_FORTIFY_SOURCE), many standard functions are implemented as m...
SValBuilder & getSValBuilder()
StoreManager & getStoreManager()
nonloc::ConcreteInt makeIntVal(const IntegerLiteral *integer)
QualType getConditionType() const
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, SVal lhs, SVal rhs, QualType type)
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
bool isUnknownOrUndef() const
const FunctionDecl * getAsFunctionDecl() const
getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a CodeTextRegion wrapping a FunctionDecl...
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
virtual SVal getBinding(Store store, Loc loc, QualType T=QualType())=0
Return the value bound to specified location in a given state.
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
Top level wrappers for InstallAPI frontend operations.
bool isa(CodeGen::Address addr)