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