clang
7.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 933 of file CallEvent.h.
|
inlineprotected |
Definition at line 939 of file CallEvent.h.
|
protecteddefault |
|
override |
Definition at line 1234 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 1007 of file CallEvent.cpp.
References clang::ObjCMethodDecl::getClassInterface(), clang::ObjCInterfaceDecl::getEndOfDefinitionLoc(), clang::Decl::getLocation(), clang::ento::CallEvent::getState(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ento::AnalysisManager::isInCodeFile(), clang::ObjCMethodDecl::isOverriding(), clang::SourceLocation::isValid(), clang::ObjCInterfaceDecl::lookupMethod(), and clang::OCM_PropertyAccess.
Definition at line 1038 of file CallEvent.h.
References clang::ento::CE_ObjCMessage.
|
inlineoverrideprotected |
Definition at line 947 of file CallEvent.h.
const ObjCPropertyDecl * ObjCMethodCall::getAccessedProperty | ( | ) | const |
Definition at line 985 of file CallEvent.cpp.
References clang::ObjCMethodDecl::findPropertyDecl(), clang::ento::CallEvent::getDecl(), getSyntacticFromForPseudoObjectExpr(), clang::ObjCMethodDecl::isPropertyAccessor(), and clang::OCM_PropertyAccess.
|
inlineoverride |
Definition at line 969 of file CallEvent.h.
|
inlineoverride |
Definition at line 961 of file CallEvent.h.
Referenced by getMethodReceiverIfKnownImmutable(), getReceiverNullability(), isGeneralizedObjectRef(), and isNSStringType().
|
overrideprotected |
Definition at line 848 of file CallEvent.cpp.
References clang::ento::SVal::getAsRegion(), clang::ento::CallEvent::getState(), clang::ento::RegionAndSymbolInvalidationTraits::setTrait(), clang::ento::RegionAndSymbolInvalidationTraits::TK_DoNotInvalidateSuperRegion, and clang::ento::RegionAndSymbolInvalidationTraits::TK_SuppressEscape.
|
override |
Definition at line 1245 of file CallEvent.cpp.
References addParameterValuesToBindings(), clang::LocationContext::getAnalysisDeclContext(), clang::LocationContext::getDecl(), clang::AnalysisDeclContext::getSelfDecl(), clang::ento::CallEvent::getState(), and clang::ento::MemRegionManager::getVarRegion().
|
inlineoverride |
Definition at line 1036 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 941 of file CallEvent.cpp.
References clang::ento::CallEvent::Data, clang::ento::CallEvent::getLocationContext(), and clang::LocationContext::getParentMap().
Referenced by describeUninitializedArgumentInCall().
|
inline |
Definition at line 977 of file CallEvent.h.
Referenced by isInitMessage().
|
inlineoverride |
Definition at line 965 of file CallEvent.h.
|
inlinevirtual |
Definition at line 957 of file CallEvent.h.
References clang::ento::CallEvent::getOriginExpr().
Referenced by getMethodReceiverIfKnownImmutable(), getReturnTypeForMethod(), supportsNilWithFloatRet(), and updateOutParameter().
|
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 997 of file CallEvent.h.
Referenced by GetCFNumberSize(), GetReceiverInterfaceName(), isDebuggingContext(), isGeneralizedObjectRef(), and isNSStringType().
SVal ObjCMethodCall::getReceiverSVal | ( | ) | const |
Returns the value of the receiver at the time of this call.
Definition at line 881 of file CallEvent.cpp.
References clang::ento::CallEvent::getOriginExpr(), clang::ento::CallEvent::getSVal(), clang::ento::SVal::isValid(), and clang::ObjCMessageExpr::SuperInstance.
Referenced by getMethodReceiverIfKnownImmutable(), getReceiverNullability(), GetReturnType(), getReturnTypeForMethod(), isDebuggingContext(), isGeneralizedObjectRef(), and updateOutParameter().
|
override |
Definition at line 1093 of file CallEvent.cpp.
|
inline |
Definition at line 981 of file CallEvent.h.
References clang::tooling::fixit::internal::getSourceRange().
Referenced by isDebuggingContext(), isGeneralizedObjectRef(), isKnownDeallocObjCMethodName(), and isNSStringType().
SVal ObjCMethodCall::getSelfSVal | ( | ) | const |
Return the value of 'self' if available.
Definition at line 873 of file CallEvent.cpp.
References clang::ento::CallEvent::getLocationContext(), clang::LocationContext::getSelfDecl(), and clang::ento::CallEvent::getState().
|
override |
Definition at line 910 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 973 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 897 of file CallEvent.cpp.
References clang::ento::CallEvent::getOriginExpr(), clang::ento::CallEvent::getSVal(), clang::ObjCMessageExpr::SuperClass, and clang::ObjCMessageExpr::SuperInstance.
Referenced by getReceiverNullability().
|
inline |
Returns true if this property access or subscript is a setter (has the form of an assignment).
Definition at line 1010 of file CallEvent.h.
References clang::OCM_Message, clang::OCM_PropertyAccess, and clang::OCM_Subscript.
Referenced by describeUninitializedArgumentInCall().
|
override |
Definition at line 841 of file CallEvent.cpp.
References clang::ento::CallEvent::getDecl(), and clang::ObjCMethodDecl::parameters().
|
friend |
Definition at line 934 of file CallEvent.h.