13#ifndef LLVM_CLANG_AST_EXPROBJC_H
14#define LLVM_CLANG_AST_EXPROBJC_H
30#include "llvm/ADT/ArrayRef.h"
31#include "llvm/ADT/PointerIntPair.h"
32#include "llvm/ADT/PointerUnion.h"
33#include "llvm/ADT/StringRef.h"
34#include "llvm/ADT/iterator_range.h"
35#include "llvm/Support/Casting.h"
36#include "llvm/Support/Compiler.h"
37#include "llvm/Support/TrailingObjects.h"
38#include "llvm/Support/VersionTuple.h"
39#include "llvm/Support/type_traits.h"
59 ExpressibleAsConstantInitializer;
74 ExpressibleAsConstantInitializer;
77 return T->getStmtClass() >= firstObjCObjectLiteralConstant &&
78 T->getStmtClass() <= lastObjCObjectLiteralConstant;
92 String(SL), AtLoc(L) {}
114 return T->getStmtClass() == ObjCStringLiteralClass;
130 :
Expr(ObjCBoolLiteralExprClass,
Empty) {}
151 return T->getStmtClass() == ObjCBoolLiteralExprClass;
168 bool ExpressibleAsConstantInitializer,
SourceRange R)
172 SubExpr(E), BoxingMethod(
Method), Range(R) {
204 return reinterpret_cast<Stmt const * const*
>(&SubExpr);
208 return reinterpret_cast<Stmt const * const*
>(&SubExpr + 1);
212 return T->getStmtClass() == ObjCBoxedExprClass;
218class ObjCArrayLiteral final
220 private llvm::TrailingObjects<ObjCArrayLiteral, Expr *> {
221 unsigned NumElements;
227 bool ExpressibleAsConstantInitializer,
SourceRange SR);
231 NumElements(NumElements) {}
240 bool ExpressibleAsConstantInitializer,
244 unsigned NumElements);
266 assert((Index < NumElements) &&
"Arg access out of range!");
270 assert((Index < NumElements) &&
"Arg access out of range!");
275 return ArrayWithObjectsMethod;
285 return const_cast<ObjCArrayLiteral *
>(
this)->
children();
289 return T->getStmtClass() == ObjCArrayLiteralClass;
338class ObjCDictionaryLiteral final
340 private llvm::TrailingObjects<ObjCDictionaryLiteral,
341 ObjCDictionaryLiteral_KeyValuePair,
342 ObjCDictionaryLiteral_ExpansionData> {
344 unsigned NumElements : 31;
353 LLVM_PREFERRED_TYPE(
bool)
354 unsigned HasPackExpansions : 1;
365 bool ExpressibleAsConstantInitializer,
SourceRange SR);
368 bool HasPackExpansions)
370 NumElements(NumElements), HasPackExpansions(HasPackExpansions) {}
372 size_t numTrailingObjects(OverloadToken<KeyValuePair>)
const {
381 static ObjCDictionaryLiteral *
384 bool ExpressibleAsConstantInitializer,
SourceRange SR);
387 unsigned NumElements,
388 bool HasPackExpansions);
395 assert((Index < NumElements) &&
"Arg access out of range!");
396 const KeyValuePair &KV = getTrailingObjects<KeyValuePair>()[Index];
399 if (HasPackExpansions) {
400 const ExpansionData &Expansion =
401 getTrailingObjects<ExpansionData>()[Index];
410 return DictWithObjectsMethod;
421 static_assert(
sizeof(KeyValuePair) ==
sizeof(
Stmt *) * 2,
422 "KeyValuePair is expected size");
424 reinterpret_cast<Stmt **
>(getTrailingObjects<KeyValuePair>()),
425 reinterpret_cast<Stmt **
>(getTrailingObjects<KeyValuePair>()) +
430 return const_cast<ObjCDictionaryLiteral *
>(
this)->
children();
434 return T->getStmtClass() == ObjCDictionaryLiteralClass;
449 EncodedType(EncodedType), AtLoc(at), RParenLoc(rp) {
465 EncodedType = EncType;
481 return T->getStmtClass() == ObjCEncodeExprClass;
494 SelName(selInfo), AtLoc(at), SelNameLoc(selNameLoc), RParenLoc(rp) {
526 return T->getStmtClass() == ObjCSelectorExprClass;
549 TheProtocol(protocol), AtLoc(at), ProtoLoc(protoLoc), RParenLoc(rp) {
577 return T->getStmtClass() == ObjCProtocolExprClass;
591 LLVM_PREFERRED_TYPE(
bool)
595 LLVM_PREFERRED_TYPE(
bool)
601 bool freeIvar =
false)
604 D(d), Base(base), Loc(l), OpLoc(oploc), IsArrow(arrow),
605 IsFreeIvar(freeIvar) {
644 return T->getStmtClass() == ObjCIvarRefExprClass;
656 llvm::PointerIntPair<NamedDecl *, 1, bool> PropertyOrGetter;
661 enum MethodRefFlags {
663 MethodRef_Getter = 0x1,
664 MethodRef_Setter = 0x2
668 llvm::PointerIntPair<ObjCMethodDecl *, 2, unsigned> SetterAndMethodRefFlags;
681 llvm::PointerUnion<Stmt *, const Type *, ObjCInterfaceDecl *> Receiver;
686 :
Expr(ObjCPropertyRefExprClass, t,
VK, OK), PropertyOrGetter(PD,
false),
687 IdLoc(l), Receiver(base) {
695 :
Expr(ObjCPropertyRefExprClass, t,
VK, OK), PropertyOrGetter(PD,
false),
696 IdLoc(l), ReceiverLoc(sl), Receiver(st.getTypePtr()) {
704 :
Expr(ObjCPropertyRefExprClass,
T,
VK, OK),
705 PropertyOrGetter(Getter,
true), SetterAndMethodRefFlags(Setter, 0),
706 IdLoc(IdLoc), Receiver(
Base) {
707 assert(
T->isSpecificPlaceholderType(BuiltinType::PseudoObject));
715 :
Expr(ObjCPropertyRefExprClass,
T,
VK, OK),
716 PropertyOrGetter(Getter,
true), SetterAndMethodRefFlags(Setter, 0),
717 IdLoc(IdLoc), ReceiverLoc(SuperLoc), Receiver(SuperTy.getTypePtr()) {
718 assert(
T->isSpecificPlaceholderType(BuiltinType::PseudoObject));
726 :
Expr(ObjCPropertyRefExprClass,
T,
VK, OK),
727 PropertyOrGetter(Getter,
true), SetterAndMethodRefFlags(Setter, 0),
728 IdLoc(IdLoc), ReceiverLoc(ReceiverLoc), Receiver(Receiver) {
729 assert(
T->isSpecificPlaceholderType(BuiltinType::PseudoObject));
734 :
Expr(ObjCPropertyRefExprClass,
Empty) {}
746 return cast_or_null<ObjCMethodDecl>(PropertyOrGetter.getPointer());
751 return SetterAndMethodRefFlags.getPointer();
770 return SetterAndMethodRefFlags.getInt() & MethodRef_Getter;
777 return SetterAndMethodRefFlags.getInt() & MethodRef_Setter;
781 setMethodRefFlag(MethodRef_Getter, val);
785 setMethodRefFlag(MethodRef_Setter, val);
820 Stmt **begin =
reinterpret_cast<Stmt**
>(&Receiver);
831 return T->getStmtClass() == ObjCPropertyRefExprClass;
839 PropertyOrGetter.setPointer(D);
840 PropertyOrGetter.setInt(
false);
841 SetterAndMethodRefFlags.setPointer(
nullptr);
842 SetterAndMethodRefFlags.setInt(methRefFlags);
846 unsigned methRefFlags) {
847 PropertyOrGetter.setPointer(Getter);
848 PropertyOrGetter.setInt(
true);
849 SetterAndMethodRefFlags.setPointer(Setter);
850 SetterAndMethodRefFlags.setInt(methRefFlags);
854 void setSuperReceiver(QualType
T) { Receiver =
T.getTypePtr(); }
855 void setClassReceiver(ObjCInterfaceDecl *D) { Receiver = D; }
857 void setLocation(SourceLocation L) { IdLoc = L; }
858 void setReceiverLocation(SourceLocation Loc) { ReceiverLoc = Loc; }
860 void setMethodRefFlag(MethodRefFlags flag,
bool val) {
861 unsigned f = SetterAndMethodRefFlags.getInt();
866 SetterAndMethodRefFlags.setInt(f);
879 enum { BASE, KEY, END_EXPR };
880 Stmt* SubExprs[END_EXPR];
892 :
Expr(ObjCSubscriptRefExprClass,
T,
VK, OK), RBracket(RB),
893 GetAtIndexMethodDecl(getMethod), SetAtIndexMethodDecl(setMethod) {
894 SubExprs[BASE] = base;
900 :
Expr(ObjCSubscriptRefExprClass,
Empty) {}
906 return SubExprs[BASE]->getBeginLoc();
918 return GetAtIndexMethodDecl;
922 return SetAtIndexMethodDecl;
938 return T->getStmtClass() == ObjCSubscriptRefExprClass;
971class ObjCMessageExpr final
973 private llvm::TrailingObjects<ObjCMessageExpr, void *, SourceLocation> {
996 enum { NumArgsBitWidth = 16 };
1000 unsigned NumArgs : NumArgsBitWidth;
1014 LLVM_PREFERRED_TYPE(
bool)
1015 unsigned HasMethod : 1;
1019 LLVM_PREFERRED_TYPE(
bool)
1020 unsigned IsDelegateInitCall : 1;
1024 LLVM_PREFERRED_TYPE(
bool)
1025 unsigned IsImplicit : 1;
1030 unsigned SelLocsKind : 2;
1034 SourceLocation SuperLoc;
1038 SourceLocation LBracLoc, RBracLoc;
1040 ObjCMessageExpr(EmptyShell
Empty,
unsigned NumArgs)
1042 IsDelegateInitCall(
false), IsImplicit(
false), SelLocsKind(0) {
1043 setNumArgs(NumArgs);
1047 SourceLocation LBracLoc,
1048 SourceLocation SuperLoc,
1049 bool IsInstanceSuper,
1052 ArrayRef<SourceLocation> SelLocs,
1055 ArrayRef<Expr *> Args,
1056 SourceLocation RBracLoc,
1059 SourceLocation LBracLoc,
1060 TypeSourceInfo *Receiver,
1062 ArrayRef<SourceLocation> SelLocs,
1065 ArrayRef<Expr *> Args,
1066 SourceLocation RBracLoc,
1069 SourceLocation LBracLoc,
1072 ArrayRef<SourceLocation> SelLocs,
1075 ArrayRef<Expr *> Args,
1076 SourceLocation RBracLoc,
1079 size_t numTrailingObjects(OverloadToken<void *>)
const {
return NumArgs + 1; }
1081 void setNumArgs(
unsigned Num) {
1082 assert((
Num >> NumArgsBitWidth) == 0 &&
"Num of args is out of range!");
1086 void initArgsAndSelLocs(ArrayRef<Expr *> Args,
1087 ArrayRef<SourceLocation> SelLocs,
1091 void *getReceiverPointer()
const {
return *getTrailingObjects<void *>(); }
1094 void setReceiverPointer(
void *
Value) {
1095 *getTrailingObjects<void *>() =
Value;
1102 bool hasStandardSelLocs()
const {
1108 SourceLocation *getStoredSelLocs() {
1109 return getTrailingObjects<SourceLocation>();
1111 const SourceLocation *getStoredSelLocs()
const {
1112 return getTrailingObjects<SourceLocation>();
1117 unsigned getNumStoredSelLocs()
const {
1118 if (hasStandardSelLocs())
1123 static ObjCMessageExpr *alloc(
const ASTContext &
C,
1124 ArrayRef<Expr *> Args,
1125 SourceLocation RBraceLoc,
1126 ArrayRef<SourceLocation> SelLocs,
1129 static ObjCMessageExpr *alloc(
const ASTContext &
C,
1131 unsigned NumStoredSelLocs);
1167 bool IsInstanceSuper,
1253 unsigned NumStoredSelLocs);
1274 std::pair<const NamedDecl *, const WarnUnusedResultAttr *>
1303 return static_cast<Expr *
>(getReceiverPointer());
1315 setReceiverPointer(rec);
1322 return TSInfo->getType();
1337 setReceiverPointer(TSInfo);
1387 setReceiverPointer(
T.getAsOpaquePtr());
1399 return reinterpret_cast<const ObjCMethodDecl *
>(SelectorOrMethod);
1413 SelectorOrMethod =
reinterpret_cast<uintptr_t>(MD);
1428 return reinterpret_cast<Expr **
>(getTrailingObjects<void *>() + 1);
1431 return reinterpret_cast<const Expr *
const *
>(getTrailingObjects<void *>() +
1437 assert(Arg < NumArgs &&
"Arg access out of range!");
1441 assert(Arg < NumArgs &&
"Arg access out of range!");
1447 assert(Arg < NumArgs &&
"Arg access out of range!");
1468 if (hasStandardSelLocs())
1472 return getStoredSelLocs()[Index];
1487 LBracLoc = R.getBegin();
1488 RBracLoc = R.getEnd();
1506 llvm::iterator_range<const_arg_iterator>
arguments()
const {
1513 return reinterpret_cast<Stmt **
>(
getArgs() + NumArgs);
1517 return reinterpret_cast<Stmt const * const*
>(
getArgs());
1521 return reinterpret_cast<Stmt const * const*
>(
getArgs() + NumArgs);
1525 return T->getStmtClass() == ObjCMessageExprClass;
1548 IsaMemberLoc(l), OpLoc(oploc), IsArrow(isarrow) {
1589 return T->getStmtClass() == ObjCIsaExprClass;
1615class ObjCIndirectCopyRestoreExpr :
public Expr {
1624 :
Expr(ObjCIndirectCopyRestoreExprClass,
Empty) {}
1653 return Operand->getBeginLoc();
1656 return Operand->getEndLoc();
1664 return s->
getStmtClass() == ObjCIndirectCopyRestoreExprClass;
1676 private llvm::TrailingObjects<ObjCBridgedCastExpr, CXXBaseSpecifier *> {
1680 friend TrailingObjects;
1693 LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}
1719 return T->getStmtClass() == ObjCBridgedCastExprClass;
1739 VersionTuple VersionToCheck;
1746 VersionToCheck(VersionToCheck), AtLoc(AtLoc), RParen(RParen) {
1751 :
Expr(ObjCAvailabilityCheckExprClass, Shell) {}
1770 return T->getStmtClass() == ObjCAvailabilityCheckExprClass;
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a base class of a C++ class.
ExplicitCastExpr(StmtClass SC, QualType exprTy, ExprValueKind VK, CastKind kind, Expr *op, unsigned PathSize, bool HasFPFeatures, TypeSourceInfo *writtenTy)
This represents one expression.
static std::pair< const NamedDecl *, const WarnUnusedResultAttr * > getUnusedResultAttrImpl(const Decl *Callee, QualType ReturnType)
Returns the WarnUnusedResultAttr that is declared on the callee or its return type declaration,...
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
void setDependence(ExprDependence Deps)
Each concrete expr subclass is expected to compute its dependence and call this in the constructor.
Expr * getElement(unsigned Index)
getElement - Return the Element at the specified index.
const Expr *const * getElements() const
Retrieve elements of array of literals.
static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)
ArrayRef< const Expr * > elements() const
elements - Return the elements of the array literal.
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
Expr ** getElements()
Retrieve elements of array of literals.
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
const Expr * getElement(unsigned Index) const
SourceRange getSourceRange() const LLVM_READONLY
ObjCMethodDecl * getArrayWithObjectsMethod() const
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
static bool classof(const Stmt *T)
bool hasVersion() const
This may be '*', in which case this should fold to true.
const_child_range children() const
static bool classof(const Stmt *T)
ObjCAvailabilityCheckExpr(EmptyShell Shell)
SourceRange getSourceRange() const
SourceLocation getBeginLoc() const
SourceLocation getEndLoc() const
VersionTuple getVersion() const
friend class ASTStmtReader
ObjCAvailabilityCheckExpr(VersionTuple VersionToCheck, SourceLocation AtLoc, SourceLocation RParen, QualType Ty)
SourceLocation getEndLoc() const LLVM_READONLY
void setLocation(SourceLocation L)
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocation() const
const_child_range children() const
ObjCBoolLiteralExpr(bool val, QualType Ty, SourceLocation l)
static bool classof(const Stmt *T)
ObjCBoolLiteralExpr(EmptyShell Empty)
const_arg_iterator arg_begin() const
const Expr * getSubExpr() const
ConstExprIterator const_arg_iterator
SourceLocation getAtLoc() const
SourceRange getSourceRange() const LLVM_READONLY
static bool classof(const Stmt *T)
ObjCBoxedExpr(EmptyShell Empty)
ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *Method, bool ExpressibleAsConstantInitializer, SourceRange R)
const_child_range children() const
ObjCMethodDecl * getBoxingMethod() const
SourceLocation getBeginLoc() const LLVM_READONLY
const_arg_iterator arg_end() const
friend class ASTStmtReader
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
ObjCBridgedCastExpr(EmptyShell Shell)
Construct an empty Objective-C bridged cast.
StringRef getBridgeKindName() const
Retrieve the kind of bridge being performed as a string.
SourceLocation getLParenLoc() const
static bool classof(const Stmt *T)
SourceLocation getBridgeKeywordLoc() const
The location of the bridge keyword.
ObjCBridgeCastKind getBridgeKind() const
Determine which kind of bridge is being performed via this cast.
ObjCBridgedCastExpr(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, CastKind CK, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *Operand)
friend class ASTStmtWriter
SourceLocation getBeginLoc() const LLVM_READONLY
friend class ASTStmtReader
static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)
const_child_range children() const
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
ObjCMethodDecl * getDictWithObjectsMethod() const
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
SourceLocation getBeginLoc() const LLVM_READONLY
friend class ASTStmtWriter
SourceLocation getEndLoc() const LLVM_READONLY
friend class ASTStmtReader
SourceRange getSourceRange() const LLVM_READONLY
static bool classof(const Stmt *T)
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)
TypeSourceInfo * getEncodedTypeSourceInfo() const
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getRParenLoc() const
void setRParenLoc(SourceLocation L)
static bool classof(const Stmt *T)
QualType getEncodedType() const
SourceLocation getEndLoc() const LLVM_READONLY
void setAtLoc(SourceLocation L)
ObjCEncodeExpr(QualType T, TypeSourceInfo *EncodedType, SourceLocation at, SourceLocation rp)
SourceLocation getAtLoc() const
ObjCEncodeExpr(EmptyShell Empty)
const Expr * getSubExpr() const
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *s)
bool shouldCopy() const
shouldCopy - True if we should do the 'copy' part of the copy-restore.
SourceLocation getExprLoc() const LLVM_READONLY
ObjCIndirectCopyRestoreExpr(Expr *operand, QualType type, bool shouldCopy)
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
friend class ASTStmtReader
Represents an ObjC class declaration.
SourceLocation getIsaMemberLoc() const
getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.
ObjCIsaExpr(EmptyShell Empty)
Build an empty expression.
SourceLocation getOpLoc() const
void setIsaMemberLoc(SourceLocation L)
static bool classof(const Stmt *T)
SourceLocation getBaseLocEnd() const LLVM_READONLY
void setOpLoc(SourceLocation L)
SourceLocation getExprLoc() const LLVM_READONLY
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCIsaExpr(Expr *base, bool isarrow, SourceLocation l, SourceLocation oploc, QualType ty)
ObjCIvarDecl - Represents an ObjC instance variable.
SourceLocation getBeginLoc() const LLVM_READONLY
SourceLocation getLocation() const
SourceLocation getOpLoc() const
void setDecl(ObjCIvarDecl *d)
ObjCIvarRefExpr(EmptyShell Empty)
void setIsFreeIvar(bool A)
void setOpLoc(SourceLocation L)
SourceLocation getEndLoc() const LLVM_READONLY
const_child_range children() const
const ObjCIvarDecl * getDecl() const
const Expr * getBase() const
void setLocation(SourceLocation L)
static bool classof(const Stmt *T)
ObjCIvarRefExpr(ObjCIvarDecl *d, QualType t, SourceLocation l, SourceLocation oploc, Expr *base, bool arrow=false, bool freeIvar=false)
const Expr * getArg(unsigned Arg) const
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
bool isImplicit() const
Indicates whether the message send was implicitly generated by the implementation.
llvm::iterator_range< const_arg_iterator > arguments() const
static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)
Create an empty Objective-C message expression, to be filled in by subsequent calls.
void setMethodDecl(ObjCMethodDecl *MD)
Expr ** getArgs()
Retrieve the arguments to this message, not including the receiver.
bool isDelegateInitCall() const
isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call",...
ObjCMethodDecl * getMethodDecl()
void setClassReceiver(TypeSourceInfo *TSInfo)
void setInstanceReceiver(Expr *rec)
Turn this message send into an instance message that computes the receiver object with the given expr...
const_arg_iterator arg_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)
SourceLocation getLeftLoc() const
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
QualType getCallReturnType(ASTContext &Ctx) const
SourceLocation getSuperLoc() const
Retrieve the location of the 'super' keyword for a class or instance message to 'super',...
ObjCMethodFamily getMethodFamily() const
Selector getSelector() const
ReceiverKind
The kind of receiver this message is sending to.
@ SuperInstance
The receiver is the instance of the superclass object.
@ Instance
The receiver is an object instance.
@ SuperClass
The receiver is a superclass.
@ Class
The receiver is a class.
ConstExprIterator const_arg_iterator
TypeSourceInfo * getClassReceiverTypeInfo() const
Returns a type-source information of a class message send, or nullptr if the message is not a class m...
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
void setDelegateInitCall(bool isDelegate)
bool isInstanceMessage() const
Determine whether this is an instance message to either a computed object or to super.
llvm::iterator_range< arg_iterator > arguments()
ObjCInterfaceDecl * getReceiverInterface() const
Retrieve the Objective-C interface to which this message is being directed, if known.
QualType getSuperType() const
Retrieve the type referred to by 'super'.
const ObjCMethodDecl * getMethodDecl() const
SourceRange getReceiverRange() const
Source range of the receiver.
bool isClassMessage() const
Determine whether this is an class message to either a specified class or to super.
const Expr * getInstanceReceiver() const
unsigned getNumSelectorLocs() const
const Expr *const * getArgs() const
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
SourceLocation getEndLoc() const LLVM_READONLY
QualType getReceiverType() const
Retrieve the receiver type to which this message is being directed.
SourceLocation getSelectorLoc(unsigned Index) const
ExprIterator arg_iterator
SourceLocation getSelectorStartLoc() const
friend class ASTStmtWriter
static bool classof(const Stmt *T)
void setSourceRange(SourceRange R)
SourceLocation getRightLoc() const
unsigned getNumArgs() const
Return the number of actual arguments in this message, not counting the receiver.
friend class ASTStmtReader
std::pair< const NamedDecl *, const WarnUnusedResultAttr * > getUnusedResultAttr(ASTContext &Ctx) const
Returns the WarnUnusedResultAttr that is declared on the callee or its return type declaration,...
void setSelector(Selector S)
bool hasUnusedResultAttr(ASTContext &Ctx) const
Returns true if this message send should warn on unused results.
void setArg(unsigned Arg, Expr *ArgExpr)
setArg - Set the specified argument.
const_arg_iterator arg_begin() const
ObjCMethodDecl - Represents an instance or class method declaration.
Selector getSelector() const
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
void setExpressibleAsConstantInitializer(bool ExpressibleAsConstantInitializer)
ObjCObjectLiteral(StmtClass SC, QualType T, bool ExpressibleAsConstantInitializer, ExprValueKind VK, ExprObjectKind OK)
bool isGlobalAllocation() const
ObjCObjectLiteral(StmtClass SC, EmptyShell Empty)
bool isExpressibleAsConstantInitializer() const
static bool classof(const Stmt *T)
Represents one property declaration in an Objective-C interface.
Selector getSetterName() const
Selector getGetterName() const
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
ObjCPropertyDecl * getExplicitProperty() const
Selector getSetterSelector() const
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
ObjCMethodDecl * getImplicitPropertyGetter() const
ObjCPropertyRefExpr(ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation IdLoc, SourceLocation ReceiverLoc, ObjCInterfaceDecl *Receiver)
ObjCPropertyRefExpr(ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation IdLoc, Expr *Base)
void setIsMessagingSetter(bool val=true)
SourceLocation getReceiverLocation() const
const Expr * getBase() const
const_child_range children() const
static bool classof(const Stmt *T)
bool isObjectReceiver() const
bool isExplicitProperty() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setIsMessagingGetter(bool val=true)
QualType getSuperReceiverType() const
bool isImplicitProperty() const
SourceLocation getEndLoc() const LLVM_READONLY
ObjCMethodDecl * getImplicitPropertySetter() const
ObjCInterfaceDecl * getClassReceiver() const
SourceLocation getLocation() const
ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, Expr *base)
friend class ASTStmtWriter
ObjCPropertyRefExpr(ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation IdLoc, SourceLocation SuperLoc, QualType SuperTy)
Selector getGetterSelector() const
friend class ASTStmtReader
ObjCPropertyRefExpr(EmptyShell Empty)
QualType getReceiverType(const ASTContext &ctx) const
Determine the type of the base, regardless of the kind of receiver.
ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, SourceLocation sl, QualType st)
bool isClassReceiver() const
bool isSuperReceiver() const
Represents an Objective-C protocol declaration.
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCProtocolDecl * getProtocol() const
ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol, SourceLocation at, SourceLocation protoLoc, SourceLocation rp)
SourceLocation getProtocolIdLoc() const
const_child_range children() const
void setProtocol(ObjCProtocolDecl *P)
void setRParenLoc(SourceLocation L)
void setAtLoc(SourceLocation L)
SourceLocation getRParenLoc() const
static bool classof(const Stmt *T)
SourceLocation getAtLoc() const
friend class ASTStmtWriter
ObjCProtocolExpr(EmptyShell Empty)
friend class ASTStmtReader
SourceLocation getEndLoc() const LLVM_READONLY
static bool classof(const Stmt *T)
SourceLocation getBeginLoc() const LLVM_READONLY
void setSelector(Selector S)
SourceLocation getSelectorNameLoc() const
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
ObjCSelectorExpr(EmptyShell Empty)
void setAtLoc(SourceLocation L)
SourceLocation getRParenLoc() const
const_child_range children() const
Selector getSelector() const
SourceLocation getEndLoc() const LLVM_READONLY
ObjCSelectorExpr(QualType T, Selector selInfo, SourceLocation at, SourceLocation selNameLoc, SourceLocation rp)
void setSelectorNameLoc(SourceLocation L)
void setRParenLoc(SourceLocation L)
SourceLocation getAtLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
const StringLiteral * getString() const
SourceLocation getAtLoc() const
void setAtLoc(SourceLocation L)
void setString(StringLiteral *S)
const_child_range children() const
ObjCStringLiteral(EmptyShell Empty)
static bool classof(const Stmt *T)
StringLiteral * getString()
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCStringLiteral(StringLiteral *SL, QualType T, SourceLocation L)
SourceLocation getBeginLoc() const LLVM_READONLY
Expr * getKeyExpr() const
SourceLocation getEndLoc() const LLVM_READONLY
void setRBracket(SourceLocation RB)
bool isArraySubscriptRefExpr() const
ObjCSubscriptRefExpr(EmptyShell Empty)
ObjCSubscriptRefExpr(Expr *base, Expr *key, QualType T, ExprValueKind VK, ExprObjectKind OK, ObjCMethodDecl *getMethod, ObjCMethodDecl *setMethod, SourceLocation RB)
static bool classof(const Stmt *T)
void setBaseExpr(Stmt *S)
Expr * getBaseExpr() const
const_child_range children() const
friend class ASTStmtReader
ObjCMethodDecl * getAtIndexMethodDecl() const
SourceLocation getRBracket() const
ObjCMethodDecl * setAtIndexMethodDecl() const
A (possibly-)qualified type.
static QualType getFromOpaquePtr(const void *Ptr)
Smart pointer class that efficiently represents Objective-C method names.
void * getAsOpaquePtr() const
ObjCMethodFamily getMethodFamily() const
Derive the conventional family of this method.
bool isUnarySelector() const
unsigned getNumArgs() const
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
SourceLocation getEndLoc() const LLVM_READONLY
ObjCObjectLiteralBitfields ObjCObjectLiteralBits
StmtIterator child_iterator
Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...
StmtClass getStmtClass() const
ConstCastIterator< Expr > ConstExprIterator
llvm::iterator_range< child_iterator > child_range
ConstStmtIterator const_child_iterator
ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits
SourceLocation getBeginLoc() const LLVM_READONLY
llvm::iterator_range< const_child_iterator > const_child_range
CastIterator< Expr > ExprIterator
StringLiteral - This represents a string literal expression, e.g.
A container of type source information.
bool isSpecificPlaceholderType(unsigned K) const
Test for a specific placeholder type.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
@ SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
@ SelLoc_NonStandard
Non-standard.
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
@ OK_Ordinary
An ordinary object is located at an address in memory.
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
ExprDependence computeDependence(FullExpr *E)
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
ObjCMethodFamily
A family of Objective-C methods.
@ Result
The result type of a method or function.
OptionalUnsigned< unsigned > UnsignedOrNone
const FunctionProtoType * T
ObjCBridgeCastKind
The kind of bridging performed by the Objective-C bridge cast.
CastKind
CastKind - The kind of operation required for a conversion.
SourceLocation getStandardSelectorLoc(unsigned Index, Selector Sel, bool WithArgSpace, ArrayRef< Expr * > Args, SourceLocation EndLoc)
Get the "standard" location of a selector identifier, e.g: For nullary selectors, immediately before ...
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
U cast(CodeGen::Address addr)
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
An element in an Objective-C dictionary literal.
Expr * Value
The value of the dictionary element.
bool isPackExpansion() const
Determines whether this dictionary element is a pack expansion.
SourceLocation EllipsisLoc
The location of the ellipsis, if this is a pack expansion.
UnsignedOrNone NumExpansions
The number of elements this pack expansion will expand to, if this is a pack expansion and is known.
Expr * Key
The key for the dictionary element.
Internal struct to describes an element that is a pack expansion, used if any of the elements in the ...
SourceLocation EllipsisLoc
The location of the ellipsis, if this element is a pack expansion.
unsigned NumExpansionsPlusOne
If non-zero, the number of elements that this pack expansion will expand to (+1).
Internal struct for storing Key/value pair.
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....