clang  8.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
Collaboration diagram for clang::ObjCMethodCall:
Collaboration graph

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)=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...


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 955 of file CallEvent.h.

Constructor & Destructor Documentation

◆ ObjCMethodCall() [1/2]

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

Definition at line 961 of file CallEvent.h.

◆ ObjCMethodCall() [2/2]

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

Member Function Documentation

◆ argumentsMayEscape()

bool ObjCMethodCall::argumentsMayEscape ( ) const

◆ canBeOverridenInSubclass()

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

◆ classof()

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

Definition at line 1060 of file CallEvent.h.

References clang::ento::CE_ObjCMessage.

◆ cloneTo()

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

Definition at line 969 of file CallEvent.h.

◆ getAccessedProperty()

const ObjCPropertyDecl * ObjCMethodCall::getAccessedProperty ( ) const

◆ getArgExpr()

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

Definition at line 991 of file CallEvent.h.

◆ getDecl()

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

◆ getExtraInvalidatedValues()

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

◆ getInitialStackFrameContents()

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

◆ getKind()

Kind clang::ObjCMethodCall::getKind ( ) const

Definition at line 1058 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 1015 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

Definition at line 999 of file CallEvent.h.

Referenced by isInitMessage().

◆ getNumArgs()

unsigned clang::ObjCMethodCall::getNumArgs ( ) const

Definition at line 987 of file CallEvent.h.

◆ getOriginExpr()

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

◆ getReceiverInterface()

const ObjCInterfaceDecl* clang::ObjCMethodCall::getReceiverInterface ( ) const

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 1019 of file CallEvent.h.

Referenced by GetCFNumberSize(), clang::ento::RetainSummaryManager::getClassMethodSummary(), clang::ento::RetainSummaryManager::getInstanceMethodSummary(), GetReceiverInterfaceName(), isDebuggingContext(), and isNSStringType().

◆ getReceiverSVal()

SVal ObjCMethodCall::getReceiverSVal ( ) const

◆ getRuntimeDefinition()

RuntimeDefinition ObjCMethodCall::getRuntimeDefinition ( ) const

Definition at line 1167 of file CallEvent.cpp.

◆ getSelector()

Selector clang::ObjCMethodCall::getSelector ( ) const

◆ getSelfSVal()

SVal ObjCMethodCall::getSelfSVal ( ) const

Return the value of 'self' if available.

Definition at line 947 of file CallEvent.cpp.

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

◆ getSourceRange()

SourceRange ObjCMethodCall::getSourceRange ( ) const

◆ isInstanceMessage()

bool clang::ObjCMethodCall::isInstanceMessage ( ) const

◆ isReceiverSelfOrSuper()

bool ObjCMethodCall::isReceiverSelfOrSuper ( ) const

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

Definition at line 971 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

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

Definition at line 1032 of file CallEvent.h.

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

Referenced by describeUninitializedArgumentInCall().

◆ parameters()

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

Friends And Related Function Documentation

◆ CallEventManager

friend class CallEventManager

Definition at line 956 of file CallEvent.h.

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