19 using namespace clang;
39 if (isa<ObjCMethodDecl>(D) || isa<CXXMethodDecl>(D))
41 if (isa<BlockDecl>(D))
42 return "anonymous block";
56 if (BName.find(Name) != StringRef::npos)
80 StringRef FName = II->
getName();
81 if (FName.equals(Name))
84 if (FName.startswith(
"__inline") && (FName.find(Name) != StringRef::npos))
87 if (FName.startswith(
"__") && FName.endswith(
"_chk") &&
88 FName.find(Name) != StringRef::npos)
116 SVal Eval = Bldr.
evalBinOp(State, ComparisonOp, LHSVal, RHSVal,
122 return StTrue && !StFalse;
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...
An instance of this class is created to represent a function declaration or definition.
nonloc::ConcreteInt makeIntVal(const IntegerLiteral *integer)
Decl - This represents one declaration (or definition), e.g.
StringRef getDeclDescription(const Decl *D)
Returns the word that should be used to refer to the declaration in the report.
const FunctionDecl * getCalleeDecl(const CallExpr *CE) const
Get the declaration of the called function (path-sensitive).
virtual SVal getBinding(Store store, Loc loc, QualType T=QualType())=0
Return the value bound to specified location in a given state.
SVal getSVal(const Stmt *S) const
Get the value of arbitrary expressions at this point in the path.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
StringRef getCalleeName(const FunctionDecl *FunDecl) const
Get the name of the called function (path-sensitive).
One of these records is kept for each identifier that is lexed.
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.
SValBuilder & getSValBuilder()
const LocationContext * getLocationContext() const
const char * getName(unsigned ID) const
Return the identifier name for the specified builtin, e.g.
Expr - This represents one expression.
static bool isCLibraryFunction(const FunctionDecl *FD, StringRef Name=StringRef())
Returns true if the callee is an externally-visible function in the top-level namespace, such as malloc.
const Expr * getCallee() const
DeclContext * getDeclContext()
QualType getConditionType() const
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, SVal lhs, SVal rhs, QualType type)
StoreManager & getStoreManager()
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
Encodes a location in the source.
static bool evalComparison(SVal LHSVal, BinaryOperatorKind ComparisonOp, SVal RHSVal, ProgramStateRef State)
Evaluate comparison and return true if it's known that condition is true.
ASTContext & getASTContext() const LLVM_READONLY
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
static StringRef getImmediateMacroName(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
Retrieve the name of the immediate macro expansion.
StringRef getName() const
Return the actual identifier string.
Dataflow Directional Tag Classes.
ASTContext & getASTContext()
StringRef getMacroNameOrSpelling(SourceLocation &Loc)
Depending on wither the location corresponds to a macro, return either the macro name or the token sp...
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.
const ProgramStateRef & getState() const
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
bool isNegative(const Expr *E)
Returns true if the value of E is negative.
unsigned getBuiltinID() const
Returns a value indicating whether this function corresponds to a builtin function.
SourceManager & getSourceManager()
Builtin::Context & BuiltinInfo
SValBuilder & getSValBuilder()
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
bool isTranslationUnit() const
Defines enum values for all the target-independent builtin functions.
const LangOptions & getLangOpts() const
bool isUnknownOrUndef() const
bool isExternallyVisible() const