21 #include "llvm/ADT/SmallSet.h" 22 #include "llvm/ADT/StringExtras.h" 23 #include "llvm/Support/raw_ostream.h" 24 #include "llvm/Support/Debug.h" 26 #define DEBUG_TYPE "static-analyzer-call-event" 28 using namespace clang;
33 assert(E &&
"Calls without origin expressions do not have results");
71 for (
const auto *I : RD->
fields()) {
102 I != E && Idx < NumOfArgs; ++I, ++Idx) {
150 I != E; ++I, ++Idx) {
152 PreserveArgs.insert(Idx);
162 if (callee->hasAttr<PureAttr>() || callee->hasAttr<ConstAttr>())
171 llvm::SmallSet<unsigned, 4> PreserveArgs;
175 for (
unsigned Idx = 0, Count =
getNumArgs(); Idx != Count; ++Idx) {
178 if (PreserveArgs.count(Idx))
180 ETraits.
setTrait(MR->getBaseRegion(),
184 ValuesToInvalidate.push_back(
getArgSVal(Idx));
190 return Result->invalidateRegions(ValuesToInvalidate,
getOriginExpr(),
193 nullptr,
this, &ETraits);
205 assert(D &&
"Cannot get a program point without a statement or decl");
217 if (!CD.IsLookupDone) {
218 CD.IsLookupDone =
true;
219 CD.II = &
getState()->getStateManager().getContext().Idents.get(CD.FuncName);
222 if (!II || II != CD.II)
266 Out <<
"Unknown call (type " <<
getKind() <<
")";
271 return isa<CallExpr>(S) || isa<ObjCMessageExpr>(S)
272 || isa<CXXConstructExpr>(S)
273 || isa<CXXNewExpr>(S);
279 return FD->getReturnType();
281 return MD->getReturnType();
282 if (
const BlockDecl *BD = dyn_cast<BlockDecl>(D)) {
294 Ty = FT->getReturnType();
302 llvm_unreachable(
"unknown callable kind");
309 return FD->isVariadic();
311 return MD->isVariadic();
312 if (
const BlockDecl *BD = dyn_cast<BlockDecl>(D))
313 return BD->isVariadic();
315 llvm_unreachable(
"unknown callable kind");
330 for (; I != E && Idx < NumArgs; ++I, ++Idx) {
332 assert(ParamDecl &&
"Formal parameter has no decl?");
337 Bindings.push_back(std::make_pair(ParamLoc, ArgVal));
358 getManager()->getContext(FD);
359 bool IsAutosynthesized;
362 if (IsAutosynthesized)
363 llvm::dbgs() <<
"Using autosynthesized body for " << FD->
getName()
402 if (II->
isStr(
"pthread_setspecific"))
407 if (II->
isStr(
"xpc_connection_set_context"))
411 if (II->
isStr(
"funopen"))
416 if (II->
isStr(
"__cxa_demangle"))
419 StringRef FName = II->
getName();
423 if (FName.endswith(
"NoCopy"))
428 if (FName.startswith(
"NS") && (FName.find(
"Insert") != StringRef::npos))
433 if (FName.startswith(
"CF") || FName.startswith(
"CG")) {
434 return StrInStrNoCase(FName,
"InsertValue") != StringRef::npos ||
435 StrInStrNoCase(FName,
"AddValue") != StringRef::npos ||
436 StrInStrNoCase(FName,
"SetValue") != StringRef::npos ||
437 StrInStrNoCase(FName,
"WithData") != StringRef::npos ||
438 StrInStrNoCase(FName,
"AppendValue") != StringRef::npos ||
439 StrInStrNoCase(FName,
"SetAttribute") != StringRef::npos;
469 SVal ThisVal = getCXXThisVal();
470 Values.push_back(ThisVal);
494 const Expr *
Base = getCXXThisExpr();
517 const MemRegion *R = getCXXThisVal().getAsRegion();
528 assert(!RegionType.
isNull() &&
"DynamicTypeInfo should always be a pointer.");
531 if (!RD || !RD->hasDefinition())
541 assert(!RD->isDerivedFrom(MD->
getParent()) &&
"Couldn't find known method");
555 if (!Result->
hasBody(Definition))
572 SVal ThisVal = getCXXThisVal();
590 assert(!Failed &&
"Calling an incorrectly devirtualized method");
594 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
610 if (ME->hasQualifier())
626 return dyn_cast_or_null<BlockDataRegion>(DataReg);
639 if (
const MemRegion *R = getBlockRegion())
647 if (isConversionFromLambda()) {
648 auto *LambdaOperatorDecl = cast<CXXMethodDecl>(CalleeCtx->
getDecl());
649 Params = LambdaOperatorDecl->parameters();
654 const VarRegion *CapturedLambdaRegion = getRegionStoringCapturedLambda();
657 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
684 SVal ThisVal = getCXXThisVal();
689 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
702 if (isBaseDestructor())
722 if (
const ObjCIvarDecl *PropIvar = PropDecl->getPropertyIvarDecl()) {
723 SVal IvarLVal =
getState()->getLValue(PropIvar, getReceiverSVal());
731 Values.push_back(IvarLVal);
737 Values.push_back(getReceiverSVal());
750 if (!isInstanceMessage())
759 SVal SelfVal = getSelfSVal();
760 assert(SelfVal.
isValid() &&
"Calling super but not in ObjC method");
769 if (!isInstanceMessage())
774 return (RecVal == getSelfSVal());
778 switch (getMessageKind()) {
783 return getContainingPseudoObjectExpr()->getSourceRange();
785 llvm_unreachable(
"unknown message kind");
790 const PseudoObjectExpr *ObjCMethodCall::getContainingPseudoObjectExpr()
const {
791 assert(
Data &&
"Lazy lookup not yet performed.");
792 assert(getMessageKind() !=
OCM_Message &&
"Explicit message send.");
793 return ObjCMessageDataTy::getFromOpaqueValue(
Data).getPointer();
802 if (
const BinaryOperator *BO = dyn_cast<BinaryOperator>(Syntactic))
803 Syntactic = BO->getLHS();
821 case Stmt::ObjCPropertyRefExprClass:
824 case Stmt::ObjCSubscriptRefExprClass:
836 assert(getMessageKind() == K);
847 ObjCMessageDataTy Info = ObjCMessageDataTy::getFromOpaqueValue(
Data);
848 if (!Info.getPointer())
857 assert(POE &&
"Property access without PseudoObjectExpr?");
860 auto *RefExpr = cast<ObjCPropertyRefExpr>(Syntactic);
862 if (RefExpr->isExplicitProperty())
863 return RefExpr->getExplicitProperty();
879 getState()->getStateManager().getContext().getSourceManager();
927 llvm_unreachable(
"The while loop should always terminate.");
938 MD = cast<ObjCMethodDecl>(I);
950 if (!InstRecIg || !InstRecIg->getFoundDecl() ||
951 !InstRecIg->getFoundDecl()->getName().equals(
"self"))
971 bool CanBeSubClassed =
false;
975 if (!SupersType.
isNull()) {
979 ReceiverT = cast<ObjCObjectPointerType>(SupersType);
981 Receiver = getReceiverSVal().getAsRegion();
987 assert(isa<AllocaRegion>(Receiver) &&
988 "Unhandled untyped region class!");
996 if (ReceiverT && CanBeSubClassed)
998 if (!canBeOverridenInSubclass(IDecl, Sel))
999 CanBeSubClassed =
false;
1005 if (
auto *PT = dyn_cast_or_null<ObjCObjectPointerType>(ReceiverT)) {
1007 if (PT->getObjectType()->isObjCClass() &&
1008 Receiver == getSelfSVal().getAsRegion())
1044 typedef std::pair<const ObjCInterfaceDecl*, Selector>
1046 typedef llvm::DenseMap<PrivateMethodKey,
1050 static PrivateMethodCache PMC;
1054 if (!Val.hasValue()) {
1055 Val = IDecl->lookupPrivateMethod(Sel);
1061 if (CompileTimeMD->isPropertyAccessor()) {
1062 if (!CompileTimeMD->getSelfDecl() &&
1063 isa<ObjCCategoryDecl>(CompileTimeMD->getDeclContext())) {
1074 auto *
ID = CompileTimeMD->getClassInterface();
1075 for (
auto *CatDecl :
ID->visible_extensions()) {
1076 Val = CatDecl->getMethod(Sel,
1077 CompileTimeMD->isInstanceMethod());
1083 Val = IDecl->lookupInstanceMethod(Sel);
1088 if (CanBeSubClassed)
1126 SVal SelfVal = getReceiverSVal();
1127 if (!SelfVal.isUnknown()) {
1131 Bindings.push_back(std::make_pair(SelfLoc, SelfVal));
1139 return create<CXXMemberCall>(MCE, State, LCtx);
1142 const FunctionDecl *DirectCallee = OpCE->getDirectCallee();
1143 if (
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DirectCallee))
1144 if (MD->isInstance())
1145 return create<CXXMemberOperatorCall>(OpCE, State, LCtx);
1148 return create<BlockCall>(CE, State, LCtx);
1153 return create<SimpleFunctionCall>(CE, State, LCtx);
1162 assert(CallerCtx &&
"This should not be used for top-level stack frames");
1167 if (
const CallExpr *CE = dyn_cast<CallExpr>(CallSite))
1168 return getSimpleCall(CE, State, CallerCtx);
1171 case Stmt::CXXConstructExprClass:
1172 case Stmt::CXXTemporaryObjectExprClass: {
1173 SValBuilder &SVB = State->getStateManager().getSValBuilder();
1176 SVal ThisVal = State->getSVal(ThisPtr);
1178 return getCXXConstructorCall(cast<CXXConstructExpr>(CallSite),
1181 case Stmt::CXXNewExprClass:
1182 return getCXXAllocatorCall(cast<CXXNewExpr>(CallSite), State, CallerCtx);
1183 case Stmt::ObjCMessageExprClass:
1184 return getObjCMethodCall(cast<ObjCMessageExpr>(CallSite),
1187 llvm_unreachable(
"This is not an inlineable statement.");
1196 "All other CFG elements should have exprs");
1199 SValBuilder &SVB = State->getStateManager().getSValBuilder();
1202 SVal ThisVal = State->getSVal(ThisPtr);
1204 const Stmt *Trigger;
1206 Trigger = AutoDtor->getTriggerStmt();
1208 Trigger = cast<Stmt>(DeleteDtor->getDeleteExpr());
1212 return getCXXDestructorCall(Dtor, Trigger, ThisVal.
getAsRegion(),
Suppress pointer-escaping of a region.
llvm::PointerIntPair< const PseudoObjectExpr *, 2 > ObjCMessageDataTy
A call to an overloaded operator written using operator syntax.
The receiver is the instance of the superclass object.
SVal attemptDownCast(SVal Base, QualType DerivedPtrType, bool &Failed)
Attempts to do a down cast.
SVal getSelfSVal() const
Return the value of 'self' if available.
SVal getReceiverSVal() const
Returns the value of the receiver at the time of this call.
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
An instance of this class is created to represent a function declaration or definition.
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Smart pointer class that efficiently represents Objective-C method names.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
MemRegion - The root abstract class for all memory regions.
bool isBlockPointerType() const
bool argumentsMayEscape() const override
Returns true if any of the arguments are known to escape to long- term storage, even if this method w...
Selector getSelector() const
ObjCInterfaceDecl * getClassInterface()
Stmt * getBody() const
Get the body of the Declaration.
static const Expr * getSyntacticFromForPseudoObjectExpr(const PseudoObjectExpr *POE)
Stmt - This represents one statement.
Information about invalidation for a particular region/symbol.
ProgramPoint getProgramPoint(bool IsPreVisit=false, const ProgramPointTag *Tag=nullptr) const
Returns an appropriate ProgramPoint for this call.
FunctionType - C99 6.7.5.3 - Function Declarators.
static bool isCallToSelfClass(const ObjCMessageExpr *ME)
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
ObjCInterfaceDecl * getReceiverInterface() const
Retrieve the Objective-C interface to which this message is being directed, if known.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type...
Decl - This represents one declaration (or definition), e.g.
const RecordType * getAsStructureType() const
CFGDeleteDtor - Represents C++ object destructor generated from a call to delete. ...
SourceRange getSourceRange() const override
Represents a program point just before an implicit call event.
A container of type source information.
CallEventRef getSimpleCall(const CallExpr *E, ProgramStateRef State, const LocationContext *LCtx)
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
Expr * ignoreParenBaseCasts() LLVM_READONLY
Ignore parentheses and derived-to-base casts.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
const Expr * getOriginExpr() const
Returns the expression whose value will be the result of this call.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const T * getAs() const
Member-template getAs<specific type>'.
loc::MemRegionVal getCXXThis(const CXXMethodDecl *D, const StackFrameContext *SFC)
Return a memory region for the 'this' object reference.
void setTrait(SymbolRef Sym, InvalidationKinds IK)
SVal getSVal(const Stmt *S) const
Get the value of arbitrary expressions at this point in the path.
ObjCMethodDecl - Represents an instance or class method declaration.
static bool isVoidPointerToNonConst(QualType T)
const Expr * getCXXThisExpr() const override
Returns the expression representing the implicit 'this' object.
llvm::mapped_iterator< ArrayRef< ParmVarDecl * >::iterator, GetTypeFn > param_type_iterator
ArrayRef< ParmVarDecl * > parameters() const override
Return call's formal parameters.
ParmVarDecl - Represents a parameter to a function.
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
RecordDecl - Represents a struct/union/class.
bool isValid() const
Return false if no dynamic type info is available.
One of these records is kept for each identifier that is lexed.
RuntimeDefinition getRuntimeDefinition() const override
MemRegionManager & getRegionManager()
SmallVectorImpl< FrameBindingTy > BindingsTy
param_type_iterator param_type_end() const
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
field_range fields() const
AnalysisDeclContext contains the context data for the function or method under analysis.
CFGAutomaticObjDtor - Represents C++ object destructor implicitly generated for automatic object or t...
CXXMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isReferenceType() const
virtual const Expr * getArgExpr(unsigned Index) const
Returns the expression associated with a given argument.
SValBuilder & getSValBuilder()
bool isObjCSelType() const
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
ArrayRef< ParmVarDecl * > parameters() const
static void addParameterValuesToBindings(const StackFrameContext *CalleeCtx, CallEvent::BindingsTy &Bindings, SValBuilder &SVB, const CallEvent &Call, ArrayRef< ParmVarDecl *> parameters)
BlockDataRegion - A region that represents a block instance.
Represents any expression that calls an Objective-C method.
virtual Kind getKind() const =0
Returns the kind of call this is.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
const ImplicitParamDecl * getSelfDecl() const
bool hasNonZeroCallbackArg() const
Returns true if any of the arguments appear to represent callbacks.
An x-value expression is a reference to an object with independent storage but which can be "moved"...
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
const StackFrameContext * getCurrentStackFrame() const
static void findPtrToConstParams(llvm::SmallSet< unsigned, 4 > &PreserveArgs, const CallEvent &Call)
const clang::PrintingPolicy & getPrintingPolicy() const
const LocationContext * getParent() const
A builtin binary operation expression such as "x + y" or "x <= y".
static bool isPointerToConst(QualType Ty)
Returns true if a type is a pointer-to-const or reference-to-const with no further indirection...
QualType getType() const
Returns the currently inferred upper bound on the runtime type.
static const ObjCMethodDecl * findDefiningRedecl(const ObjCMethodDecl *MD)
SVal getReturnValue() const
Returns the return value of the call.
const FunctionDecl * getDecl() const override
Returns the declaration of the function or method that will be called.
param_type_iterator param_type_begin() const
Returns an iterator over the types of the call's formal parameters.
Represents an ObjC class declaration.
static bool isVariadic(const Decl *D)
Returns true if the given decl is known to be variadic.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find the method in RD that corresponds to this one.
const CFGBlock * getCallSiteBlock() const
const Expr * getCXXThisExpr() const override
Returns the expression representing the implicit 'this' object.
ObjCMessageKind
Represents the ways an Objective-C message send can occur.
bool isReceiverSelfOrSuper() const
Checks if the receiver refers to 'self' or 'super'.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
const Stmt * getCallSite() const
ArrayRef< ParmVarDecl * > parameters() const override
CFGBlock - Represents a single basic block in a source-level CFG.
bool argumentsMayEscape() const override
Loc makeLoc(SymbolRef sym)
ArrayRef< ParmVarDecl * > parameters() const override
const LocationContext * getLocationContext() const
The context in which the call is being evaluated.
static bool isCallback(QualType T)
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
bool canBeASubClass() const
Returns false if the type information is precise (the type T is the only type in the lattice)...
Expr - This represents one expression.
virtual ArrayRef< ParmVarDecl * > parameters() const =0
Return call's formal parameters.
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
Stores the currently inferred strictest bound on the runtime type of a region in a given state along ...
const FunctionDecl * getDecl() const override
Returns the declaration of the function or method that will be called.
const FunctionProtoType * T
CallEventRef getCaller(const StackFrameContext *CalleeCtx, ProgramStateRef State)
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.
Represents a C++ destructor within a class.
const Expr * getCallee() const
bool isInSystemHeader() const
Returns true if the callee is known to be from a system header.
StringRef getNameForSlot(unsigned argIndex) const
Retrieve the name at a given position in the selector.
ObjCInterfaceDecl * getSuperClass() const
virtual SVal getCXXThisVal() const
Returns the value of the implicit 'this' object.
const IdentifierInfo * getCalleeIdentifier() const
Returns the name of the callee, if its name is a simple identifier.
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
bool hasBody(const FunctionDecl *&Definition) const
Returns true if the function has a body (definition).
virtual const Decl * getDecl() const
Returns the declaration of the function or method that will be called.
An expression that sends a message to the given Objective-C object or class.
QualType getRecordType(const RecordDecl *Decl) const
StoreManager & getStoreManager()
unsigned getNumArgs() const
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
CFGBaseDtor - Represents C++ object destructor implicitly generated for base object in destructor...
bool isNull() const
Return true if this QualType doesn't point to a type yet.
ParentMap & getParentMap() const
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
virtual bool argumentsMayEscape() const
Returns true if any of the arguments are known to escape to long- term storage, even if this method w...
RuntimeDefinition getRuntimeDefinition() const override
bool isConstQualified() const
Determine whether this type is const-qualified.
virtual SourceRange getSourceRange() const
Returns a source range for the entire call, suitable for outputting in diagnostics.
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
Populates the given SmallVector with the bindings in the callee's stack frame at the start of this ca...
const MemRegion * StripCasts(bool StripBaseCasts=true) const
const ImplicitParamDecl * getSelfDecl() const
Return the ImplicitParamDecl* associated with 'self' if this AnalysisDeclContext wraps an ObjCMethodD...
Defines the runtime definition of the called function.
QualType getCanonicalType() const
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
This class represents a description of a function call using the number of arguments and the name of ...
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
Encodes a location in the source.
const FunctionDecl * getDecl() const override
static bool isCallStmt(const Stmt *S)
Returns true if this is a statement is a function or method call of some kind.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity...
const MemRegion * getAsRegion() const
Represents a call to a member function that may be written either with member call syntax (e...
Represents a static or instance method of a struct/union/class.
ASTContext & getContext()
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
bool isInMainFile(SourceLocation Loc) const
Returns whether the PresumedLoc for a given SourceLocation is in the main file.
const Decl * getDecl() const
bool isAnyPointerType() const
Represents one property declaration in an Objective-C interface.
RuntimeDefinition getRuntimeDefinition() const override
const ObjCMethodDecl * getMethodDecl() const
Tells that a region's contents is not changed.
virtual void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const
Used to specify non-argument regions that will be invalidated as a result of this call...
Optional< T > getAs() const
Convert to the specified CFGElement type, returning None if this CFGElement is not of the desired typ...
StringRef getName() const
Return the actual identifier string.
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
static const unsigned NoArgRequirement
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
SVal getCXXThisVal() const
Returns the value of the implicit 'this' object.
Dataflow Directional Tag Classes.
virtual bool canBeOverridenInSubclass(ObjCInterfaceDecl *IDecl, Selector Sel) const
Check if the selector may have multiple definitions (may have overrides).
const BlockDataRegion * getBlockRegion() const
Returns the region associated with this instance of the block.
bool isValid() const
Return true if this is a valid SourceLocation object.
virtual SourceRange getArgSourceRange(unsigned Index) const
Returns the source range for errors associated with this argument.
Represents a program point just after an implicit call event.
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return 0.
DynamicTypeInfo getDynamicTypeInfo(ProgramStateRef State, const MemRegion *Reg)
Get dynamic type information for a region.
RuntimeDefinition getRuntimeDefinition() const override
const VarRegion * getVarRegion(const VarDecl *D, const LocationContext *LC)
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and LocationC...
QualType getSuperType() const
Retrieve the type referred to by 'super'.
StmtClass getStmtClass() const
bool hasVoidPointerToNonConstArg() const
Returns true if any of the arguments is void*.
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
Represents an abstract call to a function or method along a particular path.
ObjCMessageKind getMessageKind() const
Returns how the message was written in the source (property access, subscript, or explicit message se...
const Decl * getDecl() const
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
Represents a pointer to an Objective C object.
const FunctionDecl * getAsFunctionDecl() const
getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a CodeTextRegion wrapping a FunctionDecl...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface...
unsigned getIndex() const
bool hasBody() const override
Determine whether this method has a body.
static QualType getDeclaredResultType(const Decl *D)
Returns the result type of a function or method declaration.
bool isGlobalCFunction(StringRef SpecificName=StringRef()) const
Returns true if the callee is an externally-visible function in the top-level namespace, such as malloc.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const
lookupMethod - This method returns an instance/class method by looking in the class, its categories, and its super classes (using a linear search).
QualType getResultType() const
Returns the result type, adjusted for references.
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
bool hasNonNullArgumentsWithType(bool(*Condition)(QualType)) const
Returns true if the type of any of the non-null arguments satisfies the condition.
const ProgramStateRef & getState() const
The state in which the call is being evaluated.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Represents a C++ struct/union/class.
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type...
SVal getCXXThisVal() const override
Returns the value of the implicit 'this' object.
CFGImplicitDtor - Represents C++ object destructor implicitly generated by compiler on various occasi...
bool isCalled(const CallDescription &CD) const
Returns true if the CallEvent is a call to a function that matches the CallDescription.
ObjCIvarDecl - Represents an ObjC instance variable.
virtual unsigned getNumArgs() const =0
Returns the number of arguments (explicit and implicit).
CFGElement - Represents a top-level expression in a basic block.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
const MemRegion * getBaseRegion() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
const ObjCPropertyDecl * getAccessedProperty() const
Stmt * getParentIgnoreParenCasts(Stmt *) const
ProgramStateRef invalidateRegions(unsigned BlockCount, ProgramStateRef Orig=nullptr) const
Returns a new state with all argument regions invalidated.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
A reference to a declared variable, function, enum, etc.
ArrayRef< ParmVarDecl * > parameters() const
virtual SVal getArgSVal(unsigned Index) const
Returns the value of a given argument at the time of the call.
An l-value expression is a reference to an object with independent storage.
A trivial tuple used to represent a source range.
bool isPropertyAccessor() const
AnalysisDeclContext * getAnalysisDeclContext() const
SourceLocation getEndOfDefinitionLoc() const
bool isFunctionPointerType() const
The receiver is a superclass.
bool isInstanceMessage() const
Determine whether this is an instance message to either a computed object or to super.
SourceLocation getBegin() const
This class handles loading and caching of source files into memory.
CFGTemporaryDtor - Represents C++ object destructor implicitly generated at the end of full expressio...
RuntimeDefinition getRuntimeDefinition() const override
Returns the definition of the function or method that will be called.
bool isUnknownOrUndef() const
SourceLocation getLocation() const
ArrayRef< ParmVarDecl * > parameters() const
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override