clang
8.0.0
|
Represents any expression that calls an Objective-C method. More...
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
Public Member Functions | |
virtual const ObjCMessageExpr * | getOriginExpr () const |
const ObjCMethodDecl * | getDecl () const override |
unsigned | getNumArgs () const override |
const Expr * | getArgExpr (unsigned Index) const override |
bool | isInstanceMessage () const |
ObjCMethodFamily | getMethodFamily () const |
Selector | getSelector () const |
SourceRange | getSourceRange () const override |
SVal | getReceiverSVal () const |
Returns the value of the receiver at the time of this call. More... | |
SVal | getSelfSVal () const |
Return the value of 'self' if available. More... | |
const ObjCInterfaceDecl * | getReceiverInterface () const |
Get the interface for the receiver. More... | |
bool | isReceiverSelfOrSuper () const |
Checks if the receiver refers to 'self' or 'super'. More... | |
ObjCMessageKind | getMessageKind () const |
Returns how the message was written in the source (property access, subscript, or explicit message send). More... | |
bool | isSetter () const |
Returns true if this property access or subscript is a setter (has the form of an assignment). More... | |
const ObjCPropertyDecl * | getAccessedProperty () const |
RuntimeDefinition | getRuntimeDefinition () const override |
bool | argumentsMayEscape () const override |
void | getInitialStackFrameContents (const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override |
ArrayRef< ParmVarDecl * > | parameters () const override |
Kind | getKind () const override |
Static Public Member Functions | |
static bool | classof (const CallEvent *CA) |
Protected Member Functions | |
ObjCMethodCall (const ObjCMessageExpr *Msg, ProgramStateRef St, const LocationContext *LCtx) | |
ObjCMethodCall (const ObjCMethodCall &Other)=default | |
void | cloneTo (void *Dest) const override |
void | getExtraInvalidatedValues (ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override |
virtual bool | canBeOverridenInSubclass (ObjCInterfaceDecl *IDecl, Selector Sel) const |
Check if the selector may have multiple definitions (may have overrides). More... | |
Friends | |
class | CallEventManager |
Represents any expression that calls an Objective-C method.
This includes all of the kinds listed in ObjCMessageKind.
Definition at line 970 of file CallEvent.h.
|
inlineprotected |
Definition at line 976 of file CallEvent.h.
|
protecteddefault |
|
override |
Definition at line 1313 of file CallEvent.cpp.
References clang::ento::CallEvent::argumentsMayEscape(), clang::Selector::getIdentifierInfoForSlot(), clang::Selector::getNumArgs(), clang::ento::CallEvent::isInSystemHeader(), and clang::IdentifierInfo::isStr().
|
protectedvirtual |
Check if the selector may have multiple definitions (may have overrides).
Definition at line 1086 of file CallEvent.cpp.
References clang::ObjCMethodDecl::getClassInterface(), clang::ObjCInterfaceDecl::getEndOfDefinitionLoc(), clang::Decl::getLocation(), clang::ento::CallEvent::getState(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ObjCMethodDecl::isOverriding(), clang::SourceLocation::isValid(), clang::ObjCInterfaceDecl::lookupMethod(), and clang::OCM_PropertyAccess.
Definition at line 1075 of file CallEvent.h.
References clang::ento::CE_ObjCMessage.
|
inlineoverrideprotected |
Definition at line 984 of file CallEvent.h.
const ObjCPropertyDecl * ObjCMethodCall::getAccessedProperty | ( | ) | const |
Definition at line 1064 of file CallEvent.cpp.
References clang::ObjCMethodDecl::findPropertyDecl(), clang::ento::CallEvent::getDecl(), getSyntacticFromForPseudoObjectExpr(), clang::ObjCMethodDecl::isPropertyAccessor(), and clang::OCM_PropertyAccess.
|
inlineoverride |
Definition at line 1006 of file CallEvent.h.
Referenced by findKnownClass().
|
inlineoverride |
Definition at line 998 of file CallEvent.h.
Referenced by getMethodReceiverIfKnownImmutable(), getReceiverNullability(), and isNSStringType().
|
overrideprotected |
Definition at line 927 of file CallEvent.cpp.
References clang::ento::CallEvent::getState(), clang::ento::RegionAndSymbolInvalidationTraits::TK_DoNotInvalidateSuperRegion, and clang::ento::RegionAndSymbolInvalidationTraits::TK_SuppressEscape.
|
override |
Definition at line 1324 of file CallEvent.cpp.
References addParameterValuesToBindings(), clang::LocationContext::getAnalysisDeclContext(), clang::LocationContext::getDecl(), clang::AnalysisDeclContext::getSelfDecl(), and clang::ento::CallEvent::getState().
|
inlineoverride |
Definition at line 1073 of file CallEvent.h.
References clang::ento::CE_ObjCMessage.
ObjCMessageKind ObjCMethodCall::getMessageKind | ( | ) | const |
Returns how the message was written in the source (property access, subscript, or explicit message send).
Definition at line 1020 of file CallEvent.cpp.
References clang::ento::CallEvent::Data, clang::ento::CallEvent::getLocationContext(), and clang::LocationContext::getParentMap().
Referenced by describeUninitializedArgumentInCall(), and findKnownClass().
|
inline |
Definition at line 1014 of file CallEvent.h.
Referenced by isInitMessage().
|
inlineoverride |
Definition at line 1002 of file CallEvent.h.
|
inlinevirtual |
Definition at line 994 of file CallEvent.h.
References clang::ento::CallEvent::getOriginExpr().
Referenced by describeUninitializedArgumentInCall(), getMethodReceiverIfKnownImmutable(), getReturnTypeForMethod(), isInvalidSelf(), and supportsNilWithFloatRet().
|
inline |
Get the interface for the receiver.
This works whether this is an instance message or a class message. However, it currently just uses the static type of the receiver.
Definition at line 1034 of file CallEvent.h.
Referenced by findKnownClass(), GetCFNumberSize(), getMethodReceiverIfKnownImmutable(), GetReceiverInterfaceName(), isDebuggingContext(), and isNSStringType().
SVal ObjCMethodCall::getReceiverSVal | ( | ) | const |
Returns the value of the receiver at the time of this call.
Definition at line 960 of file CallEvent.cpp.
References clang::ento::CallEvent::getOriginExpr(), clang::ento::CallEvent::getSVal(), and clang::ObjCMessageExpr::SuperInstance.
Referenced by describeUninitializedArgumentInCall(), getMethodReceiverIfKnownImmutable(), getReceiverNullability(), getReturnTypeForMethod(), and isDebuggingContext().
|
override |
Definition at line 1172 of file CallEvent.cpp.
References findDefiningRedecl(), clang::QualType::getCanonicalType(), clang::ento::getDynamicTypeInfo(), clang::ObjCMessageExpr::getInstanceReceiver(), clang::ObjCObjectPointerType::getInterfaceDecl(), clang::ObjCMessageExpr::getMethodDecl(), clang::ento::CallEvent::getOriginExpr(), clang::ObjCMessageExpr::getReceiverInterface(), clang::ObjCMessageExpr::getSelector(), clang::ento::CallEvent::getState(), clang::ObjCMessageExpr::getSuperType(), isCallToSelfClass(), clang::ObjCMessageExpr::isInstanceMessage(), and clang::QualType::isNull().
|
inline |
Definition at line 1018 of file CallEvent.h.
References clang::tooling::fixit::internal::getSourceRange().
Referenced by findKnownClass(), getMethodReceiverIfKnownImmutable(), isDebuggingContext(), isKnownDeallocObjCMethodName(), and isNSStringType().
SVal ObjCMethodCall::getSelfSVal | ( | ) | const |
Return the value of 'self' if available.
Definition at line 952 of file CallEvent.cpp.
References clang::ento::CallEvent::getLocationContext(), clang::LocationContext::getSelfDecl(), and clang::ento::CallEvent::getState().
|
override |
Definition at line 989 of file CallEvent.cpp.
References clang::ento::CallEvent::getOriginExpr(), clang::Stmt::getSourceRange(), clang::OCM_Message, clang::OCM_PropertyAccess, and clang::OCM_Subscript.
|
inline |
Definition at line 1010 of file CallEvent.h.
Referenced by GetCFNumberSize(), and isNSStringType().
bool ObjCMethodCall::isReceiverSelfOrSuper | ( | ) | const |
Checks if the receiver refers to 'self' or 'super'.
Definition at line 976 of file CallEvent.cpp.
References clang::ento::CallEvent::getOriginExpr(), clang::ento::CallEvent::getSVal(), clang::ObjCMessageExpr::SuperClass, and clang::ObjCMessageExpr::SuperInstance.
Referenced by getMethodReceiverIfKnownImmutable(), and getReceiverNullability().
|
inline |
Returns true if this property access or subscript is a setter (has the form of an assignment).
Definition at line 1047 of file CallEvent.h.
References clang::OCM_Message, clang::OCM_PropertyAccess, and clang::OCM_Subscript.
Referenced by describeUninitializedArgumentInCall().
|
override |
Definition at line 920 of file CallEvent.cpp.
References clang::ento::CallEvent::getDecl(), and clang::ObjCMethodDecl::parameters().
|
friend |
Definition at line 971 of file CallEvent.h.