Clang Project

clang_source_code/include/clang/AST/ExprObjC.h
1//===- ExprObjC.h - Classes for representing ObjC expressions ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//  This file defines the ExprObjC interface and subclasses.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_AST_EXPROBJC_H
14#define LLVM_CLANG_AST_EXPROBJC_H
15
16#include "clang/AST/Decl.h"
17#include "clang/AST/DeclObjC.h"
18#include "clang/AST/Expr.h"
19#include "clang/AST/OperationKinds.h"
20#include "clang/AST/SelectorLocationsKind.h"
21#include "clang/AST/Stmt.h"
22#include "clang/AST/Type.h"
23#include "clang/Basic/IdentifierTable.h"
24#include "clang/Basic/LLVM.h"
25#include "clang/Basic/SourceLocation.h"
26#include "clang/Basic/Specifiers.h"
27#include "llvm/ADT/ArrayRef.h"
28#include "llvm/ADT/None.h"
29#include "llvm/ADT/Optional.h"
30#include "llvm/ADT/PointerIntPair.h"
31#include "llvm/ADT/PointerUnion.h"
32#include "llvm/ADT/StringRef.h"
33#include "llvm/ADT/iterator_range.h"
34#include "llvm/Support/Casting.h"
35#include "llvm/Support/Compiler.h"
36#include "llvm/Support/TrailingObjects.h"
37#include "llvm/Support/VersionTuple.h"
38#include "llvm/Support/type_traits.h"
39#include <cassert>
40#include <cstddef>
41#include <cstdint>
42
43namespace clang {
44
45class ASTContext;
46class CXXBaseSpecifier;
47
48/// ObjCStringLiteral, used for Objective-C string literals
49/// i.e. @"foo".
50class ObjCStringLiteral : public Expr {
51  Stmt *String;
52  SourceLocation AtLoc;
53
54public:
55  ObjCStringLiteral(StringLiteral *SLQualType TSourceLocation L)
56      : Expr(ObjCStringLiteralClass, T, VK_RValue, OK_Ordinary, falsefalse,
57             falsefalse),
58        String(SL), AtLoc(L) {}
59  explicit ObjCStringLiteral(EmptyShell Empty)
60      : Expr(ObjCStringLiteralClass, Empty) {}
61
62  StringLiteral *getString() { return cast<StringLiteral>(String); }
63  const StringLiteral *getString() const { return cast<StringLiteral>(String); }
64  void setString(StringLiteral *S) { String = S; }
65
66  SourceLocation getAtLoc() const { return AtLoc; }
67  void setAtLoc(SourceLocation L) { AtLoc = L; }
68
69  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
70  SourceLocation getEndLoc() const LLVM_READONLY { return String->getEndLoc(); }
71
72  // Iterators
73  child_range children() { return child_range(&String, &String+1); }
74
75  static bool classof(const Stmt *T) {
76    return T->getStmtClass() == ObjCStringLiteralClass;
77  }
78};
79
80/// ObjCBoolLiteralExpr - Objective-C Boolean Literal.
81class ObjCBoolLiteralExpr : public Expr {
82  bool Value;
83  SourceLocation Loc;
84
85public:
86  ObjCBoolLiteralExpr(bool valQualType TySourceLocation l)
87      : Expr(ObjCBoolLiteralExprClass, Ty, VK_RValue, OK_Ordinary, falsefalse,
88             falsefalse),
89        Value(val), Loc(l) {}
90  explicit ObjCBoolLiteralExpr(EmptyShell Empty)
91      : Expr(ObjCBoolLiteralExprClass, Empty) {}
92
93  bool getValue() const { return Value; }
94  void setValue(bool V) { Value = V; }
95
96  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
97  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
98
99  SourceLocation getLocation() const { return Loc; }
100  void setLocation(SourceLocation L) { Loc = L; }
101
102  // Iterators
103  child_range children() {
104    return child_range(child_iterator(), child_iterator());
105  }
106
107  static bool classof(const Stmt *T) {
108    return T->getStmtClass() == ObjCBoolLiteralExprClass;
109  }
110};
111
112/// ObjCBoxedExpr - used for generalized expression boxing.
113/// as in: @(strdup("hello world")), @(random()) or @(view.frame)
114/// Also used for boxing non-parenthesized numeric literals;
115/// as in: @42 or \@true (c++/objc++) or \@__objc_yes (c/objc).
116class ObjCBoxedExpr : public Expr {
117  Stmt *SubExpr;
118  ObjCMethodDecl *BoxingMethod;
119  SourceRange Range;
120
121public:
122  friend class ASTStmtReader;
123
124  ObjCBoxedExpr(Expr *EQualType TObjCMethodDecl *method,
125                     SourceRange R)
126      : Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary,
127             E->isTypeDependent(), E->isValueDependent(),
128             E->isInstantiationDependent(),
129             E->containsUnexpandedParameterPack()),
130        SubExpr(E), BoxingMethod(method), Range(R) {}
131  explicit ObjCBoxedExpr(EmptyShell Empty)
132      : Expr(ObjCBoxedExprClass, Empty) {}
133
134  Expr *getSubExpr() { return cast<Expr>(SubExpr); }
135  const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
136
137  ObjCMethodDecl *getBoxingMethod() const {
138    return BoxingMethod;
139  }
140
141  // Indicates whether this boxed expression can be emitted as a compile-time
142  // constant.
143  bool isExpressibleAsConstantInitializer() const {
144    return !BoxingMethod && SubExpr;
145  }
146
147  SourceLocation getAtLoc() const { return Range.getBegin(); }
148
149  SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
150  SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
151
152  SourceRange getSourceRange() const LLVM_READONLY {
153    return Range;
154  }
155
156  // Iterators
157  child_range children() { return child_range(&SubExpr, &SubExpr+1); }
158
159  using const_arg_iterator = ConstExprIterator;
160
161  const_arg_iterator arg_begin() const {
162    return reinterpret_cast<Stmt const * const*>(&SubExpr);
163  }
164
165  const_arg_iterator arg_end() const {
166    return reinterpret_cast<Stmt const * const*>(&SubExpr + 1);
167  }
168
169  static bool classof(const Stmt *T) {
170    return T->getStmtClass() == ObjCBoxedExprClass;
171  }
172};
173
174/// ObjCArrayLiteral - used for objective-c array containers; as in:
175/// @[@"Hello", NSApp, [NSNumber numberWithInt:42]];
176class ObjCArrayLiteral final
177    : public Expr,
178      private llvm::TrailingObjects<ObjCArrayLiteral, Expr *> {
179  unsigned NumElements;
180  SourceRange Range;
181  ObjCMethodDecl *ArrayWithObjectsMethod;
182
183  ObjCArrayLiteral(ArrayRef<Expr *> Elements,
184                   QualType TObjCMethodDecl * Method,
185                   SourceRange SR);
186
187  explicit ObjCArrayLiteral(EmptyShell Emptyunsigned NumElements)
188      : Expr(ObjCArrayLiteralClass, Empty), NumElements(NumElements) {}
189
190public:
191  friend class ASTStmtReader;
192  friend TrailingObjects;
193
194  static ObjCArrayLiteral *Create(const ASTContext &C,
195                                  ArrayRef<Expr *> Elements,
196                                  QualType TObjCMethodDecl * Method,
197                                  SourceRange SR);
198
199  static ObjCArrayLiteral *CreateEmpty(const ASTContext &C,
200                                       unsigned NumElements);
201
202  SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
203  SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
204  SourceRange getSourceRange() const LLVM_READONLY { return Range; }
205
206  /// Retrieve elements of array of literals.
207  Expr **getElements() { return getTrailingObjects<Expr *>(); }
208
209  /// Retrieve elements of array of literals.
210  const Expr * const *getElements() const {
211    return getTrailingObjects<Expr *>();
212  }
213
214  /// getNumElements - Return number of elements of objective-c array literal.
215  unsigned getNumElements() const { return NumElements; }
216
217  /// getElement - Return the Element at the specified index.
218  Expr *getElement(unsigned Index) {
219     (0) . __assert_fail ("(Index < NumElements) && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 219, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Index < NumElements) && "Arg access out of range!");
220    return getElements()[Index];
221  }
222  const Expr *getElement(unsigned Index) const {
223     (0) . __assert_fail ("(Index < NumElements) && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 223, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Index < NumElements) && "Arg access out of range!");
224    return getElements()[Index];
225  }
226
227  ObjCMethodDecl *getArrayWithObjectsMethod() const {
228    return ArrayWithObjectsMethod;
229  }
230
231  // Iterators
232  child_range children() {
233    return child_range(reinterpret_cast<Stmt **>(getElements()),
234                       reinterpret_cast<Stmt **>(getElements()) + NumElements);
235  }
236
237  static bool classof(const Stmt *T) {
238      return T->getStmtClass() == ObjCArrayLiteralClass;
239  }
240};
241
242/// An element in an Objective-C dictionary literal.
243///
244struct ObjCDictionaryElement {
245  /// The key for the dictionary element.
246  Expr *Key;
247
248  /// The value of the dictionary element.
249  Expr *Value;
250
251  /// The location of the ellipsis, if this is a pack expansion.
252  SourceLocation EllipsisLoc;
253
254  /// The number of elements this pack expansion will expand to, if
255  /// this is a pack expansion and is known.
256  Optional<unsignedNumExpansions;
257
258  /// Determines whether this dictionary element is a pack expansion.
259  bool isPackExpansion() const { return EllipsisLoc.isValid(); }
260};
261
262// namespace clang
263
264namespace clang {
265
266/// Internal struct for storing Key/value pair.
267struct ObjCDictionaryLiteral_KeyValuePair {
268  Expr *Key;
269  Expr *Value;
270};
271
272/// Internal struct to describes an element that is a pack
273/// expansion, used if any of the elements in the dictionary literal
274/// are pack expansions.
275struct ObjCDictionaryLiteral_ExpansionData {
276  /// The location of the ellipsis, if this element is a pack
277  /// expansion.
278  SourceLocation EllipsisLoc;
279
280  /// If non-zero, the number of elements that this pack
281  /// expansion will expand to (+1).
282  unsigned NumExpansionsPlusOne;
283};
284
285/// ObjCDictionaryLiteral - AST node to represent objective-c dictionary
286/// literals; as in:  @{@"name" : NSUserName(), @"date" : [NSDate date] };
287class ObjCDictionaryLiteral final
288    : public Expr,
289      private llvm::TrailingObjects<ObjCDictionaryLiteral,
290                                    ObjCDictionaryLiteral_KeyValuePair,
291                                    ObjCDictionaryLiteral_ExpansionData> {
292  /// The number of elements in this dictionary literal.
293  unsigned NumElements : 31;
294
295  /// Determine whether this dictionary literal has any pack expansions.
296  ///
297  /// If the dictionary literal has pack expansions, then there will
298  /// be an array of pack expansion data following the array of
299  /// key/value pairs, which provide the locations of the ellipses (if
300  /// any) and number of elements in the expansion (if known). If
301  /// there are no pack expansions, we optimize away this storage.
302  unsigned HasPackExpansions : 1;
303
304  SourceRange Range;
305  ObjCMethodDecl *DictWithObjectsMethod;
306
307  using KeyValuePair = ObjCDictionaryLiteral_KeyValuePair;
308  using ExpansionData = ObjCDictionaryLiteral_ExpansionData;
309
310  ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElementVK,
311                        bool HasPackExpansions,
312                        QualType TObjCMethodDecl *method,
313                        SourceRange SR);
314
315  explicit ObjCDictionaryLiteral(EmptyShell Emptyunsigned NumElements,
316                                 bool HasPackExpansions)
317      : Expr(ObjCDictionaryLiteralClass, Empty), NumElements(NumElements),
318        HasPackExpansions(HasPackExpansions) {}
319
320  size_t numTrailingObjects(OverloadToken<KeyValuePair>) const {
321    return NumElements;
322  }
323
324public:
325  friend class ASTStmtReader;
326  friend class ASTStmtWriter;
327  friend TrailingObjects;
328
329  static ObjCDictionaryLiteral *Create(const ASTContext &C,
330                                       ArrayRef<ObjCDictionaryElementVK,
331                                       bool HasPackExpansions,
332                                       QualType TObjCMethodDecl *method,
333                                       SourceRange SR);
334
335  static ObjCDictionaryLiteral *CreateEmpty(const ASTContext &C,
336                                            unsigned NumElements,
337                                            bool HasPackExpansions);
338
339  /// getNumElements - Return number of elements of objective-c dictionary
340  /// literal.
341  unsigned getNumElements() const { return NumElements; }
342
343  ObjCDictionaryElement getKeyValueElement(unsigned Indexconst {
344     (0) . __assert_fail ("(Index < NumElements) && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 344, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Index < NumElements) && "Arg access out of range!");
345    const KeyValuePair &KV = getTrailingObjects<KeyValuePair>()[Index];
346    ObjCDictionaryElement Result = { KV.Key, KV.Value, SourceLocation(), None };
347    if (HasPackExpansions) {
348      const ExpansionData &Expansion =
349          getTrailingObjects<ExpansionData>()[Index];
350      Result.EllipsisLoc = Expansion.EllipsisLoc;
351      if (Expansion.NumExpansionsPlusOne > 0)
352        Result.NumExpansions = Expansion.NumExpansionsPlusOne - 1;
353    }
354    return Result;
355  }
356
357  ObjCMethodDecl *getDictWithObjectsMethod() const {
358    return DictWithObjectsMethod;
359  }
360
361  SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
362  SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
363  SourceRange getSourceRange() const LLVM_READONLY { return Range; }
364
365  // Iterators
366  child_range children() {
367    // Note: we're taking advantage of the layout of the KeyValuePair struct
368    // here. If that struct changes, this code will need to change as well.
369    static_assert(sizeof(KeyValuePair) == sizeof(Stmt *) * 2,
370                  "KeyValuePair is expected size");
371    return child_range(
372        reinterpret_cast<Stmt **>(getTrailingObjects<KeyValuePair>()),
373        reinterpret_cast<Stmt **>(getTrailingObjects<KeyValuePair>()) +
374            NumElements * 2);
375  }
376
377  static bool classof(const Stmt *T) {
378    return T->getStmtClass() == ObjCDictionaryLiteralClass;
379  }
380};
381
382/// ObjCEncodeExpr, used for \@encode in Objective-C.  \@encode has the same
383/// type and behavior as StringLiteral except that the string initializer is
384/// obtained from ASTContext with the encoding type as an argument.
385class ObjCEncodeExpr : public Expr {
386  TypeSourceInfo *EncodedType;
387  SourceLocation AtLocRParenLoc;
388
389public:
390  ObjCEncodeExpr(QualType TTypeSourceInfo *EncodedType,
391                 SourceLocation atSourceLocation rp)
392      : Expr(ObjCEncodeExprClass, T, VK_LValue, OK_Ordinary,
393             EncodedType->getType()->isDependentType(),
394             EncodedType->getType()->isDependentType(),
395             EncodedType->getType()->isInstantiationDependentType(),
396             EncodedType->getType()->containsUnexpandedParameterPack()),
397        EncodedType(EncodedType), AtLoc(at), RParenLoc(rp) {}
398
399  explicit ObjCEncodeExpr(EmptyShell Empty) : Expr(ObjCEncodeExprClass, Empty){}
400
401  SourceLocation getAtLoc() const { return AtLoc; }
402  void setAtLoc(SourceLocation L) { AtLoc = L; }
403  SourceLocation getRParenLoc() const { return RParenLoc; }
404  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
405
406  QualType getEncodedType() const { return EncodedType->getType(); }
407
408  TypeSourceInfo *getEncodedTypeSourceInfo() const { return EncodedType; }
409
410  void setEncodedTypeSourceInfo(TypeSourceInfo *EncType) {
411    EncodedType = EncType;
412  }
413
414  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
415  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
416
417  // Iterators
418  child_range children() {
419    return child_range(child_iterator(), child_iterator());
420  }
421
422  static bool classof(const Stmt *T) {
423    return T->getStmtClass() == ObjCEncodeExprClass;
424  }
425};
426
427/// ObjCSelectorExpr used for \@selector in Objective-C.
428class ObjCSelectorExpr : public Expr {
429  Selector SelName;
430  SourceLocation AtLocRParenLoc;
431
432public:
433  ObjCSelectorExpr(QualType TSelector selInfo,
434                   SourceLocation atSourceLocation rp)
435      : Expr(ObjCSelectorExprClass, T, VK_RValue, OK_Ordinary, falsefalse,
436             falsefalse),
437        SelName(selInfo), AtLoc(at), RParenLoc(rp) {}
438  explicit ObjCSelectorExpr(EmptyShell Empty)
439      : Expr(ObjCSelectorExprClass, Empty) {}
440
441  Selector getSelector() const { return SelName; }
442  void setSelector(Selector S) { SelName = S; }
443
444  SourceLocation getAtLoc() const { return AtLoc; }
445  SourceLocation getRParenLoc() const { return RParenLoc; }
446  void setAtLoc(SourceLocation L) { AtLoc = L; }
447  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
448
449  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
450  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
451
452  /// getNumArgs - Return the number of actual arguments to this call.
453  unsigned getNumArgs() const { return SelName.getNumArgs(); }
454
455  // Iterators
456  child_range children() {
457    return child_range(child_iterator(), child_iterator());
458  }
459
460  static bool classof(const Stmt *T) {
461    return T->getStmtClass() == ObjCSelectorExprClass;
462  }
463};
464
465/// ObjCProtocolExpr used for protocol expression in Objective-C.
466///
467/// This is used as: \@protocol(foo), as in:
468/// \code
469///   [obj conformsToProtocol:@protocol(foo)]
470/// \endcode
471///
472/// The return type is "Protocol*".
473class ObjCProtocolExpr : public Expr {
474  ObjCProtocolDecl *TheProtocol;
475  SourceLocation AtLocProtoLocRParenLoc;
476
477public:
478  friend class ASTStmtReader;
479  friend class ASTStmtWriter;
480
481  ObjCProtocolExpr(QualType TObjCProtocolDecl *protocol,
482                 SourceLocation atSourceLocation protoLocSourceLocation rp)
483      : Expr(ObjCProtocolExprClass, T, VK_RValue, OK_Ordinary, falsefalse,
484             falsefalse),
485        TheProtocol(protocol), AtLoc(at), ProtoLoc(protoLoc), RParenLoc(rp) {}
486  explicit ObjCProtocolExpr(EmptyShell Empty)
487      : Expr(ObjCProtocolExprClass, Empty) {}
488
489  ObjCProtocolDecl *getProtocol() const { return TheProtocol; }
490  void setProtocol(ObjCProtocolDecl *P) { TheProtocol = P; }
491
492  SourceLocation getProtocolIdLoc() const { return ProtoLoc; }
493  SourceLocation getAtLoc() const { return AtLoc; }
494  SourceLocation getRParenLoc() const { return RParenLoc; }
495  void setAtLoc(SourceLocation L) { AtLoc = L; }
496  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
497
498  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
499  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
500
501  // Iterators
502  child_range children() {
503    return child_range(child_iterator(), child_iterator());
504  }
505
506  static bool classof(const Stmt *T) {
507    return T->getStmtClass() == ObjCProtocolExprClass;
508  }
509};
510
511/// ObjCIvarRefExpr - A reference to an ObjC instance variable.
512class ObjCIvarRefExpr : public Expr {
513  ObjCIvarDecl *D;
514  Stmt *Base;
515  SourceLocation Loc;
516
517  /// OpLoc - This is the location of '.' or '->'
518  SourceLocation OpLoc;
519
520  // True if this is "X->F", false if this is "X.F".
521  bool IsArrow : 1;
522
523  // True if ivar reference has no base (self assumed).
524  bool IsFreeIvar : 1;
525
526public:
527  ObjCIvarRefExpr(ObjCIvarDecl *dQualType t,
528                  SourceLocation lSourceLocation oploc,
529                  Expr *base,
530                  bool arrow = falsebool freeIvar = false)
531      : Expr(ObjCIvarRefExprClass, t, VK_LValue,
532             d->isBitField() ? OK_BitField : OK_Ordinary,
533             /*TypeDependent=*/false, base->isValueDependent(),
534             base->isInstantiationDependent(),
535             base->containsUnexpandedParameterPack()),
536        D(d), Base(base), Loc(l), OpLoc(oploc), IsArrow(arrow),
537        IsFreeIvar(freeIvar) {}
538
539  explicit ObjCIvarRefExpr(EmptyShell Empty)
540      : Expr(ObjCIvarRefExprClass, Empty) {}
541
542  ObjCIvarDecl *getDecl() { return D; }
543  const ObjCIvarDecl *getDecl() const { return D; }
544  void setDecl(ObjCIvarDecl *d) { D = d; }
545
546  const Expr *getBase() const { return cast<Expr>(Base); }
547  Expr *getBase() { return cast<Expr>(Base); }
548  void setBase(Expr * base) { Base = base; }
549
550  bool isArrow() const { return IsArrow; }
551  bool isFreeIvar() const { return IsFreeIvar; }
552  void setIsArrow(bool A) { IsArrow = A; }
553  void setIsFreeIvar(bool A) { IsFreeIvar = A; }
554
555  SourceLocation getLocation() const { return Loc; }
556  void setLocation(SourceLocation L) { Loc = L; }
557
558  SourceLocation getBeginLoc() const LLVM_READONLY {
559    return isFreeIvar() ? Loc : getBase()->getBeginLoc();
560  }
561  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
562
563  SourceLocation getOpLoc() const { return OpLoc; }
564  void setOpLoc(SourceLocation L) { OpLoc = L; }
565
566  // Iterators
567  child_range children() { return child_range(&Base, &Base+1); }
568
569  static bool classof(const Stmt *T) {
570    return T->getStmtClass() == ObjCIvarRefExprClass;
571  }
572};
573
574/// ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC
575/// property.
576class ObjCPropertyRefExpr : public Expr {
577private:
578  /// If the bool is true, this is an implicit property reference; the
579  /// pointer is an (optional) ObjCMethodDecl and Setter may be set.
580  /// if the bool is false, this is an explicit property reference;
581  /// the pointer is an ObjCPropertyDecl and Setter is always null.
582  llvm::PointerIntPair<NamedDecl *, 1boolPropertyOrGetter;
583
584  /// Indicates whether the property reference will result in a message
585  /// to the getter, the setter, or both.
586  /// This applies to both implicit and explicit property references.
587  enum MethodRefFlags {
588    MethodRef_None = 0,
589    MethodRef_Getter = 0x1,
590    MethodRef_Setter = 0x2
591  };
592
593  /// Contains the Setter method pointer and MethodRefFlags bit flags.
594  llvm::PointerIntPair<ObjCMethodDecl *, 2unsignedSetterAndMethodRefFlags;
595
596  // FIXME: Maybe we should store the property identifier here,
597  // because it's not rederivable from the other data when there's an
598  // implicit property with no getter (because the 'foo' -> 'setFoo:'
599  // transformation is lossy on the first character).
600
601  SourceLocation IdLoc;
602
603  /// When the receiver in property access is 'super', this is
604  /// the location of the 'super' keyword.  When it's an interface,
605  /// this is that interface.
606  SourceLocation ReceiverLoc;
607  llvm::PointerUnion3<Stmt *, const Type *, ObjCInterfaceDecl *> Receiver;
608
609public:
610  ObjCPropertyRefExpr(ObjCPropertyDecl *PDQualType t,
611                      ExprValueKind VKExprObjectKind OK,
612                      SourceLocation lExpr *base)
613      : Expr(ObjCPropertyRefExprClass, t, VK, OK,
614             /*TypeDependent=*/false, base->isValueDependent(),
615             base->isInstantiationDependent(),
616             base->containsUnexpandedParameterPack()),
617        PropertyOrGetter(PD, false), IdLoc(l), Receiver(base) {
618    isSpecificPlaceholderType(BuiltinType..PseudoObject)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 618, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(t->isSpecificPlaceholderType(BuiltinType::PseudoObject));
619  }
620
621  ObjCPropertyRefExpr(ObjCPropertyDecl *PDQualType t,
622                      ExprValueKind VKExprObjectKind OK,
623                      SourceLocation lSourceLocation slQualType st)
624      : Expr(ObjCPropertyRefExprClass, t, VK, OK,
625             /*TypeDependent=*/falsefalse, st->isInstantiationDependentType(),
626             st->containsUnexpandedParameterPack()),
627        PropertyOrGetter(PD, false), IdLoc(l), ReceiverLoc(sl),
628        Receiver(st.getTypePtr()) {
629    isSpecificPlaceholderType(BuiltinType..PseudoObject)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 629, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(t->isSpecificPlaceholderType(BuiltinType::PseudoObject));
630  }
631
632  ObjCPropertyRefExpr(ObjCMethodDecl *GetterObjCMethodDecl *Setter,
633                      QualType TExprValueKind VKExprObjectKind OK,
634                      SourceLocation IdLocExpr *Base)
635      : Expr(ObjCPropertyRefExprClass, T, VK, OK, false,
636             Base->isValueDependent(), Base->isInstantiationDependent(),
637             Base->containsUnexpandedParameterPack()),
638        PropertyOrGetter(Getter, true), SetterAndMethodRefFlags(Setter, 0),
639        IdLoc(IdLoc), Receiver(Base) {
640    isSpecificPlaceholderType(BuiltinType..PseudoObject)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 640, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(T->isSpecificPlaceholderType(BuiltinType::PseudoObject));
641  }
642
643  ObjCPropertyRefExpr(ObjCMethodDecl *GetterObjCMethodDecl *Setter,
644                      QualType TExprValueKind VKExprObjectKind OK,
645                      SourceLocation IdLoc,
646                      SourceLocation SuperLocQualType SuperTy)
647      : Expr(ObjCPropertyRefExprClass, T, VK, OK, falsefalsefalsefalse),
648        PropertyOrGetter(Getter, true), SetterAndMethodRefFlags(Setter, 0),
649        IdLoc(IdLoc), ReceiverLoc(SuperLoc), Receiver(SuperTy.getTypePtr()) {
650    isSpecificPlaceholderType(BuiltinType..PseudoObject)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 650, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(T->isSpecificPlaceholderType(BuiltinType::PseudoObject));
651  }
652
653  ObjCPropertyRefExpr(ObjCMethodDecl *GetterObjCMethodDecl *Setter,
654                      QualType TExprValueKind VKExprObjectKind OK,
655                      SourceLocation IdLoc,
656                      SourceLocation ReceiverLocObjCInterfaceDecl *Receiver)
657      : Expr(ObjCPropertyRefExprClass, T, VK, OK, falsefalsefalsefalse),
658        PropertyOrGetter(Getter, true), SetterAndMethodRefFlags(Setter, 0),
659        IdLoc(IdLoc), ReceiverLoc(ReceiverLoc), Receiver(Receiver) {
660    isSpecificPlaceholderType(BuiltinType..PseudoObject)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 660, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(T->isSpecificPlaceholderType(BuiltinType::PseudoObject));
661  }
662
663  explicit ObjCPropertyRefExpr(EmptyShell Empty)
664      : Expr(ObjCPropertyRefExprClass, Empty) {}
665
666  bool isImplicitProperty() const { return PropertyOrGetter.getInt(); }
667  bool isExplicitProperty() const { return !PropertyOrGetter.getInt(); }
668
669  ObjCPropertyDecl *getExplicitProperty() const {
670    assert(!isImplicitProperty());
671    return cast<ObjCPropertyDecl>(PropertyOrGetter.getPointer());
672  }
673
674  ObjCMethodDecl *getImplicitPropertyGetter() const {
675    assert(isImplicitProperty());
676    return cast_or_null<ObjCMethodDecl>(PropertyOrGetter.getPointer());
677  }
678
679  ObjCMethodDecl *getImplicitPropertySetter() const {
680    assert(isImplicitProperty());
681    return SetterAndMethodRefFlags.getPointer();
682  }
683
684  Selector getGetterSelector() const {
685    if (isImplicitProperty())
686      return getImplicitPropertyGetter()->getSelector();
687    return getExplicitProperty()->getGetterName();
688  }
689
690  Selector getSetterSelector() const {
691    if (isImplicitProperty())
692      return getImplicitPropertySetter()->getSelector();
693    return getExplicitProperty()->getSetterName();
694  }
695
696  /// True if the property reference will result in a message to the
697  /// getter.
698  /// This applies to both implicit and explicit property references.
699  bool isMessagingGetter() const {
700    return SetterAndMethodRefFlags.getInt() & MethodRef_Getter;
701  }
702
703  /// True if the property reference will result in a message to the
704  /// setter.
705  /// This applies to both implicit and explicit property references.
706  bool isMessagingSetter() const {
707    return SetterAndMethodRefFlags.getInt() & MethodRef_Setter;
708  }
709
710  void setIsMessagingGetter(bool val = true) {
711    setMethodRefFlag(MethodRef_Getterval);
712  }
713
714  void setIsMessagingSetter(bool val = true) {
715    setMethodRefFlag(MethodRef_Setterval);
716  }
717
718  const Expr *getBase() const {
719    return cast<Expr>(Receiver.get<Stmt*>());
720  }
721  Expr *getBase() {
722    return cast<Expr>(Receiver.get<Stmt*>());
723  }
724
725  SourceLocation getLocation() const { return IdLoc; }
726
727  SourceLocation getReceiverLocation() const { return ReceiverLoc; }
728
729  QualType getSuperReceiverType() const {
730    return QualType(Receiver.get<const Type*>(), 0);
731  }
732
733  ObjCInterfaceDecl *getClassReceiver() const {
734    return Receiver.get<ObjCInterfaceDecl*>();
735  }
736
737  bool isObjectReceiver() const { return Receiver.is<Stmt*>(); }
738  bool isSuperReceiver() const { return Receiver.is<const Type*>(); }
739  bool isClassReceiver() const { return Receiver.is<ObjCInterfaceDecl*>(); }
740
741  /// Determine the type of the base, regardless of the kind of receiver.
742  QualType getReceiverType(const ASTContext &ctxconst;
743
744  SourceLocation getBeginLoc() const LLVM_READONLY {
745    return isObjectReceiver() ? getBase()->getBeginLoc()
746                              : getReceiverLocation();
747  }
748
749  SourceLocation getEndLoc() const LLVM_READONLY { return IdLoc; }
750
751  // Iterators
752  child_range children() {
753    if (Receiver.is<Stmt*>()) {
754      Stmt **begin = reinterpret_cast<Stmt**>(&Receiver); // hack!
755      return child_range(begin, begin+1);
756    }
757    return child_range(child_iterator(), child_iterator());
758  }
759
760  static bool classof(const Stmt *T) {
761    return T->getStmtClass() == ObjCPropertyRefExprClass;
762  }
763
764private:
765  friend class ASTStmtReader;
766  friend class ASTStmtWriter;
767
768  void setExplicitProperty(ObjCPropertyDecl *Dunsigned methRefFlags) {
769    PropertyOrGetter.setPointer(D);
770    PropertyOrGetter.setInt(false);
771    SetterAndMethodRefFlags.setPointer(nullptr);
772    SetterAndMethodRefFlags.setInt(methRefFlags);
773  }
774
775  void setImplicitProperty(ObjCMethodDecl *GetterObjCMethodDecl *Setter,
776                           unsigned methRefFlags) {
777    PropertyOrGetter.setPointer(Getter);
778    PropertyOrGetter.setInt(true);
779    SetterAndMethodRefFlags.setPointer(Setter);
780    SetterAndMethodRefFlags.setInt(methRefFlags);
781  }
782
783  void setBase(Expr *Base) { Receiver = Base; }
784  void setSuperReceiver(QualType T) { Receiver = T.getTypePtr(); }
785  void setClassReceiver(ObjCInterfaceDecl *D) { Receiver = D; }
786
787  void setLocation(SourceLocation L) { IdLoc = L; }
788  void setReceiverLocation(SourceLocation Loc) { ReceiverLoc = Loc; }
789
790  void setMethodRefFlag(MethodRefFlags flagbool val) {
791    unsigned f = SetterAndMethodRefFlags.getInt();
792    if (val)
793      f |= flag;
794    else
795      f &= ~flag;
796    SetterAndMethodRefFlags.setInt(f);
797  }
798};
799
800/// ObjCSubscriptRefExpr - used for array and dictionary subscripting.
801/// array[4] = array[3]; dictionary[key] = dictionary[alt_key];
802class ObjCSubscriptRefExpr : public Expr {
803  // Location of ']' in an indexing expression.
804  SourceLocation RBracket;
805
806  // array/dictionary base expression.
807  // for arrays, this is a numeric expression. For dictionaries, this is
808  // an objective-c object pointer expression.
809  enum { BASEKEYEND_EXPR };
810  StmtSubExprs[END_EXPR];
811
812  ObjCMethodDecl *GetAtIndexMethodDecl;
813
814  // For immutable objects this is null. When ObjCSubscriptRefExpr is to read
815  // an indexed object this is null too.
816  ObjCMethodDecl *SetAtIndexMethodDecl;
817
818public:
819  ObjCSubscriptRefExpr(Expr *baseExpr *keyQualType T,
820                       ExprValueKind VKExprObjectKind OK,
821                       ObjCMethodDecl *getMethod,
822                       ObjCMethodDecl *setMethodSourceLocation RB)
823      : Expr(ObjCSubscriptRefExprClass, T, VK, OK,
824             base->isTypeDependent() || key->isTypeDependent(),
825             base->isValueDependent() || key->isValueDependent(),
826             (base->isInstantiationDependent() ||
827              key->isInstantiationDependent()),
828             (base->containsUnexpandedParameterPack() ||
829              key->containsUnexpandedParameterPack())),
830        RBracket(RB), GetAtIndexMethodDecl(getMethod),
831        SetAtIndexMethodDecl(setMethod) {
832    SubExprs[BASE] = baseSubExprs[KEY] = key;
833  }
834
835  explicit ObjCSubscriptRefExpr(EmptyShell Empty)
836      : Expr(ObjCSubscriptRefExprClass, Empty) {}
837
838  SourceLocation getRBracket() const { return RBracket; }
839  void setRBracket(SourceLocation RB) { RBracket = RB; }
840
841  SourceLocation getBeginLoc() const LLVM_READONLY {
842    return SubExprs[BASE]->getBeginLoc();
843  }
844
845  SourceLocation getEndLoc() const LLVM_READONLY { return RBracket; }
846
847  Expr *getBaseExpr() const { return cast<Expr>(SubExprs[BASE]); }
848  void setBaseExpr(Stmt *S) { SubExprs[BASE] = S; }
849
850  Expr *getKeyExpr() const { return cast<Expr>(SubExprs[KEY]); }
851  void setKeyExpr(Stmt *S) { SubExprs[KEY] = S; }
852
853  ObjCMethodDecl *getAtIndexMethodDecl() const {
854    return GetAtIndexMethodDecl;
855  }
856
857  ObjCMethodDecl *setAtIndexMethodDecl() const {
858    return SetAtIndexMethodDecl;
859  }
860
861  bool isArraySubscriptRefExpr() const {
862    return getKeyExpr()->getType()->isIntegralOrEnumerationType();
863  }
864
865  child_range children() {
866    return child_range(SubExprs, SubExprs+END_EXPR);
867  }
868
869  static bool classof(const Stmt *T) {
870    return T->getStmtClass() == ObjCSubscriptRefExprClass;
871  }
872
873private:
874  friend class ASTStmtReader;
875};
876
877/// An expression that sends a message to the given Objective-C
878/// object or class.
879///
880/// The following contains two message send expressions:
881///
882/// \code
883///   [[NSString alloc] initWithString:@"Hello"]
884/// \endcode
885///
886/// The innermost message send invokes the "alloc" class method on the
887/// NSString class, while the outermost message send invokes the
888/// "initWithString" instance method on the object returned from
889/// NSString's "alloc". In all, an Objective-C message send can take
890/// on four different (although related) forms:
891///
892///   1. Send to an object instance.
893///   2. Send to a class.
894///   3. Send to the superclass instance of the current class.
895///   4. Send to the superclass of the current class.
896///
897/// All four kinds of message sends are modeled by the ObjCMessageExpr
898/// class, and can be distinguished via \c getReceiverKind(). Example:
899///
900/// The "void *" trailing objects are actually ONE void * (the
901/// receiver pointer), and NumArgs Expr *. But due to the
902/// implementation of children(), these must be together contiguously.
903class ObjCMessageExpr final
904    : public Expr,
905      private llvm::TrailingObjects<ObjCMessageExpr, void *, SourceLocation> {
906  /// Stores either the selector that this message is sending
907  /// to (when \c HasMethod is zero) or an \c ObjCMethodDecl pointer
908  /// referring to the method that we type-checked against.
909  uintptr_t SelectorOrMethod = 0;
910
911  enum { NumArgsBitWidth = 16 };
912
913  /// The number of arguments in the message send, not
914  /// including the receiver.
915  unsigned NumArgs : NumArgsBitWidth;
916
917  /// The kind of message send this is, which is one of the
918  /// ReceiverKind values.
919  ///
920  /// We pad this out to a byte to avoid excessive masking and shifting.
921  unsigned Kind : 8;
922
923  /// Whether we have an actual method prototype in \c
924  /// SelectorOrMethod.
925  ///
926  /// When non-zero, we have a method declaration; otherwise, we just
927  /// have a selector.
928  unsigned HasMethod : 1;
929
930  /// Whether this message send is a "delegate init call",
931  /// i.e. a call of an init method on self from within an init method.
932  unsigned IsDelegateInitCall : 1;
933
934  /// Whether this message send was implicitly generated by
935  /// the implementation rather than explicitly written by the user.
936  unsigned IsImplicit : 1;
937
938  /// Whether the locations of the selector identifiers are in a
939  /// "standard" position, a enum SelectorLocationsKind.
940  unsigned SelLocsKind : 2;
941
942  /// When the message expression is a send to 'super', this is
943  /// the location of the 'super' keyword.
944  SourceLocation SuperLoc;
945
946  /// The source locations of the open and close square
947  /// brackets ('[' and ']', respectively).
948  SourceLocation LBracLocRBracLoc;
949
950  ObjCMessageExpr(EmptyShell Emptyunsigned NumArgs)
951      : Expr(ObjCMessageExprClass, Empty), Kind(0), HasMethod(false),
952        IsDelegateInitCall(false), IsImplicit(false), SelLocsKind(0) {
953    setNumArgs(NumArgs);
954  }
955
956  ObjCMessageExpr(QualType TExprValueKind VK,
957                  SourceLocation LBracLoc,
958                  SourceLocation SuperLoc,
959                  bool IsInstanceSuper,
960                  QualType SuperType,
961                  Selector Sel,
962                  ArrayRef<SourceLocationSelLocs,
963                  SelectorLocationsKind SelLocsK,
964                  ObjCMethodDecl *Method,
965                  ArrayRef<Expr *> Args,
966                  SourceLocation RBracLoc,
967                  bool isImplicit);
968  ObjCMessageExpr(QualType TExprValueKind VK,
969                  SourceLocation LBracLoc,
970                  TypeSourceInfo *Receiver,
971                  Selector Sel,
972                  ArrayRef<SourceLocationSelLocs,
973                  SelectorLocationsKind SelLocsK,
974                  ObjCMethodDecl *Method,
975                  ArrayRef<Expr *> Args,
976                  SourceLocation RBracLoc,
977                  bool isImplicit);
978  ObjCMessageExpr(QualType TExprValueKind VK,
979                  SourceLocation LBracLoc,
980                  Expr *Receiver,
981                  Selector Sel,
982                  ArrayRef<SourceLocationSelLocs,
983                  SelectorLocationsKind SelLocsK,
984                  ObjCMethodDecl *Method,
985                  ArrayRef<Expr *> Args,
986                  SourceLocation RBracLoc,
987                  bool isImplicit);
988
989  size_t numTrailingObjects(OverloadToken<void *>) const { return NumArgs + 1; }
990
991  void setNumArgs(unsigned Num) {
992     (0) . __assert_fail ("(Num >> NumArgsBitWidth) == 0 && \"Num of args is out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 992, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Num >> NumArgsBitWidth) == 0 && "Num of args is out of range!");
993    NumArgs = Num;
994  }
995
996  void initArgsAndSelLocs(ArrayRef<Expr *> Args,
997                          ArrayRef<SourceLocationSelLocs,
998                          SelectorLocationsKind SelLocsK);
999
1000  /// Retrieve the pointer value of the message receiver.
1001  void *getReceiverPointer() const { return *getTrailingObjects<void *>(); }
1002
1003  /// Set the pointer value of the message receiver.
1004  void setReceiverPointer(void *Value) {
1005    *getTrailingObjects<void *>() = Value;
1006  }
1007
1008  SelectorLocationsKind getSelLocsKind() const {
1009    return (SelectorLocationsKind)SelLocsKind;
1010  }
1011
1012  bool hasStandardSelLocs() const {
1013    return getSelLocsKind() != SelLoc_NonStandard;
1014  }
1015
1016  /// Get a pointer to the stored selector identifiers locations array.
1017  /// No locations will be stored if HasStandardSelLocs is true.
1018  SourceLocation *getStoredSelLocs() {
1019    return getTrailingObjects<SourceLocation>();
1020  }
1021  const SourceLocation *getStoredSelLocs() const {
1022    return getTrailingObjects<SourceLocation>();
1023  }
1024
1025  /// Get the number of stored selector identifiers locations.
1026  /// No locations will be stored if HasStandardSelLocs is true.
1027  unsigned getNumStoredSelLocs() const {
1028    if (hasStandardSelLocs())
1029      return 0;
1030    return getNumSelectorLocs();
1031  }
1032
1033  static ObjCMessageExpr *alloc(const ASTContext &C,
1034                                ArrayRef<Expr *> Args,
1035                                SourceLocation RBraceLoc,
1036                                ArrayRef<SourceLocationSelLocs,
1037                                Selector Sel,
1038                                SelectorLocationsKind &SelLocsK);
1039  static ObjCMessageExpr *alloc(const ASTContext &C,
1040                                unsigned NumArgs,
1041                                unsigned NumStoredSelLocs);
1042
1043public:
1044  friend class ASTStmtReader;
1045  friend class ASTStmtWriter;
1046  friend TrailingObjects;
1047
1048  /// The kind of receiver this message is sending to.
1049  enum ReceiverKind {
1050    /// The receiver is a class.
1051    Class = 0,
1052
1053    /// The receiver is an object instance.
1054    Instance,
1055
1056    /// The receiver is a superclass.
1057    SuperClass,
1058
1059    /// The receiver is the instance of the superclass object.
1060    SuperInstance
1061  };
1062
1063  /// Create a message send to super.
1064  ///
1065  /// \param Context The ASTContext in which this expression will be created.
1066  ///
1067  /// \param T The result type of this message.
1068  ///
1069  /// \param VK The value kind of this message.  A message returning
1070  /// a l-value or r-value reference will be an l-value or x-value,
1071  /// respectively.
1072  ///
1073  /// \param LBracLoc The location of the open square bracket '['.
1074  ///
1075  /// \param SuperLoc The location of the "super" keyword.
1076  ///
1077  /// \param IsInstanceSuper Whether this is an instance "super"
1078  /// message (otherwise, it's a class "super" message).
1079  ///
1080  /// \param Sel The selector used to determine which method gets called.
1081  ///
1082  /// \param Method The Objective-C method against which this message
1083  /// send was type-checked. May be nullptr.
1084  ///
1085  /// \param Args The message send arguments.
1086  ///
1087  /// \param RBracLoc The location of the closing square bracket ']'.
1088  static ObjCMessageExpr *Create(const ASTContext &ContextQualType T,
1089                                 ExprValueKind VK,
1090                                 SourceLocation LBracLoc,
1091                                 SourceLocation SuperLoc,
1092                                 bool IsInstanceSuper,
1093                                 QualType SuperType,
1094                                 Selector Sel,
1095                                 ArrayRef<SourceLocationSelLocs,
1096                                 ObjCMethodDecl *Method,
1097                                 ArrayRef<Expr *> Args,
1098                                 SourceLocation RBracLoc,
1099                                 bool isImplicit);
1100
1101  /// Create a class message send.
1102  ///
1103  /// \param Context The ASTContext in which this expression will be created.
1104  ///
1105  /// \param T The result type of this message.
1106  ///
1107  /// \param VK The value kind of this message.  A message returning
1108  /// a l-value or r-value reference will be an l-value or x-value,
1109  /// respectively.
1110  ///
1111  /// \param LBracLoc The location of the open square bracket '['.
1112  ///
1113  /// \param Receiver The type of the receiver, including
1114  /// source-location information.
1115  ///
1116  /// \param Sel The selector used to determine which method gets called.
1117  ///
1118  /// \param Method The Objective-C method against which this message
1119  /// send was type-checked. May be nullptr.
1120  ///
1121  /// \param Args The message send arguments.
1122  ///
1123  /// \param RBracLoc The location of the closing square bracket ']'.
1124  static ObjCMessageExpr *Create(const ASTContext &ContextQualType T,
1125                                 ExprValueKind VK,
1126                                 SourceLocation LBracLoc,
1127                                 TypeSourceInfo *Receiver,
1128                                 Selector Sel,
1129                                 ArrayRef<SourceLocationSelLocs,
1130                                 ObjCMethodDecl *Method,
1131                                 ArrayRef<Expr *> Args,
1132                                 SourceLocation RBracLoc,
1133                                 bool isImplicit);
1134
1135  /// Create an instance message send.
1136  ///
1137  /// \param Context The ASTContext in which this expression will be created.
1138  ///
1139  /// \param T The result type of this message.
1140  ///
1141  /// \param VK The value kind of this message.  A message returning
1142  /// a l-value or r-value reference will be an l-value or x-value,
1143  /// respectively.
1144  ///
1145  /// \param LBracLoc The location of the open square bracket '['.
1146  ///
1147  /// \param Receiver The expression used to produce the object that
1148  /// will receive this message.
1149  ///
1150  /// \param Sel The selector used to determine which method gets called.
1151  ///
1152  /// \param Method The Objective-C method against which this message
1153  /// send was type-checked. May be nullptr.
1154  ///
1155  /// \param Args The message send arguments.
1156  ///
1157  /// \param RBracLoc The location of the closing square bracket ']'.
1158  static ObjCMessageExpr *Create(const ASTContext &ContextQualType T,
1159                                 ExprValueKind VK,
1160                                 SourceLocation LBracLoc,
1161                                 Expr *Receiver,
1162                                 Selector Sel,
1163                                 ArrayRef<SourceLocationSeLocs,
1164                                 ObjCMethodDecl *Method,
1165                                 ArrayRef<Expr *> Args,
1166                                 SourceLocation RBracLoc,
1167                                 bool isImplicit);
1168
1169  /// Create an empty Objective-C message expression, to be
1170  /// filled in by subsequent calls.
1171  ///
1172  /// \param Context The context in which the message send will be created.
1173  ///
1174  /// \param NumArgs The number of message arguments, not including
1175  /// the receiver.
1176  static ObjCMessageExpr *CreateEmpty(const ASTContext &Context,
1177                                      unsigned NumArgs,
1178                                      unsigned NumStoredSelLocs);
1179
1180  /// Indicates whether the message send was implicitly
1181  /// generated by the implementation. If false, it was written explicitly
1182  /// in the source code.
1183  bool isImplicit() const { return IsImplicit; }
1184
1185  /// Determine the kind of receiver that this message is being
1186  /// sent to.
1187  ReceiverKind getReceiverKind() const { return (ReceiverKind)Kind; }
1188
1189  /// \return the return type of the message being sent.
1190  /// This is not always the type of the message expression itself because
1191  /// of references (the expression would not have a reference type).
1192  /// It is also not always the declared return type of the method because
1193  /// of `instancetype` (in that case it's an expression type).
1194  QualType getCallReturnType(ASTContext &Ctxconst;
1195
1196  /// Source range of the receiver.
1197  SourceRange getReceiverRange() const;
1198
1199  /// Determine whether this is an instance message to either a
1200  /// computed object or to super.
1201  bool isInstanceMessage() const {
1202    return getReceiverKind() == Instance || getReceiverKind() == SuperInstance;
1203  }
1204
1205  /// Determine whether this is an class message to either a
1206  /// specified class or to super.
1207  bool isClassMessage() const {
1208    return getReceiverKind() == Class || getReceiverKind() == SuperClass;
1209  }
1210
1211  /// Returns the object expression (receiver) for an instance message,
1212  /// or null for a message that is not an instance message.
1213  Expr *getInstanceReceiver() {
1214    if (getReceiverKind() == Instance)
1215      return static_cast<Expr *>(getReceiverPointer());
1216
1217    return nullptr;
1218  }
1219  const Expr *getInstanceReceiver() const {
1220    return const_cast<ObjCMessageExpr*>(this)->getInstanceReceiver();
1221  }
1222
1223  /// Turn this message send into an instance message that
1224  /// computes the receiver object with the given expression.
1225  void setInstanceReceiver(Expr *rec) {
1226    Kind = Instance;
1227    setReceiverPointer(rec);
1228  }
1229
1230  /// Returns the type of a class message send, or NULL if the
1231  /// message is not a class message.
1232  QualType getClassReceiver() const {
1233    if (TypeSourceInfo *TSInfo = getClassReceiverTypeInfo())
1234      return TSInfo->getType();
1235
1236    return {};
1237  }
1238
1239  /// Returns a type-source information of a class message
1240  /// send, or nullptr if the message is not a class message.
1241  TypeSourceInfo *getClassReceiverTypeInfo() const {
1242    if (getReceiverKind() == Class)
1243      return reinterpret_cast<TypeSourceInfo *>(getReceiverPointer());
1244    return nullptr;
1245  }
1246
1247  void setClassReceiver(TypeSourceInfo *TSInfo) {
1248    Kind = Class;
1249    setReceiverPointer(TSInfo);
1250  }
1251
1252  /// Retrieve the location of the 'super' keyword for a class
1253  /// or instance message to 'super', otherwise an invalid source location.
1254  SourceLocation getSuperLoc() const {
1255    if (getReceiverKind() == SuperInstance || getReceiverKind() == SuperClass)
1256      return SuperLoc;
1257
1258    return SourceLocation();
1259  }
1260
1261  /// Retrieve the receiver type to which this message is being directed.
1262  ///
1263  /// This routine cross-cuts all of the different kinds of message
1264  /// sends to determine what the underlying (statically known) type
1265  /// of the receiver will be; use \c getReceiverKind() to determine
1266  /// whether the message is a class or an instance method, whether it
1267  /// is a send to super or not, etc.
1268  ///
1269  /// \returns The type of the receiver.
1270  QualType getReceiverType() const;
1271
1272  /// Retrieve the Objective-C interface to which this message
1273  /// is being directed, if known.
1274  ///
1275  /// This routine cross-cuts all of the different kinds of message
1276  /// sends to determine what the underlying (statically known) type
1277  /// of the receiver will be; use \c getReceiverKind() to determine
1278  /// whether the message is a class or an instance method, whether it
1279  /// is a send to super or not, etc.
1280  ///
1281  /// \returns The Objective-C interface if known, otherwise nullptr.
1282  ObjCInterfaceDecl *getReceiverInterface() const;
1283
1284  /// Retrieve the type referred to by 'super'.
1285  ///
1286  /// The returned type will either be an ObjCInterfaceType (for an
1287  /// class message to super) or an ObjCObjectPointerType that refers
1288  /// to a class (for an instance message to super);
1289  QualType getSuperType() const {
1290    if (getReceiverKind() == SuperInstance || getReceiverKind() == SuperClass)
1291      return QualType::getFromOpaquePtr(getReceiverPointer());
1292
1293    return QualType();
1294  }
1295
1296  void setSuper(SourceLocation LocQualType Tbool IsInstanceSuper) {
1297    Kind = IsInstanceSuperSuperInstance : SuperClass;
1298    SuperLoc = Loc;
1299    setReceiverPointer(T.getAsOpaquePtr());
1300  }
1301
1302  Selector getSelector() const;
1303
1304  void setSelector(Selector S) {
1305    HasMethod = false;
1306    SelectorOrMethod = reinterpret_cast<uintptr_t>(S.getAsOpaquePtr());
1307  }
1308
1309  const ObjCMethodDecl *getMethodDecl() const {
1310    if (HasMethod)
1311      return reinterpret_cast<const ObjCMethodDecl *>(SelectorOrMethod);
1312
1313    return nullptr;
1314  }
1315
1316  ObjCMethodDecl *getMethodDecl() {
1317    if (HasMethod)
1318      return reinterpret_cast<ObjCMethodDecl *>(SelectorOrMethod);
1319
1320    return nullptr;
1321  }
1322
1323  void setMethodDecl(ObjCMethodDecl *MD) {
1324    HasMethod = true;
1325    SelectorOrMethod = reinterpret_cast<uintptr_t>(MD);
1326  }
1327
1328  ObjCMethodFamily getMethodFamily() const {
1329    if (HasMethodreturn getMethodDecl()->getMethodFamily();
1330    return getSelector().getMethodFamily();
1331  }
1332
1333  /// Return the number of actual arguments in this message,
1334  /// not counting the receiver.
1335  unsigned getNumArgs() const { return NumArgs; }
1336
1337  /// Retrieve the arguments to this message, not including the
1338  /// receiver.
1339  Expr **getArgs() {
1340    return reinterpret_cast<Expr **>(getTrailingObjects<void *>() + 1);
1341  }
1342  const Expr * const *getArgs() const {
1343    return reinterpret_cast<const Expr *const *>(getTrailingObjects<void *>() +
1344                                                 1);
1345  }
1346
1347  /// getArg - Return the specified argument.
1348  Expr *getArg(unsigned Arg) {
1349     (0) . __assert_fail ("Arg < NumArgs && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 1349, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < NumArgs && "Arg access out of range!");
1350    return getArgs()[Arg];
1351  }
1352  const Expr *getArg(unsigned Argconst {
1353     (0) . __assert_fail ("Arg < NumArgs && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 1353, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < NumArgs && "Arg access out of range!");
1354    return getArgs()[Arg];
1355  }
1356
1357  /// setArg - Set the specified argument.
1358  void setArg(unsigned ArgExpr *ArgExpr) {
1359     (0) . __assert_fail ("Arg < NumArgs && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 1359, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < NumArgs && "Arg access out of range!");
1360    getArgs()[Arg] = ArgExpr;
1361  }
1362
1363  /// isDelegateInitCall - Answers whether this message send has been
1364  /// tagged as a "delegate init call", i.e. a call to a method in the
1365  /// -init family on self from within an -init method implementation.
1366  bool isDelegateInitCall() const { return IsDelegateInitCall; }
1367  void setDelegateInitCall(bool isDelegate) { IsDelegateInitCall = isDelegate; }
1368
1369  SourceLocation getLeftLoc() const { return LBracLoc; }
1370  SourceLocation getRightLoc() const { return RBracLoc; }
1371
1372  SourceLocation getSelectorStartLoc() const {
1373    if (isImplicit())
1374      return getBeginLoc();
1375    return getSelectorLoc(0);
1376  }
1377
1378  SourceLocation getSelectorLoc(unsigned Indexconst {
1379     (0) . __assert_fail ("Index < getNumSelectorLocs() && \"Index out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/ExprObjC.h", 1379, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Index < getNumSelectorLocs() && "Index out of range!");
1380    if (hasStandardSelLocs())
1381      return getStandardSelectorLoc(Index, getSelector(),
1382                                   getSelLocsKind() == SelLoc_StandardWithSpace,
1383                               llvm::makeArrayRef(const_cast<Expr**>(getArgs()),
1384                                                  getNumArgs()),
1385                                   RBracLoc);
1386    return getStoredSelLocs()[Index];
1387  }
1388
1389  void getSelectorLocs(SmallVectorImpl<SourceLocation> &SelLocsconst;
1390
1391  unsigned getNumSelectorLocs() const {
1392    if (isImplicit())
1393      return 0;
1394    Selector Sel = getSelector();
1395    if (Sel.isUnarySelector())
1396      return 1;
1397    return Sel.getNumArgs();
1398  }
1399
1400  void setSourceRange(SourceRange R) {
1401    LBracLoc = R.getBegin();
1402    RBracLoc = R.getEnd();
1403  }
1404
1405  SourceLocation getBeginLoc() const LLVM_READONLY { return LBracLoc; }
1406  SourceLocation getEndLoc() const LLVM_READONLY { return RBracLoc; }
1407
1408  // Iterators
1409  child_range children();
1410
1411  using arg_iterator = ExprIterator;
1412  using const_arg_iterator = ConstExprIterator;
1413
1414  llvm::iterator_range<arg_iterator> arguments() {
1415    return llvm::make_range(arg_begin(), arg_end());
1416  }
1417
1418  llvm::iterator_range<const_arg_iterator> arguments() const {
1419    return llvm::make_range(arg_begin(), arg_end());
1420  }
1421
1422  arg_iterator arg_begin() { return reinterpret_cast<Stmt **>(getArgs()); }
1423
1424  arg_iterator arg_end()   {
1425    return reinterpret_cast<Stmt **>(getArgs() + NumArgs);
1426  }
1427
1428  const_arg_iterator arg_begin() const {
1429    return reinterpret_cast<Stmt const * const*>(getArgs());
1430  }
1431
1432  const_arg_iterator arg_end() const {
1433    return reinterpret_cast<Stmt const * const*>(getArgs() + NumArgs);
1434  }
1435
1436  static bool classof(const Stmt *T) {
1437    return T->getStmtClass() == ObjCMessageExprClass;
1438  }
1439};
1440
1441/// ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
1442/// (similar in spirit to MemberExpr).
1443class ObjCIsaExpr : public Expr {
1444  /// Base - the expression for the base object pointer.
1445  Stmt *Base;
1446
1447  /// IsaMemberLoc - This is the location of the 'isa'.
1448  SourceLocation IsaMemberLoc;
1449
1450  /// OpLoc - This is the location of '.' or '->'
1451  SourceLocation OpLoc;
1452
1453  /// IsArrow - True if this is "X->F", false if this is "X.F".
1454  bool IsArrow;
1455
1456public:
1457  ObjCIsaExpr(Expr *basebool isarrowSourceLocation lSourceLocation oploc,
1458              QualType ty)
1459      : Expr(ObjCIsaExprClass, ty, VK_LValue, OK_Ordinary,
1460             /*TypeDependent=*/false, base->isValueDependent(),
1461             base->isInstantiationDependent(),
1462             /*ContainsUnexpandedParameterPack=*/false),
1463        Base(base), IsaMemberLoc(l), OpLoc(oploc), IsArrow(isarrow) {}
1464
1465  /// Build an empty expression.
1466  explicit ObjCIsaExpr(EmptyShell Empty) : Expr(ObjCIsaExprClass, Empty) {}
1467
1468  void setBase(Expr *E) { Base = E; }
1469  Expr *getBase() const { return cast<Expr>(Base); }
1470
1471  bool isArrow() const { return IsArrow; }
1472  void setArrow(bool A) { IsArrow = A; }
1473
1474  /// getMemberLoc - Return the location of the "member", in X->F, it is the
1475  /// location of 'F'.
1476  SourceLocation getIsaMemberLoc() const { return IsaMemberLoc; }
1477  void setIsaMemberLoc(SourceLocation L) { IsaMemberLoc = L; }
1478
1479  SourceLocation getOpLoc() const { return OpLoc; }
1480  void setOpLoc(SourceLocation L) { OpLoc = L; }
1481
1482  SourceLocation getBeginLoc() const LLVM_READONLY {
1483    return getBase()->getBeginLoc();
1484  }
1485
1486  SourceLocation getBaseLocEnd() const LLVM_READONLY {
1487    return getBase()->getEndLoc();
1488  }
1489
1490  SourceLocation getEndLoc() const LLVM_READONLY { return IsaMemberLoc; }
1491
1492  SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; }
1493
1494  // Iterators
1495  child_range children() { return child_range(&Base, &Base+1); }
1496
1497  static bool classof(const Stmt *T) {
1498    return T->getStmtClass() == ObjCIsaExprClass;
1499  }
1500};
1501
1502/// ObjCIndirectCopyRestoreExpr - Represents the passing of a function
1503/// argument by indirect copy-restore in ARC.  This is used to support
1504/// passing indirect arguments with the wrong lifetime, e.g. when
1505/// passing the address of a __strong local variable to an 'out'
1506/// parameter.  This expression kind is only valid in an "argument"
1507/// position to some sort of call expression.
1508///
1509/// The parameter must have type 'pointer to T', and the argument must
1510/// have type 'pointer to U', where T and U agree except possibly in
1511/// qualification.  If the argument value is null, then a null pointer
1512/// is passed;  otherwise it points to an object A, and:
1513/// 1. A temporary object B of type T is initialized, either by
1514///    zero-initialization (used when initializing an 'out' parameter)
1515///    or copy-initialization (used when initializing an 'inout'
1516///    parameter).
1517/// 2. The address of the temporary is passed to the function.
1518/// 3. If the call completes normally, A is move-assigned from B.
1519/// 4. Finally, A is destroyed immediately.
1520///
1521/// Currently 'T' must be a retainable object lifetime and must be
1522/// __autoreleasing;  this qualifier is ignored when initializing
1523/// the value.
1524class ObjCIndirectCopyRestoreExpr : public Expr {
1525  friend class ASTReader;
1526  friend class ASTStmtReader;
1527
1528  Stmt *Operand;
1529
1530  // unsigned ObjCIndirectCopyRestoreBits.ShouldCopy : 1;
1531
1532  explicit ObjCIndirectCopyRestoreExpr(EmptyShell Empty)
1533      : Expr(ObjCIndirectCopyRestoreExprClass, Empty) {}
1534
1535  void setShouldCopy(bool shouldCopy) {
1536    ObjCIndirectCopyRestoreExprBits.ShouldCopy = shouldCopy;
1537  }
1538
1539public:
1540  ObjCIndirectCopyRestoreExpr(Expr *operandQualType typebool shouldCopy)
1541      : Expr(ObjCIndirectCopyRestoreExprClass, type, VK_LValue, OK_Ordinary,
1542             operand->isTypeDependent(), operand->isValueDependent(),
1543             operand->isInstantiationDependent(),
1544             operand->containsUnexpandedParameterPack()),
1545        Operand(operand) {
1546    setShouldCopy(shouldCopy);
1547  }
1548
1549  Expr *getSubExpr() { return cast<Expr>(Operand); }
1550  const Expr *getSubExpr() const { return cast<Expr>(Operand); }
1551
1552  /// shouldCopy - True if we should do the 'copy' part of the
1553  /// copy-restore.  If false, the temporary will be zero-initialized.
1554  bool shouldCopy() const { return ObjCIndirectCopyRestoreExprBits.ShouldCopy; }
1555
1556  child_range children() { return child_range(&Operand, &Operand+1); }
1557
1558  // Source locations are determined by the subexpression.
1559  SourceLocation getBeginLoc() const LLVM_READONLY {
1560    return Operand->getBeginLoc();
1561  }
1562  SourceLocation getEndLoc() const LLVM_READONLY {
1563    return Operand->getEndLoc();
1564  }
1565
1566  SourceLocation getExprLoc() const LLVM_READONLY {
1567    return getSubExpr()->getExprLoc();
1568  }
1569
1570  static bool classof(const Stmt *s) {
1571    return s->getStmtClass() == ObjCIndirectCopyRestoreExprClass;
1572  }
1573};
1574
1575/// An Objective-C "bridged" cast expression, which casts between
1576/// Objective-C pointers and C pointers, transferring ownership in the process.
1577///
1578/// \code
1579/// NSString *str = (__bridge_transfer NSString *)CFCreateString();
1580/// \endcode
1581class ObjCBridgedCastExpr final
1582    : public ExplicitCastExpr,
1583      private llvm::TrailingObjects<ObjCBridgedCastExpr, CXXBaseSpecifier *> {
1584  friend class ASTStmtReader;
1585  friend class ASTStmtWriter;
1586  friend class CastExpr;
1587  friend TrailingObjects;
1588
1589  SourceLocation LParenLoc;
1590  SourceLocation BridgeKeywordLoc;
1591  unsigned Kind : 2;
1592
1593public:
1594  ObjCBridgedCastExpr(SourceLocation LParenLocObjCBridgeCastKind Kind,
1595                      CastKind CKSourceLocation BridgeKeywordLoc,
1596                      TypeSourceInfo *TSInfoExpr *Operand)
1597      : ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(), VK_RValue,
1598                         CK, Operand, 0, TSInfo),
1599        LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}
1600
1601  /// Construct an empty Objective-C bridged cast.
1602  explicit ObjCBridgedCastExpr(EmptyShell Shell)
1603      : ExplicitCastExpr(ObjCBridgedCastExprClass, Shell, 0) {}
1604
1605  SourceLocation getLParenLoc() const { return LParenLoc; }
1606
1607  /// Determine which kind of bridge is being performed via this cast.
1608  ObjCBridgeCastKind getBridgeKind() const {
1609    return static_cast<ObjCBridgeCastKind>(Kind);
1610  }
1611
1612  /// Retrieve the kind of bridge being performed as a string.
1613  StringRef getBridgeKindName() const;
1614
1615  /// The location of the bridge keyword.
1616  SourceLocation getBridgeKeywordLoc() const { return BridgeKeywordLoc; }
1617
1618  SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
1619
1620  SourceLocation getEndLoc() const LLVM_READONLY {
1621    return getSubExpr()->getEndLoc();
1622  }
1623
1624  static bool classof(const Stmt *T) {
1625    return T->getStmtClass() == ObjCBridgedCastExprClass;
1626  }
1627};
1628
1629/// A runtime availability query.
1630///
1631/// There are 2 ways to spell this node:
1632/// \code
1633///   @available(macos 10.10, ios 8, *); // Objective-C
1634///   __builtin_available(macos 10.10, ios 8, *); // C, C++, and Objective-C
1635/// \endcode
1636///
1637/// Note that we only need to keep track of one \c VersionTuple here, which is
1638/// the one that corresponds to the current deployment target. This is meant to
1639/// be used in the condition of an \c if, but it is also usable as top level
1640/// expressions.
1641///
1642class ObjCAvailabilityCheckExpr : public Expr {
1643  friend class ASTStmtReader;
1644
1645  VersionTuple VersionToCheck;
1646  SourceLocation AtLocRParen;
1647
1648public:
1649  ObjCAvailabilityCheckExpr(VersionTuple VersionToCheckSourceLocation AtLoc,
1650                            SourceLocation RParenQualType Ty)
1651      : Expr(ObjCAvailabilityCheckExprClass, Ty, VK_RValue, OK_Ordinary, false,
1652             falsefalsefalse),
1653        VersionToCheck(VersionToCheck), AtLoc(AtLoc), RParen(RParen) {}
1654
1655  explicit ObjCAvailabilityCheckExpr(EmptyShell Shell)
1656      : Expr(ObjCAvailabilityCheckExprClass, Shell) {}
1657
1658  SourceLocation getBeginLoc() const { return AtLoc; }
1659  SourceLocation getEndLoc() const { return RParen; }
1660  SourceRange getSourceRange() const { return {AtLocRParen}; }
1661
1662  /// This may be '*', in which case this should fold to true.
1663  bool hasVersion() const { return !VersionToCheck.empty(); }
1664  VersionTuple getVersion() { return VersionToCheck; }
1665
1666  child_range children() {
1667    return child_range(child_iterator(), child_iterator());
1668  }
1669
1670  static bool classof(const Stmt *T) {
1671    return T->getStmtClass() == ObjCAvailabilityCheckExprClass;
1672  }
1673};
1674
1675// namespace clang
1676
1677#endif // LLVM_CLANG_AST_EXPROBJC_H
1678
clang::ObjCStringLiteral::String
clang::ObjCStringLiteral::AtLoc
clang::ObjCStringLiteral::getString
clang::ObjCStringLiteral::getString
clang::ObjCStringLiteral::setString
clang::ObjCStringLiteral::getAtLoc
clang::ObjCStringLiteral::setAtLoc
clang::ObjCStringLiteral::getBeginLoc
clang::ObjCBoolLiteralExpr::Value
clang::ObjCBoolLiteralExpr::Loc
clang::ObjCBoolLiteralExpr::getValue
clang::ObjCBoolLiteralExpr::setValue
clang::ObjCBoolLiteralExpr::getBeginLoc
clang::ObjCBoxedExpr::SubExpr
clang::ObjCBoxedExpr::BoxingMethod
clang::ObjCBoxedExpr::Range
clang::ObjCBoxedExpr::getSubExpr
clang::ObjCBoxedExpr::getSubExpr
clang::ObjCBoxedExpr::getBoxingMethod
clang::ObjCBoxedExpr::isExpressibleAsConstantInitializer
clang::ObjCBoxedExpr::getAtLoc
clang::ObjCBoxedExpr::getBeginLoc
clang::ObjCBoxedExpr::arg_begin
clang::ObjCBoxedExpr::arg_end
clang::ObjCBoxedExpr::classof
clang::ObjCArrayLiteral::NumElements
clang::ObjCArrayLiteral::Range
clang::ObjCArrayLiteral::ArrayWithObjectsMethod
clang::ObjCArrayLiteral::Create
clang::ObjCArrayLiteral::CreateEmpty
clang::ObjCArrayLiteral::getBeginLoc
clang::ObjCDictionaryElement::Key
clang::ObjCDictionaryElement::Value
clang::ObjCDictionaryElement::EllipsisLoc
clang::ObjCDictionaryElement::NumExpansions
clang::ObjCDictionaryElement::isPackExpansion
clang::ObjCDictionaryLiteral_KeyValuePair::Key
clang::ObjCDictionaryLiteral_KeyValuePair::Value
clang::ObjCDictionaryLiteral_ExpansionData::EllipsisLoc
clang::ObjCDictionaryLiteral_ExpansionData::NumExpansionsPlusOne
clang::ObjCDictionaryLiteral::NumElements
clang::ObjCDictionaryLiteral::HasPackExpansions
clang::ObjCDictionaryLiteral::Range
clang::ObjCDictionaryLiteral::DictWithObjectsMethod
clang::ObjCDictionaryLiteral::numTrailingObjects
clang::ObjCDictionaryLiteral::Create
clang::ObjCDictionaryLiteral::CreateEmpty
clang::ObjCDictionaryLiteral::getNumElements
clang::ObjCDictionaryLiteral::getKeyValueElement
clang::ObjCDictionaryLiteral::getDictWithObjectsMethod
clang::ObjCDictionaryLiteral::getBeginLoc
clang::ObjCEncodeExpr::EncodedType
clang::ObjCEncodeExpr::AtLoc
clang::ObjCEncodeExpr::RParenLoc
clang::ObjCEncodeExpr::getAtLoc
clang::ObjCEncodeExpr::setAtLoc
clang::ObjCEncodeExpr::getRParenLoc
clang::ObjCEncodeExpr::setRParenLoc
clang::ObjCEncodeExpr::getEncodedType
clang::ObjCEncodeExpr::getEncodedTypeSourceInfo
clang::ObjCEncodeExpr::setEncodedTypeSourceInfo
clang::ObjCEncodeExpr::getBeginLoc
clang::ObjCSelectorExpr::SelName
clang::ObjCSelectorExpr::AtLoc
clang::ObjCSelectorExpr::RParenLoc
clang::ObjCSelectorExpr::getSelector
clang::ObjCSelectorExpr::setSelector
clang::ObjCSelectorExpr::getAtLoc
clang::ObjCSelectorExpr::getRParenLoc
clang::ObjCSelectorExpr::setAtLoc
clang::ObjCSelectorExpr::setRParenLoc
clang::ObjCSelectorExpr::getBeginLoc
clang::ObjCProtocolExpr::TheProtocol
clang::ObjCProtocolExpr::AtLoc
clang::ObjCProtocolExpr::ProtoLoc
clang::ObjCProtocolExpr::RParenLoc
clang::ObjCProtocolExpr::getProtocol
clang::ObjCProtocolExpr::setProtocol
clang::ObjCProtocolExpr::getProtocolIdLoc
clang::ObjCProtocolExpr::getAtLoc
clang::ObjCProtocolExpr::getRParenLoc
clang::ObjCProtocolExpr::setAtLoc
clang::ObjCProtocolExpr::setRParenLoc
clang::ObjCProtocolExpr::getBeginLoc
clang::ObjCIvarRefExpr::D
clang::ObjCIvarRefExpr::Base
clang::ObjCIvarRefExpr::Loc
clang::ObjCIvarRefExpr::OpLoc
clang::ObjCIvarRefExpr::IsArrow
clang::ObjCIvarRefExpr::IsFreeIvar
clang::ObjCIvarRefExpr::getDecl
clang::ObjCIvarRefExpr::getDecl
clang::ObjCIvarRefExpr::setDecl
clang::ObjCIvarRefExpr::getBase
clang::ObjCIvarRefExpr::getBase
clang::ObjCIvarRefExpr::setBase
clang::ObjCIvarRefExpr::isArrow
clang::ObjCIvarRefExpr::isFreeIvar
clang::ObjCIvarRefExpr::setIsArrow
clang::ObjCIvarRefExpr::setIsFreeIvar
clang::ObjCIvarRefExpr::getLocation
clang::ObjCIvarRefExpr::setLocation
clang::ObjCIvarRefExpr::getBeginLoc
clang::ObjCPropertyRefExpr::PropertyOrGetter
clang::ObjCPropertyRefExpr::MethodRefFlags
clang::ObjCPropertyRefExpr::SetterAndMethodRefFlags
clang::ObjCPropertyRefExpr::IdLoc
clang::ObjCPropertyRefExpr::ReceiverLoc
clang::ObjCPropertyRefExpr::Receiver
clang::ObjCPropertyRefExpr::isImplicitProperty
clang::ObjCPropertyRefExpr::isExplicitProperty
clang::ObjCPropertyRefExpr::getExplicitProperty
clang::ObjCPropertyRefExpr::getImplicitPropertyGetter
clang::ObjCPropertyRefExpr::getImplicitPropertySetter
clang::ObjCPropertyRefExpr::getGetterSelector
clang::ObjCPropertyRefExpr::getSetterSelector
clang::ObjCPropertyRefExpr::isMessagingGetter
clang::ObjCPropertyRefExpr::isMessagingSetter
clang::ObjCPropertyRefExpr::setIsMessagingGetter
clang::ObjCPropertyRefExpr::setIsMessagingSetter
clang::ObjCPropertyRefExpr::getBase
clang::ObjCPropertyRefExpr::getBase
clang::ObjCPropertyRefExpr::getLocation
clang::ObjCPropertyRefExpr::getReceiverLocation
clang::ObjCPropertyRefExpr::getSuperReceiverType
clang::ObjCPropertyRefExpr::getClassReceiver
clang::ObjCPropertyRefExpr::isObjectReceiver
clang::ObjCPropertyRefExpr::isSuperReceiver
clang::ObjCPropertyRefExpr::isClassReceiver
clang::ObjCPropertyRefExpr::getReceiverType
clang::ObjCPropertyRefExpr::getBeginLoc
clang::ObjCPropertyRefExpr::setExplicitProperty
clang::ObjCPropertyRefExpr::setImplicitProperty
clang::ObjCPropertyRefExpr::setBase
clang::ObjCPropertyRefExpr::setSuperReceiver
clang::ObjCPropertyRefExpr::setClassReceiver
clang::ObjCPropertyRefExpr::setLocation
clang::ObjCPropertyRefExpr::setReceiverLocation
clang::ObjCPropertyRefExpr::setMethodRefFlag
clang::ObjCSubscriptRefExpr::RBracket
clang::ObjCSubscriptRefExpr::SubExprs
clang::ObjCSubscriptRefExpr::GetAtIndexMethodDecl
clang::ObjCSubscriptRefExpr::SetAtIndexMethodDecl
clang::ObjCSubscriptRefExpr::getRBracket
clang::ObjCSubscriptRefExpr::setRBracket
clang::ObjCSubscriptRefExpr::getBeginLoc
clang::ObjCMessageExpr::SelectorOrMethod
clang::ObjCMessageExpr::NumArgs
clang::ObjCMessageExpr::Kind
clang::ObjCMessageExpr::HasMethod
clang::ObjCMessageExpr::IsDelegateInitCall
clang::ObjCMessageExpr::IsImplicit
clang::ObjCMessageExpr::SelLocsKind
clang::ObjCMessageExpr::SuperLoc
clang::ObjCMessageExpr::LBracLoc
clang::ObjCMessageExpr::RBracLoc
clang::ObjCMessageExpr::numTrailingObjects
clang::ObjCMessageExpr::setNumArgs
clang::ObjCMessageExpr::initArgsAndSelLocs
clang::ObjCMessageExpr::getReceiverPointer
clang::ObjCMessageExpr::setReceiverPointer
clang::ObjCMessageExpr::getSelLocsKind
clang::ObjCMessageExpr::hasStandardSelLocs
clang::ObjCMessageExpr::getStoredSelLocs
clang::ObjCMessageExpr::getStoredSelLocs
clang::ObjCMessageExpr::getNumStoredSelLocs
clang::ObjCMessageExpr::alloc
clang::ObjCMessageExpr::alloc
clang::ObjCMessageExpr::ReceiverKind
clang::ObjCMessageExpr::Create
clang::ObjCMessageExpr::Create
clang::ObjCMessageExpr::Create
clang::ObjCMessageExpr::CreateEmpty
clang::ObjCMessageExpr::isImplicit
clang::ObjCMessageExpr::getReceiverKind
clang::ObjCMessageExpr::getCallReturnType
clang::ObjCMessageExpr::getReceiverRange
clang::ObjCMessageExpr::isInstanceMessage
clang::ObjCMessageExpr::isClassMessage
clang::ObjCMessageExpr::getInstanceReceiver
clang::ObjCMessageExpr::getInstanceReceiver
clang::ObjCMessageExpr::setInstanceReceiver
clang::ObjCMessageExpr::getClassReceiver
clang::ObjCMessageExpr::getClassReceiverTypeInfo
clang::ObjCMessageExpr::setClassReceiver
clang::ObjCMessageExpr::getSuperLoc
clang::ObjCMessageExpr::getReceiverType
clang::ObjCMessageExpr::getReceiverInterface
clang::ObjCMessageExpr::getSuperType
clang::ObjCMessageExpr::setSuper
clang::ObjCMessageExpr::getSelector
clang::ObjCMessageExpr::setSelector
clang::ObjCMessageExpr::getMethodDecl
clang::ObjCMessageExpr::getMethodDecl
clang::ObjCMessageExpr::setMethodDecl
clang::ObjCMessageExpr::getMethodFamily
clang::ObjCMessageExpr::getNumArgs
clang::ObjCMessageExpr::getArgs
clang::ObjCMessageExpr::getArgs
clang::ObjCMessageExpr::getArg
clang::ObjCMessageExpr::getArg
clang::ObjCMessageExpr::setArg
clang::ObjCMessageExpr::isDelegateInitCall
clang::ObjCMessageExpr::setDelegateInitCall
clang::ObjCMessageExpr::getLeftLoc
clang::ObjCMessageExpr::getRightLoc
clang::ObjCMessageExpr::getSelectorStartLoc
clang::ObjCMessageExpr::getSelectorLoc
clang::ObjCMessageExpr::getSelectorLocs
clang::ObjCMessageExpr::getNumSelectorLocs
clang::ObjCMessageExpr::setSourceRange
clang::ObjCMessageExpr::getBeginLoc
clang::ObjCMessageExpr::arguments
clang::ObjCMessageExpr::arguments
clang::ObjCMessageExpr::arg_begin
clang::ObjCMessageExpr::arg_end
clang::ObjCMessageExpr::arg_begin
clang::ObjCMessageExpr::arg_end
clang::ObjCMessageExpr::classof
clang::ObjCIsaExpr::Base
clang::ObjCIsaExpr::IsaMemberLoc
clang::ObjCIsaExpr::OpLoc
clang::ObjCIsaExpr::IsArrow
clang::ObjCIsaExpr::setBase
clang::ObjCIsaExpr::getBase
clang::ObjCIsaExpr::isArrow
clang::ObjCIsaExpr::setArrow
clang::ObjCIsaExpr::getIsaMemberLoc
clang::ObjCIsaExpr::setIsaMemberLoc
clang::ObjCIsaExpr::getOpLoc
clang::ObjCIsaExpr::setOpLoc
clang::ObjCIsaExpr::getBeginLoc
clang::ObjCIndirectCopyRestoreExpr::Operand
clang::ObjCIndirectCopyRestoreExpr::setShouldCopy
clang::ObjCIndirectCopyRestoreExpr::getSubExpr
clang::ObjCIndirectCopyRestoreExpr::getSubExpr
clang::ObjCIndirectCopyRestoreExpr::shouldCopy
clang::ObjCIndirectCopyRestoreExpr::children
clang::ObjCIndirectCopyRestoreExpr::getBeginLoc
clang::ObjCBridgedCastExpr::LParenLoc
clang::ObjCBridgedCastExpr::BridgeKeywordLoc
clang::ObjCBridgedCastExpr::Kind
clang::ObjCBridgedCastExpr::getLParenLoc
clang::ObjCBridgedCastExpr::getBridgeKind
clang::ObjCBridgedCastExpr::getBridgeKindName
clang::ObjCBridgedCastExpr::getBridgeKeywordLoc
clang::ObjCBridgedCastExpr::getBeginLoc
clang::ObjCAvailabilityCheckExpr::VersionToCheck
clang::ObjCAvailabilityCheckExpr::AtLoc
clang::ObjCAvailabilityCheckExpr::RParen
clang::ObjCAvailabilityCheckExpr::getBeginLoc
clang::ObjCAvailabilityCheckExpr::getEndLoc
clang::ObjCAvailabilityCheckExpr::getSourceRange
clang::ObjCAvailabilityCheckExpr::hasVersion
clang::ObjCAvailabilityCheckExpr::getVersion
clang::ObjCAvailabilityCheckExpr::children
clang::ObjCAvailabilityCheckExpr::classof