clang  6.0.0svn
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
clang::ObjCMethodCall Class Reference

Represents any expression that calls an Objective-C method. More...

#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"

Inheritance diagram for clang::ObjCMethodCall:
Inheritance graph
[legend]
Collaboration diagram for clang::ObjCMethodCall:
Collaboration graph
[legend]

Public Member Functions

virtual const ObjCMessageExprgetOriginExpr () const
 
const ObjCMethodDeclgetDecl () const override
 
unsigned getNumArgs () const override
 
const ExprgetArgExpr (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 ObjCInterfaceDeclgetReceiverInterface () 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 ObjCPropertyDeclgetAccessedProperty () 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)
 
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
 

Detailed Description

Represents any expression that calls an Objective-C method.

This includes all of the kinds listed in ObjCMessageKind.

Definition at line 870 of file CallEvent.h.

Constructor & Destructor Documentation

◆ ObjCMethodCall() [1/2]

clang::ObjCMethodCall::ObjCMethodCall ( const ObjCMessageExpr Msg,
ProgramStateRef  St,
const LocationContext LCtx 
)
inlineprotected

Definition at line 876 of file CallEvent.h.

◆ ObjCMethodCall() [2/2]

clang::ObjCMethodCall::ObjCMethodCall ( const ObjCMethodCall Other)
inlineprotected

Definition at line 882 of file CallEvent.h.

Member Function Documentation

◆ argumentsMayEscape()

bool ObjCMethodCall::argumentsMayEscape ( ) const
override

◆ canBeOverridenInSubclass()

bool ObjCMethodCall::canBeOverridenInSubclass ( ObjCInterfaceDecl IDecl,
Selector  Sel 
) const
protectedvirtual

◆ classof()

static bool clang::ObjCMethodCall::classof ( const CallEvent CA)
inlinestatic

Definition at line 969 of file CallEvent.h.

References clang::ento::CE_ObjCMessage.

◆ cloneTo()

void clang::ObjCMethodCall::cloneTo ( void *  Dest) const
inlineoverrideprotected

Definition at line 883 of file CallEvent.h.

◆ getAccessedProperty()

const ObjCPropertyDecl * ObjCMethodCall::getAccessedProperty ( ) const

◆ getArgExpr()

const Expr* clang::ObjCMethodCall::getArgExpr ( unsigned  Index) const
inlineoverride

Definition at line 902 of file CallEvent.h.

◆ getDecl()

const ObjCMethodDecl* clang::ObjCMethodCall::getDecl ( ) const
inlineoverride

◆ getExtraInvalidatedValues()

void ObjCMethodCall::getExtraInvalidatedValues ( ValueList Values,
RegionAndSymbolInvalidationTraits ETraits 
) const
overrideprotected

◆ getInitialStackFrameContents()

void ObjCMethodCall::getInitialStackFrameContents ( const StackFrameContext CalleeCtx,
BindingsTy &  Bindings 
) const
override

◆ getKind()

Kind clang::ObjCMethodCall::getKind ( ) const
inlineoverride

Definition at line 967 of file CallEvent.h.

References clang::ento::CE_ObjCMessage.

◆ getMessageKind()

ObjCMessageKind ObjCMethodCall::getMessageKind ( ) const

Returns how the message was written in the source (property access, subscript, or explicit message send).

Definition at line 806 of file CallEvent.cpp.

References clang::ento::CallEvent::Data, clang::ento::CallEvent::getLocationContext(), and clang::LocationContext::getParentMap().

Referenced by describeUninitializedArgumentInCall().

◆ getMethodFamily()

ObjCMethodFamily clang::ObjCMethodCall::getMethodFamily ( ) const
inline

Definition at line 909 of file CallEvent.h.

Referenced by isInitMessage().

◆ getNumArgs()

unsigned clang::ObjCMethodCall::getNumArgs ( ) const
inlineoverride

Definition at line 899 of file CallEvent.h.

◆ getOriginExpr()

virtual const ObjCMessageExpr* clang::ObjCMethodCall::getOriginExpr ( ) const
inlinevirtual

◆ getReceiverInterface()

const ObjCInterfaceDecl* clang::ObjCMethodCall::getReceiverInterface ( ) const
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 928 of file CallEvent.h.

Referenced by GetCFNumberSize(), GetReceiverInterfaceName(), isGeneralizedObjectRef(), and isNSStringType().

◆ getReceiverSVal()

SVal ObjCMethodCall::getReceiverSVal ( ) const

◆ getRuntimeDefinition()

RuntimeDefinition ObjCMethodCall::getRuntimeDefinition ( ) const
override

Definition at line 960 of file CallEvent.cpp.

◆ getSelector()

Selector clang::ObjCMethodCall::getSelector ( ) const
inline

◆ getSelfSVal()

SVal ObjCMethodCall::getSelfSVal ( ) const

Return the value of 'self' if available.

Definition at line 738 of file CallEvent.cpp.

References clang::ento::CallEvent::getLocationContext(), clang::LocationContext::getSelfDecl(), and clang::ento::CallEvent::getState().

◆ getSourceRange()

SourceRange ObjCMethodCall::getSourceRange ( ) const
override

◆ isInstanceMessage()

bool clang::ObjCMethodCall::isInstanceMessage ( ) const
inline

Definition at line 906 of file CallEvent.h.

Referenced by GetCFNumberSize(), and isNSStringType().

◆ isReceiverSelfOrSuper()

bool ObjCMethodCall::isReceiverSelfOrSuper ( ) const

Checks if the receiver refers to 'self' or 'super'.

Definition at line 762 of file CallEvent.cpp.

References clang::ento::CallEvent::getOriginExpr(), clang::ento::CallEvent::getSVal(), clang::ObjCMessageExpr::SuperClass, and clang::ObjCMessageExpr::SuperInstance.

Referenced by getReceiverNullability().

◆ isSetter()

bool clang::ObjCMethodCall::isSetter ( ) const
inline

Returns true if this property access or subscript is a setter (has the form of an assignment).

Definition at line 941 of file CallEvent.h.

References clang::OCM_Message, clang::OCM_PropertyAccess, and clang::OCM_Subscript.

Referenced by describeUninitializedArgumentInCall().

◆ parameters()

ArrayRef< ParmVarDecl * > ObjCMethodCall::parameters ( ) const
override

Friends And Related Function Documentation

◆ CallEventManager

friend class CallEventManager
friend

Definition at line 871 of file CallEvent.h.


The documentation for this class was generated from the following files: