clang  3.7.0
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::ObjCMessageExpr Class Reference

An expression that sends a message to the given Objective-C object or class. More...

#include <ExprObjC.h>

Inheritance diagram for clang::ObjCMessageExpr:
[legend]
Collaboration diagram for clang::ObjCMessageExpr:
[legend]

Public Types

enum  ReceiverKind { Class = 0, Instance, SuperClass, SuperInstance }
 The kind of receiver this message is sending to. More...
 
typedef ExprIterator arg_iterator
 
typedef ConstExprIterator const_arg_iterator
 
- Public Types inherited from clang::Expr
enum  LValueClassification {
  LV_Valid, LV_NotObjectType, LV_IncompleteVoidType, LV_DuplicateVectorComponents,
  LV_InvalidExpression, LV_InvalidMessageExpression, LV_MemberFunction, LV_SubObjCPropertySetting,
  LV_ClassTemporary, LV_ArrayTemporary
}
 
enum  isModifiableLvalueResult {
  MLV_Valid, MLV_NotObjectType, MLV_IncompleteVoidType, MLV_DuplicateVectorComponents,
  MLV_InvalidExpression, MLV_LValueCast, MLV_IncompleteType, MLV_ConstQualified,
  MLV_ConstAddrSpace, MLV_ArrayType, MLV_NoSetterProperty, MLV_MemberFunction,
  MLV_SubObjCPropertySetting, MLV_InvalidMessageExpression, MLV_ClassTemporary, MLV_ArrayTemporary
}
 
enum  SideEffectsKind { SE_NoSideEffects, SE_AllowSideEffects }
 
enum  NullPointerConstantKind {
  NPCK_NotNull = 0, NPCK_ZeroExpression, NPCK_ZeroLiteral, NPCK_CXX11_nullptr,
  NPCK_GNUNull
}
 Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant(). More...
 
enum  NullPointerConstantValueDependence { NPC_NeverValueDependent = 0, NPC_ValueDependentIsNull, NPC_ValueDependentIsNotNull }
 Enumeration used to describe how isNullPointerConstant() should cope with value-dependent expressions. More...
 

Public Member Functions

bool isImplicit () const
 Indicates whether the message send was implicitly generated by the implementation. If false, it was written explicitly in the source code. More...
 
ReceiverKind getReceiverKind () const
 Determine the kind of receiver that this message is being sent to. More...
 
SourceRange getReceiverRange () const
 Source range of the receiver. More...
 
bool isInstanceMessage () const
 Determine whether this is an instance message to either a computed object or to super. More...
 
bool isClassMessage () const
 Determine whether this is an class message to either a specified class or to super. More...
 
ExprgetInstanceReceiver ()
 Returns the object expression (receiver) for an instance message, or null for a message that is not an instance message. More...
 
const ExprgetInstanceReceiver () const
 
void setInstanceReceiver (Expr *rec)
 Turn this message send into an instance message that computes the receiver object with the given expression. More...
 
QualType getClassReceiver () const
 Returns the type of a class message send, or NULL if the message is not a class message. More...
 
TypeSourceInfogetClassReceiverTypeInfo () const
 Returns a type-source information of a class message send, or NULL if the message is not a class message. More...
 
void setClassReceiver (TypeSourceInfo *TSInfo)
 
SourceLocation getSuperLoc () const
 Retrieve the location of the 'super' keyword for a class or instance message to 'super', otherwise an invalid source location. More...
 
QualType getReceiverType () const
 Retrieve the receiver type to which this message is being directed. More...
 
ObjCInterfaceDeclgetReceiverInterface () const
 Retrieve the Objective-C interface to which this message is being directed, if known. More...
 
QualType getSuperType () const
 Retrieve the type referred to by 'super'. More...
 
void setSuper (SourceLocation Loc, QualType T, bool IsInstanceSuper)
 
Selector getSelector () const
 
void setSelector (Selector S)
 
const ObjCMethodDeclgetMethodDecl () const
 
ObjCMethodDeclgetMethodDecl ()
 
void setMethodDecl (ObjCMethodDecl *MD)
 
ObjCMethodFamily getMethodFamily () const
 
unsigned getNumArgs () const
 Return the number of actual arguments in this message, not counting the receiver. More...
 
Expr ** getArgs ()
 Retrieve the arguments to this message, not including the receiver. More...
 
const Expr *const * getArgs () const
 
ExprgetArg (unsigned Arg)
 getArg - Return the specified argument. More...
 
const ExprgetArg (unsigned Arg) const
 
void setArg (unsigned Arg, Expr *ArgExpr)
 setArg - Set the specified argument. More...
 
bool isDelegateInitCall () const
 
void setDelegateInitCall (bool isDelegate)
 
SourceLocation getLeftLoc () const
 
SourceLocation getRightLoc () const
 
SourceLocation getSelectorStartLoc () const
 
SourceLocation getSelectorLoc (unsigned Index) const
 
void getSelectorLocs (SmallVectorImpl< SourceLocation > &SelLocs) const
 
unsigned getNumSelectorLocs () const
 
void setSourceRange (SourceRange R)
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () const LLVM_READONLY
 
child_range children ()
 
arg_iterator arg_begin ()
 
arg_iterator arg_end ()
 
const_arg_iterator arg_begin () const
 
const_arg_iterator arg_end () const
 
- Public Member Functions inherited from clang::Expr
QualType getType () const
 
void setType (QualType t)
 
bool isValueDependent () const
 
void setValueDependent (bool VD)
 Set whether this expression is value-dependent or not. More...
 
bool isTypeDependent () const
 
void setTypeDependent (bool TD)
 Set whether this expression is type-dependent or not. More...
 
bool isInstantiationDependent () const
 Whether this expression is instantiation-dependent, meaning that it depends in some way on a template parameter, even if neither its type nor (constant) value can change due to the template instantiation. More...
 
void setInstantiationDependent (bool ID)
 Set whether this expression is instantiation-dependent or not. More...
 
bool containsUnexpandedParameterPack () const
 Whether this expression contains an unexpanded parameter pack (for C++11 variadic templates). More...
 
void setContainsUnexpandedParameterPack (bool PP=true)
 Set the bit that describes whether this expression contains an unexpanded parameter pack. More...
 
SourceLocation getExprLoc () const LLVM_READONLY
 
bool isUnusedResultAWarning (const Expr *&WarnExpr, SourceLocation &Loc, SourceRange &R1, SourceRange &R2, ASTContext &Ctx) const
 
bool isLValue () const
 
bool isRValue () const
 
bool isXValue () const
 
bool isGLValue () const
 
LValueClassification ClassifyLValue (ASTContext &Ctx) const
 Reasons why an expression might not be an l-value. More...
 
isModifiableLvalueResult isModifiableLvalue (ASTContext &Ctx, SourceLocation *Loc=nullptr) const
 
Classification Classify (ASTContext &Ctx) const
 Classify - Classify this expression according to the C++11 expression taxonomy. More...
 
Classification ClassifyModifiable (ASTContext &Ctx, SourceLocation &Loc) const
 ClassifyModifiable - Classify this expression according to the C++11 expression taxonomy, and see if it is valid on the left side of an assignment. More...
 
ExprValueKind getValueKind () const
 getValueKind - The value kind that this expression produces. More...
 
ExprObjectKind getObjectKind () const
 
bool isOrdinaryOrBitFieldObject () const
 
void setValueKind (ExprValueKind Cat)
 setValueKind - Set the value kind produced by this expression. More...
 
void setObjectKind (ExprObjectKind Cat)
 setObjectKind - Set the object kind produced by this expression. More...
 
bool refersToBitField () const
 Returns true if this expression is a gl-value that potentially refers to a bit-field. More...
 
FieldDeclgetSourceBitField ()
 If this expression refers to a bit-field, retrieve the declaration of that bit-field. More...
 
const FieldDeclgetSourceBitField () const
 
const ObjCPropertyRefExprgetObjCProperty () const
 If this expression is an l-value for an Objective C property, find the underlying property reference expression. More...
 
bool isObjCSelfExpr () const
 Check if this expression is the ObjC 'self' implicit parameter. More...
 
bool refersToVectorElement () const
 Returns whether this expression refers to a vector element. More...
 
bool hasPlaceholderType () const
 Returns whether this expression has a placeholder type. More...
 
bool hasPlaceholderType (BuiltinType::Kind K) const
 Returns whether this expression has a specific placeholder type. More...
 
bool isKnownToHaveBooleanValue () const
 
bool isIntegerConstantExpr (llvm::APSInt &Result, const ASTContext &Ctx, SourceLocation *Loc=nullptr, bool isEvaluated=true) const
 
bool isIntegerConstantExpr (const ASTContext &Ctx, SourceLocation *Loc=nullptr) const
 
bool isCXX98IntegralConstantExpr (const ASTContext &Ctx) const
 
bool isCXX11ConstantExpr (const ASTContext &Ctx, APValue *Result=nullptr, SourceLocation *Loc=nullptr) const
 
bool isConstantInitializer (ASTContext &Ctx, bool ForRef, const Expr **Culprit=nullptr) const
 
bool EvaluateAsRValue (EvalResult &Result, const ASTContext &Ctx) const
 
bool EvaluateAsBooleanCondition (bool &Result, const ASTContext &Ctx) const
 
bool EvaluateAsInt (llvm::APSInt &Result, const ASTContext &Ctx, SideEffectsKind AllowSideEffects=SE_NoSideEffects) const
 
bool isEvaluatable (const ASTContext &Ctx) const
 
bool HasSideEffects (const ASTContext &Ctx, bool IncludePossibleEffects=true) const
 
bool hasNonTrivialCall (const ASTContext &Ctx) const
 Determine whether this expression involves a call to any function that is not trivial. More...
 
llvm::APSInt EvaluateKnownConstInt (const ASTContext &Ctx, SmallVectorImpl< PartialDiagnosticAt > *Diag=nullptr) const
 
void EvaluateForOverflow (const ASTContext &Ctx) const
 
bool EvaluateAsLValue (EvalResult &Result, const ASTContext &Ctx) const
 
bool EvaluateAsInitializer (APValue &Result, const ASTContext &Ctx, const VarDecl *VD, SmallVectorImpl< PartialDiagnosticAt > &Notes) const
 
bool EvaluateWithSubstitution (APValue &Value, ASTContext &Ctx, const FunctionDecl *Callee, ArrayRef< const Expr * > Args) const
 
NullPointerConstantKind isNullPointerConstant (ASTContext &Ctx, NullPointerConstantValueDependence NPC) const
 
bool isOBJCGCCandidate (ASTContext &Ctx) const
 
bool isBoundMemberFunction (ASTContext &Ctx) const
 Returns true if this expression is a bound member function. More...
 
ExprIgnoreImpCasts () LLVM_READONLY
 
ExprIgnoreImplicit () LLVM_READONLY
 
const ExprIgnoreImplicit () const LLVM_READONLY
 
ExprIgnoreParens () LLVM_READONLY
 
ExprIgnoreParenCasts () LLVM_READONLY
 
ExprIgnoreCasts () LLVM_READONLY
 Ignore casts. Strip off any CastExprs, returning their operand. More...
 
ExprIgnoreParenImpCasts () LLVM_READONLY
 
ExprIgnoreConversionOperator () LLVM_READONLY
 
const ExprIgnoreConversionOperator () const LLVM_READONLY
 
const ExprIgnoreParenImpCasts () const LLVM_READONLY
 
ExprIgnoreParenLValueCasts () LLVM_READONLY
 
const ExprIgnoreParenLValueCasts () const LLVM_READONLY
 
ExprIgnoreParenNoopCasts (ASTContext &Ctx) LLVM_READONLY
 
ExprignoreParenBaseCasts () LLVM_READONLY
 Ignore parentheses and derived-to-base casts. More...
 
const ExprignoreParenBaseCasts () const LLVM_READONLY
 
bool isDefaultArgument () const
 Determine whether this expression is a default function argument. More...
 
bool isTemporaryObject (ASTContext &Ctx, const CXXRecordDecl *TempTy) const
 Determine whether the result of this expression is a temporary object of the given class type. More...
 
bool isImplicitCXXThis () const
 Whether this expression is an implicit reference to 'this' in C++. More...
 
const ExprIgnoreImpCasts () const LLVM_READONLY
 
const ExprIgnoreParens () const LLVM_READONLY
 
const ExprIgnoreParenCasts () const LLVM_READONLY
 
const ExprIgnoreCasts () const LLVM_READONLY
 Strip off casts, but keep parentheses. More...
 
const ExprIgnoreParenNoopCasts (ASTContext &Ctx) const LLVM_READONLY
 
const CXXRecordDeclgetBestDynamicClassType () const
 For an expression of class type or pointer to class type, return the most derived class decl the expression is known to refer to. More...
 
const ExprskipRValueSubobjectAdjustments (SmallVectorImpl< const Expr * > &CommaLHS, SmallVectorImpl< SubobjectAdjustment > &Adjustments) const
 

Static Public Member Functions

static ObjCMessageExprCreate (const ASTContext &Context, QualType T, ExprValueKind VK, SourceLocation LBracLoc, SourceLocation SuperLoc, bool IsInstanceSuper, QualType SuperType, Selector Sel, ArrayRef< SourceLocation > SelLocs, ObjCMethodDecl *Method, ArrayRef< Expr * > Args, SourceLocation RBracLoc, bool isImplicit)
 Create a message send to super. More...
 
static ObjCMessageExprCreate (const ASTContext &Context, QualType T, ExprValueKind VK, SourceLocation LBracLoc, TypeSourceInfo *Receiver, Selector Sel, ArrayRef< SourceLocation > SelLocs, ObjCMethodDecl *Method, ArrayRef< Expr * > Args, SourceLocation RBracLoc, bool isImplicit)
 Create a class message send. More...
 
static ObjCMessageExprCreate (const ASTContext &Context, QualType T, ExprValueKind VK, SourceLocation LBracLoc, Expr *Receiver, Selector Sel, ArrayRef< SourceLocation > SeLocs, ObjCMethodDecl *Method, ArrayRef< Expr * > Args, SourceLocation RBracLoc, bool isImplicit)
 Create an instance message send. More...
 
static ObjCMessageExprCreateEmpty (const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
 Create an empty Objective-C message expression, to be filled in by subsequent calls. More...
 
static bool classof (const Stmt *T)
 
- Static Public Member Functions inherited from clang::Expr
static ExprValueKind getValueKindForType (QualType T)
 
static bool isPotentialConstantExpr (const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
 
static bool isPotentialConstantExprUnevaluated (Expr *E, const FunctionDecl *FD, SmallVectorImpl< PartialDiagnosticAt > &Diags)
 
static QualType findBoundMemberType (const Expr *expr)
 Given an expression of bound-member type, find the type of the member. Returns null if this is an overloaded bound member expression. More...
 
static bool hasAnyTypeDependentArguments (ArrayRef< Expr * > Exprs)
 
static bool classof (const Stmt *T)
 

Friends

class ASTStmtReader
 
class ASTStmtWriter
 

Additional Inherited Members

- Protected Member Functions inherited from clang::Expr
 Expr (StmtClass SC, QualType T, ExprValueKind VK, ExprObjectKind OK, bool TD, bool VD, bool ID, bool ContainsUnexpandedParameterPack)
 
 Expr (StmtClass SC, EmptyShell)
 Construct an empty expression. More...
 

Detailed Description

An expression that sends a message to the given Objective-C object or class.

The following contains two message send expressions:

[[NSString alloc] initWithString:@"Hello"]

The innermost message send invokes the "alloc" class method on the NSString class, while the outermost message send invokes the "initWithString" instance method on the object returned from NSString's "alloc". In all, an Objective-C message send can take on four different (although related) forms:

  1. Send to an object instance.
  2. Send to a class.
  3. Send to the superclass instance of the current class.
  4. Send to the superclass of the current class.

All four kinds of message sends are modeled by the ObjCMessageExpr class, and can be distinguished via getReceiverKind(). Example:

Definition at line 858 of file ExprObjC.h.

Member Typedef Documentation

Definition at line 1350 of file ExprObjC.h.

Definition at line 1351 of file ExprObjC.h.

Member Enumeration Documentation

The kind of receiver this message is sending to.

Enumerator
Class 

The receiver is a class.

Instance 

The receiver is an object instance.

SuperClass 

The receiver is a superclass.

SuperInstance 

The receiver is the instance of the superclass object.

Definition at line 998 of file ExprObjC.h.

Member Function Documentation

arg_iterator clang::ObjCMessageExpr::arg_begin ( )
inline

Definition at line 1353 of file ExprObjC.h.

References getArgs().

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr().

const_arg_iterator clang::ObjCMessageExpr::arg_begin ( ) const
inline

Definition at line 1357 of file ExprObjC.h.

References getArgs().

arg_iterator clang::ObjCMessageExpr::arg_end ( )
inline

Definition at line 1354 of file ExprObjC.h.

References getArgs().

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr().

const_arg_iterator clang::ObjCMessageExpr::arg_end ( ) const
inline

Definition at line 1360 of file ExprObjC.h.

References getArgs().

Stmt::child_range ObjCMessageExpr::children ( )

Definition at line 4188 of file Expr.cpp.

References getArgs(), getNumArgs(), getReceiverKind(), and Instance.

static bool clang::ObjCMessageExpr::classof ( const Stmt T)
inlinestatic

Definition at line 1343 of file ExprObjC.h.

ObjCMessageExpr * ObjCMessageExpr::Create ( const ASTContext Context,
QualType  T,
ExprValueKind  VK,
SourceLocation  LBracLoc,
SourceLocation  SuperLoc,
bool  IsInstanceSuper,
QualType  SuperType,
Selector  Sel,
ArrayRef< SourceLocation SelLocs,
ObjCMethodDecl Method,
ArrayRef< Expr * >  Args,
SourceLocation  RBracLoc,
bool  isImplicit 
)
static

Create a message send to super.

Parameters
ContextThe ASTContext in which this expression will be created.
TThe result type of this message.
VKThe value kind of this message. A message returning a l-value or r-value reference will be an l-value or x-value, respectively.
LBracLocThe location of the open square bracket '['.
SuperLocThe location of the "super" keyword.
IsInstanceSuperWhether this is an instance "super" message (otherwise, it's a class "super" message).
SelThe selector used to determine which method gets called.
MethodThe Objective-C method against which this message send was type-checked. May be NULL.
ArgsThe message send arguments.
RBracLocThe location of the closing square bracket ']'.

Definition at line 3597 of file Expr.cpp.

References isImplicit().

Referenced by clang::Sema::BuildClassMessage(), and clang::Sema::BuildInstanceMessage().

ObjCMessageExpr * ObjCMessageExpr::Create ( const ASTContext Context,
QualType  T,
ExprValueKind  VK,
SourceLocation  LBracLoc,
TypeSourceInfo Receiver,
Selector  Sel,
ArrayRef< SourceLocation SelLocs,
ObjCMethodDecl Method,
ArrayRef< Expr * >  Args,
SourceLocation  RBracLoc,
bool  isImplicit 
)
static

Create a class message send.

Parameters
ContextThe ASTContext in which this expression will be created.
TThe result type of this message.
VKThe value kind of this message. A message returning a l-value or r-value reference will be an l-value or x-value, respectively.
LBracLocThe location of the open square bracket '['.
ReceiverThe type of the receiver, including source-location information.
SelThe selector used to determine which method gets called.
MethodThe Objective-C method against which this message send was type-checked. May be NULL.
ArgsThe message send arguments.
RBracLocThe location of the closing square bracket ']'.

Definition at line 3622 of file Expr.cpp.

References isImplicit().

ObjCMessageExpr * ObjCMessageExpr::Create ( const ASTContext Context,
QualType  T,
ExprValueKind  VK,
SourceLocation  LBracLoc,
Expr Receiver,
Selector  Sel,
ArrayRef< SourceLocation SeLocs,
ObjCMethodDecl Method,
ArrayRef< Expr * >  Args,
SourceLocation  RBracLoc,
bool  isImplicit 
)
static

Create an instance message send.

Parameters
ContextThe ASTContext in which this expression will be created.
TThe result type of this message.
VKThe value kind of this message. A message returning a l-value or r-value reference will be an l-value or x-value, respectively.
LBracLocThe location of the open square bracket '['.
ReceiverThe expression used to produce the object that will receive this message.
SelThe selector used to determine which method gets called.
MethodThe Objective-C method against which this message send was type-checked. May be NULL.
ArgsThe message send arguments.
RBracLocThe location of the closing square bracket ']'.

Definition at line 3645 of file Expr.cpp.

References isImplicit().

ObjCMessageExpr * ObjCMessageExpr::CreateEmpty ( const ASTContext Context,
unsigned  NumArgs,
unsigned  NumStoredSelLocs 
)
static

Create an empty Objective-C message expression, to be filled in by subsequent calls.

Parameters
ContextThe context in which the message send will be created.
NumArgsThe number of message arguments, not including the receiver.

Definition at line 3668 of file Expr.cpp.

Expr* clang::ObjCMessageExpr::getArg ( unsigned  Arg)
inline
const Expr* clang::ObjCMessageExpr::getArg ( unsigned  Arg) const
inline

Definition at line 1290 of file ExprObjC.h.

References getArgs().

Expr** clang::ObjCMessageExpr::getArgs ( )
inline

Retrieve the arguments to this message, not including the receiver.

Definition at line 1278 of file ExprObjC.h.

Referenced by arg_begin(), arg_end(), children(), getArg(), getSelectorLoc(), and setArg().

const Expr* const* clang::ObjCMessageExpr::getArgs ( ) const
inline

Definition at line 1281 of file ExprObjC.h.

QualType clang::ObjCMessageExpr::getClassReceiver ( ) const
inline

Returns the type of a class message send, or NULL if the message is not a class message.

Definition at line 1171 of file ExprObjC.h.

References getClassReceiverTypeInfo().

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), GetAssumedMessageSendExprType(), getReceiverType(), and maybeAdjustInterfaceForSubscriptingCheck().

TypeSourceInfo* clang::ObjCMessageExpr::getClassReceiverTypeInfo ( ) const
inline

Returns a type-source information of a class message send, or NULL if the message is not a class message.

Definition at line 1180 of file ExprObjC.h.

References Class, and getReceiverKind().

Referenced by getClassReceiver(), and getReceiverRange().

Expr* clang::ObjCMessageExpr::getInstanceReceiver ( )
inline
const Expr* clang::ObjCMessageExpr::getInstanceReceiver ( ) const
inline

Definition at line 1158 of file ExprObjC.h.

References getInstanceReceiver().

SourceLocation clang::ObjCMessageExpr::getLeftLoc ( ) const
inline

Definition at line 1306 of file ExprObjC.h.

SourceLocation clang::ObjCMessageExpr::getLocEnd ( ) const
inline

Definition at line 1341 of file ExprObjC.h.

SourceLocation clang::ObjCMessageExpr::getLocStart ( ) const
inline

Definition at line 1340 of file ExprObjC.h.

Referenced by getSelectorStartLoc().

const ObjCMethodDecl* clang::ObjCMessageExpr::getMethodDecl ( ) const
inline
ObjCMethodDecl* clang::ObjCMessageExpr::getMethodDecl ( )
inline

Definition at line 1255 of file ExprObjC.h.

ObjCMethodFamily clang::ObjCMessageExpr::getMethodFamily ( ) const
inline
unsigned clang::ObjCMessageExpr::getNumArgs ( ) const
inline
unsigned clang::ObjCMessageExpr::getNumSelectorLocs ( ) const
inline
ObjCInterfaceDecl * ObjCMessageExpr::getReceiverInterface ( ) const

Retrieve the Objective-C interface to which this message is being directed, if known.

This routine cross-cuts all of the different kinds of message sends to determine what the underlying (statically known) type of the receiver will be; use getReceiverKind() to determine whether the message is a class or an instance method, whether it is a send to super or not, etc.

Returns
The Objective-C interface if known, otherwise NULL.

Definition at line 3739 of file Expr.cpp.

References clang::Type::getAs(), and getReceiverType().

Referenced by checkForLiteralCreation(), getMethodReceiverIfKnownImmutable(), GetNSMutableArrayArgumentIndex(), GetNSMutableDictionaryArgumentIndex(), GetNSSetArgumentIndex(), clang::ObjCMethodCall::getRuntimeDefinition(), and clang::ObjCNoReturn::isImplicitNoReturn().

ReceiverKind clang::ObjCMessageExpr::getReceiverKind ( ) const
inline
SourceRange ObjCMessageExpr::getReceiverRange ( ) const
QualType ObjCMessageExpr::getReceiverType ( ) const

Retrieve the receiver type to which this message is being directed.

This routine cross-cuts all of the different kinds of message sends to determine what the underlying (statically known) type of the receiver will be; use getReceiverKind() to determine whether the message is a class or an instance method, whether it is a send to super or not, etc.

Returns
The type of the receiver.

Definition at line 3725 of file Expr.cpp.

References Class, getClassReceiver(), getInstanceReceiver(), getReceiverKind(), getSuperType(), clang::Expr::getType(), Instance, SuperClass, and SuperInstance.

Referenced by getReceiverInterface().

SourceLocation clang::ObjCMessageExpr::getRightLoc ( ) const
inline

Definition at line 1307 of file ExprObjC.h.

Selector ObjCMessageExpr::getSelector ( ) const
SourceLocation clang::ObjCMessageExpr::getSelectorLoc ( unsigned  Index) const
inline
void ObjCMessageExpr::getSelectorLocs ( SmallVectorImpl< SourceLocation > &  SelLocs) const

Definition at line 3696 of file Expr.cpp.

References getNumSelectorLocs(), and getSelectorLoc().

SourceLocation clang::ObjCMessageExpr::getSelectorStartLoc ( ) const
inline

Definition at line 1309 of file ExprObjC.h.

References getLocStart(), getSelectorLoc(), and isImplicit().

SourceLocation clang::ObjCMessageExpr::getSuperLoc ( ) const
inline

Retrieve the location of the 'super' keyword for a class or instance message to 'super', otherwise an invalid source location.

Definition at line 1193 of file ExprObjC.h.

References getReceiverKind(), SuperClass, and SuperInstance.

Referenced by clang::Sema::checkRetainCycles(), and getReceiverRange().

QualType clang::ObjCMessageExpr::getSuperType ( ) const
inline

Retrieve the type referred to by 'super'.

The returned type will either be an ObjCInterfaceType (for an class message to super) or an ObjCObjectPointerType that refers to a class (for an instance message to super);

Definition at line 1228 of file ExprObjC.h.

References clang::QualType::getFromOpaquePtr(), getReceiverKind(), SuperClass, and SuperInstance.

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), getReceiverType(), clang::ObjCMethodCall::getRuntimeDefinition(), and maybeAdjustInterfaceForSubscriptingCheck().

bool clang::ObjCMessageExpr::isClassMessage ( ) const
inline

Determine whether this is an class message to either a specified class or to super.

Definition at line 1146 of file ExprObjC.h.

References Class, getReceiverKind(), and SuperClass.

bool clang::ObjCMessageExpr::isDelegateInitCall ( ) const
inline

isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call", i.e. a call to a method in the -init family on self from within an -init method implementation.

Definition at line 1303 of file ExprObjC.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr().

bool clang::ObjCMessageExpr::isImplicit ( ) const
inline

Indicates whether the message send was implicitly generated by the implementation. If false, it was written explicitly in the source code.

Definition at line 1129 of file ExprObjC.h.

Referenced by checkForLiteralCreation(), Create(), getNumSelectorLocs(), getSelectorStartLoc(), and clang::edit::rewriteToObjCSubscriptSyntax().

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

Determine whether this is an instance message to either a computed object or to super.

Definition at line 1140 of file ExprObjC.h.

References getReceiverKind(), Instance, and SuperInstance.

Referenced by clang::Sema::checkRetainCycles(), clang::ObjCMethodCall::getRuntimeDefinition(), clang::ObjCNoReturn::isImplicitNoReturn(), and clang::Expr::isUnusedResultAWarning().

void clang::ObjCMessageExpr::setArg ( unsigned  Arg,
Expr ArgExpr 
)
inline

setArg - Set the specified argument.

Definition at line 1295 of file ExprObjC.h.

References getArgs().

void clang::ObjCMessageExpr::setClassReceiver ( TypeSourceInfo TSInfo)
inline

Definition at line 1186 of file ExprObjC.h.

References Class.

void clang::ObjCMessageExpr::setDelegateInitCall ( bool  isDelegate)
inline

Definition at line 1304 of file ExprObjC.h.

Referenced by clang::Sema::BuildInstanceMessage().

void clang::ObjCMessageExpr::setInstanceReceiver ( Expr rec)
inline

Turn this message send into an instance message that computes the receiver object with the given expression.

Definition at line 1164 of file ExprObjC.h.

References Instance.

void clang::ObjCMessageExpr::setMethodDecl ( ObjCMethodDecl MD)
inline

Definition at line 1262 of file ExprObjC.h.

void clang::ObjCMessageExpr::setSelector ( Selector  S)
inline

Definition at line 1243 of file ExprObjC.h.

References clang::Selector::getAsOpaquePtr().

void clang::ObjCMessageExpr::setSourceRange ( SourceRange  R)
inline

Definition at line 1336 of file ExprObjC.h.

References clang::SourceRange::getBegin(), and clang::SourceRange::getEnd().

void clang::ObjCMessageExpr::setSuper ( SourceLocation  Loc,
QualType  T,
bool  IsInstanceSuper 
)
inline

Definition at line 1235 of file ExprObjC.h.

References clang::QualType::getAsOpaquePtr(), SuperClass, and SuperInstance.

Friends And Related Function Documentation

friend class ASTStmtReader
friend

Definition at line 1364 of file ExprObjC.h.

friend class ASTStmtWriter
friend

Definition at line 1365 of file ExprObjC.h.


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