clang  14.0.0git
DeclObjC.h
Go to the documentation of this file.
1 //===- DeclObjC.h - Classes for representing declarations -------*- 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 DeclObjC interface and subclasses.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_AST_DECLOBJC_H
14 #define LLVM_CLANG_AST_DECLOBJC_H
15 
16 #include "clang/AST/Decl.h"
17 #include "clang/AST/DeclBase.h"
20 #include "clang/AST/Redeclarable.h"
22 #include "clang/AST/Type.h"
24 #include "clang/Basic/LLVM.h"
26 #include "clang/Basic/Specifiers.h"
27 #include "llvm/ADT/ArrayRef.h"
28 #include "llvm/ADT/DenseMap.h"
29 #include "llvm/ADT/DenseSet.h"
30 #include "llvm/ADT/None.h"
31 #include "llvm/ADT/PointerIntPair.h"
32 #include "llvm/ADT/STLExtras.h"
33 #include "llvm/ADT/StringRef.h"
34 #include "llvm/ADT/iterator_range.h"
35 #include "llvm/Support/Compiler.h"
36 #include "llvm/Support/TrailingObjects.h"
37 #include <cassert>
38 #include <cstddef>
39 #include <cstdint>
40 #include <iterator>
41 #include <string>
42 #include <utility>
43 
44 namespace clang {
45 
46 class ASTContext;
47 class CompoundStmt;
48 class CXXCtorInitializer;
49 class Expr;
50 class ObjCCategoryDecl;
51 class ObjCCategoryImplDecl;
52 class ObjCImplementationDecl;
53 class ObjCInterfaceDecl;
54 class ObjCIvarDecl;
55 class ObjCPropertyDecl;
56 class ObjCPropertyImplDecl;
57 class ObjCProtocolDecl;
58 class Stmt;
59 
60 class ObjCListBase {
61 protected:
62  /// List is an array of pointers to objects that are not owned by this object.
63  void **List = nullptr;
64  unsigned NumElts = 0;
65 
66 public:
67  ObjCListBase() = default;
68  ObjCListBase(const ObjCListBase &) = delete;
69  ObjCListBase &operator=(const ObjCListBase &) = delete;
70 
71  unsigned size() const { return NumElts; }
72  bool empty() const { return NumElts == 0; }
73 
74 protected:
75  void set(void *const* InList, unsigned Elts, ASTContext &Ctx);
76 };
77 
78 /// ObjCList - This is a simple template class used to hold various lists of
79 /// decls etc, which is heavily used by the ObjC front-end. This only use case
80 /// this supports is setting the list all at once and then reading elements out
81 /// of it.
82 template <typename T>
83 class ObjCList : public ObjCListBase {
84 public:
85  void set(T* const* InList, unsigned Elts, ASTContext &Ctx) {
86  ObjCListBase::set(reinterpret_cast<void*const*>(InList), Elts, Ctx);
87  }
88 
89  using iterator = T* const *;
90 
91  iterator begin() const { return (iterator)List; }
92  iterator end() const { return (iterator)List+NumElts; }
93 
94  T* operator[](unsigned Idx) const {
95  assert(Idx < NumElts && "Invalid access");
96  return (T*)List[Idx];
97  }
98 };
99 
100 /// A list of Objective-C protocols, along with the source
101 /// locations at which they were referenced.
102 class ObjCProtocolList : public ObjCList<ObjCProtocolDecl> {
103  SourceLocation *Locations = nullptr;
104 
106 
107 public:
108  ObjCProtocolList() = default;
109 
110  using loc_iterator = const SourceLocation *;
111 
112  loc_iterator loc_begin() const { return Locations; }
113  loc_iterator loc_end() const { return Locations + size(); }
114 
115  void set(ObjCProtocolDecl* const* InList, unsigned Elts,
116  const SourceLocation *Locs, ASTContext &Ctx);
117 };
118 
119 /// ObjCMethodDecl - Represents an instance or class method declaration.
120 /// ObjC methods can be declared within 4 contexts: class interfaces,
121 /// categories, protocols, and class implementations. While C++ member
122 /// functions leverage C syntax, Objective-C method syntax is modeled after
123 /// Smalltalk (using colons to specify argument types/expressions).
124 /// Here are some brief examples:
125 ///
126 /// Setter/getter instance methods:
127 /// - (void)setMenu:(NSMenu *)menu;
128 /// - (NSMenu *)menu;
129 ///
130 /// Instance method that takes 2 NSView arguments:
131 /// - (void)replaceSubview:(NSView *)oldView with:(NSView *)newView;
132 ///
133 /// Getter class method:
134 /// + (NSMenu *)defaultMenu;
135 ///
136 /// A selector represents a unique name for a method. The selector names for
137 /// the above methods are setMenu:, menu, replaceSubview:with:, and defaultMenu.
138 ///
139 class ObjCMethodDecl : public NamedDecl, public DeclContext {
140  // This class stores some data in DeclContext::ObjCMethodDeclBits
141  // to save some space. Use the provided accessors to access it.
142 
143 public:
145 
146 private:
147  /// Return type of this method.
148  QualType MethodDeclType;
149 
150  /// Type source information for the return type.
151  TypeSourceInfo *ReturnTInfo;
152 
153  /// Array of ParmVarDecls for the formal parameters of this method
154  /// and optionally followed by selector locations.
155  void *ParamsAndSelLocs = nullptr;
156  unsigned NumParams = 0;
157 
158  /// List of attributes for this method declaration.
159  SourceLocation DeclEndLoc; // the location of the ';' or '{'.
160 
161  /// The following are only used for method definitions, null otherwise.
162  LazyDeclStmtPtr Body;
163 
164  /// SelfDecl - Decl for the implicit self parameter. This is lazily
165  /// constructed by createImplicitParams.
166  ImplicitParamDecl *SelfDecl = nullptr;
167 
168  /// CmdDecl - Decl for the implicit _cmd parameter. This is lazily
169  /// constructed by createImplicitParams.
170  ImplicitParamDecl *CmdDecl = nullptr;
171 
173  Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo,
174  DeclContext *contextDecl, bool isInstance = true,
175  bool isVariadic = false, bool isPropertyAccessor = false,
176  bool isSynthesizedAccessorStub = false,
177  bool isImplicitlyDeclared = false, bool isDefined = false,
178  ImplementationControl impControl = None,
179  bool HasRelatedResultType = false);
180 
181  SelectorLocationsKind getSelLocsKind() const {
182  return static_cast<SelectorLocationsKind>(ObjCMethodDeclBits.SelLocsKind);
183  }
184 
185  void setSelLocsKind(SelectorLocationsKind Kind) {
186  ObjCMethodDeclBits.SelLocsKind = Kind;
187  }
188 
189  bool hasStandardSelLocs() const {
190  return getSelLocsKind() != SelLoc_NonStandard;
191  }
192 
193  /// Get a pointer to the stored selector identifiers locations array.
194  /// No locations will be stored if HasStandardSelLocs is true.
195  SourceLocation *getStoredSelLocs() {
196  return reinterpret_cast<SourceLocation *>(getParams() + NumParams);
197  }
198  const SourceLocation *getStoredSelLocs() const {
199  return reinterpret_cast<const SourceLocation *>(getParams() + NumParams);
200  }
201 
202  /// Get a pointer to the stored selector identifiers locations array.
203  /// No locations will be stored if HasStandardSelLocs is true.
204  ParmVarDecl **getParams() {
205  return reinterpret_cast<ParmVarDecl **>(ParamsAndSelLocs);
206  }
207  const ParmVarDecl *const *getParams() const {
208  return reinterpret_cast<const ParmVarDecl *const *>(ParamsAndSelLocs);
209  }
210 
211  /// Get the number of stored selector identifiers locations.
212  /// No locations will be stored if HasStandardSelLocs is true.
213  unsigned getNumStoredSelLocs() const {
214  if (hasStandardSelLocs())
215  return 0;
216  return getNumSelectorLocs();
217  }
218 
219  void setParamsAndSelLocs(ASTContext &C,
220  ArrayRef<ParmVarDecl*> Params,
221  ArrayRef<SourceLocation> SelLocs);
222 
223  /// A definition will return its interface declaration.
224  /// An interface declaration will return its definition.
225  /// Otherwise it will return itself.
226  ObjCMethodDecl *getNextRedeclarationImpl() override;
227 
228 public:
229  friend class ASTDeclReader;
230  friend class ASTDeclWriter;
231 
232  static ObjCMethodDecl *
233  Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc,
234  Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo,
235  DeclContext *contextDecl, bool isInstance = true,
236  bool isVariadic = false, bool isPropertyAccessor = false,
237  bool isSynthesizedAccessorStub = false,
238  bool isImplicitlyDeclared = false, bool isDefined = false,
239  ImplementationControl impControl = None,
240  bool HasRelatedResultType = false);
241 
242  static ObjCMethodDecl *CreateDeserialized(ASTContext &C, unsigned ID);
243 
244  ObjCMethodDecl *getCanonicalDecl() override;
246  return const_cast<ObjCMethodDecl*>(this)->getCanonicalDecl();
247  }
248 
250  return static_cast<ObjCDeclQualifier>(ObjCMethodDeclBits.objcDeclQualifier);
251  }
252 
254  ObjCMethodDeclBits.objcDeclQualifier = QV;
255  }
256 
257  /// Determine whether this method has a result type that is related
258  /// to the message receiver's type.
259  bool hasRelatedResultType() const {
260  return ObjCMethodDeclBits.RelatedResultType;
261  }
262 
263  /// Note whether this method has a related result type.
264  void setRelatedResultType(bool RRT = true) {
265  ObjCMethodDeclBits.RelatedResultType = RRT;
266  }
267 
268  /// True if this is a method redeclaration in the same interface.
269  bool isRedeclaration() const { return ObjCMethodDeclBits.IsRedeclaration; }
270  void setIsRedeclaration(bool RD) { ObjCMethodDeclBits.IsRedeclaration = RD; }
271  void setAsRedeclaration(const ObjCMethodDecl *PrevMethod);
272 
273  /// True if redeclared in the same interface.
274  bool hasRedeclaration() const { return ObjCMethodDeclBits.HasRedeclaration; }
275  void setHasRedeclaration(bool HRD) const {
276  ObjCMethodDeclBits.HasRedeclaration = HRD;
277  }
278 
279  /// Returns the location where the declarator ends. It will be
280  /// the location of ';' for a method declaration and the location of '{'
281  /// for a method definition.
282  SourceLocation getDeclaratorEndLoc() const { return DeclEndLoc; }
283 
284  // Location information, modeled after the Stmt API.
285  SourceLocation getBeginLoc() const LLVM_READONLY { return getLocation(); }
286  SourceLocation getEndLoc() const LLVM_READONLY;
287  SourceRange getSourceRange() const override LLVM_READONLY {
288  return SourceRange(getLocation(), getEndLoc());
289  }
290 
292  if (isImplicit())
293  return getBeginLoc();
294  return getSelectorLoc(0);
295  }
296 
297  SourceLocation getSelectorLoc(unsigned Index) const {
298  assert(Index < getNumSelectorLocs() && "Index out of range!");
299  if (hasStandardSelLocs())
300  return getStandardSelectorLoc(Index, getSelector(),
301  getSelLocsKind() == SelLoc_StandardWithSpace,
302  parameters(),
303  DeclEndLoc);
304  return getStoredSelLocs()[Index];
305  }
306 
308 
309  unsigned getNumSelectorLocs() const {
310  if (isImplicit())
311  return 0;
312  Selector Sel = getSelector();
313  if (Sel.isUnarySelector())
314  return 1;
315  return Sel.getNumArgs();
316  }
317 
320  return const_cast<ObjCMethodDecl*>(this)->getClassInterface();
321  }
322 
323  /// If this method is declared or implemented in a category, return
324  /// that category.
326  const ObjCCategoryDecl *getCategory() const {
327  return const_cast<ObjCMethodDecl*>(this)->getCategory();
328  }
329 
331 
332  QualType getReturnType() const { return MethodDeclType; }
333  void setReturnType(QualType T) { MethodDeclType = T; }
335 
336  /// Determine the type of an expression that sends a message to this
337  /// function. This replaces the type parameters with the types they would
338  /// get if the receiver was parameterless (e.g. it may replace the type
339  /// parameter with 'id').
340  QualType getSendResultType() const;
341 
342  /// Determine the type of an expression that sends a message to this
343  /// function with the given receiver type.
344  QualType getSendResultType(QualType receiverType) const;
345 
346  TypeSourceInfo *getReturnTypeSourceInfo() const { return ReturnTInfo; }
347  void setReturnTypeSourceInfo(TypeSourceInfo *TInfo) { ReturnTInfo = TInfo; }
348 
349  // Iterator access to formal parameters.
350  unsigned param_size() const { return NumParams; }
351 
352  using param_const_iterator = const ParmVarDecl *const *;
353  using param_iterator = ParmVarDecl *const *;
354  using param_range = llvm::iterator_range<param_iterator>;
355  using param_const_range = llvm::iterator_range<param_const_iterator>;
356 
358  return param_const_iterator(getParams());
359  }
360 
362  return param_const_iterator(getParams() + NumParams);
363  }
364 
365  param_iterator param_begin() { return param_iterator(getParams()); }
366  param_iterator param_end() { return param_iterator(getParams() + NumParams); }
367 
368  // This method returns and of the parameters which are part of the selector
369  // name mangling requirements.
371  return param_begin() + getSelector().getNumArgs();
372  }
373 
374  // ArrayRef access to formal parameters. This should eventually
375  // replace the iterator interface above.
377  return llvm::makeArrayRef(const_cast<ParmVarDecl**>(getParams()),
378  NumParams);
379  }
380 
381  ParmVarDecl *getParamDecl(unsigned Idx) {
382  assert(Idx < NumParams && "Index out of bounds!");
383  return getParams()[Idx];
384  }
385  const ParmVarDecl *getParamDecl(unsigned Idx) const {
386  return const_cast<ObjCMethodDecl *>(this)->getParamDecl(Idx);
387  }
388 
389  /// Sets the method's parameters and selector source locations.
390  /// If the method is implicit (not coming from source) \p SelLocs is
391  /// ignored.
393  ArrayRef<ParmVarDecl*> Params,
394  ArrayRef<SourceLocation> SelLocs = llvm::None);
395 
396  // Iterator access to parameter types.
397  struct GetTypeFn {
398  QualType operator()(const ParmVarDecl *PD) const { return PD->getType(); }
399  };
400 
401  using param_type_iterator =
402  llvm::mapped_iterator<param_const_iterator, GetTypeFn>;
403 
405  return llvm::map_iterator(param_begin(), GetTypeFn());
406  }
407 
409  return llvm::map_iterator(param_end(), GetTypeFn());
410  }
411 
412  /// createImplicitParams - Used to lazily create the self and cmd
413  /// implicit parameters. This must be called prior to using getSelfDecl()
414  /// or getCmdDecl(). The call is ignored if the implicit parameters
415  /// have already been created.
416  void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID);
417 
418  /// \return the type for \c self and set \arg selfIsPseudoStrong and
419  /// \arg selfIsConsumed accordingly.
420  QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID,
421  bool &selfIsPseudoStrong, bool &selfIsConsumed) const;
422 
423  ImplicitParamDecl * getSelfDecl() const { return SelfDecl; }
424  void setSelfDecl(ImplicitParamDecl *SD) { SelfDecl = SD; }
425  ImplicitParamDecl * getCmdDecl() const { return CmdDecl; }
426  void setCmdDecl(ImplicitParamDecl *CD) { CmdDecl = CD; }
427 
428  /// Determines the family of this method.
430 
431  bool isInstanceMethod() const { return ObjCMethodDeclBits.IsInstance; }
432  void setInstanceMethod(bool isInst) {
433  ObjCMethodDeclBits.IsInstance = isInst;
434  }
435 
436  bool isVariadic() const { return ObjCMethodDeclBits.IsVariadic; }
437  void setVariadic(bool isVar) { ObjCMethodDeclBits.IsVariadic = isVar; }
438 
439  bool isClassMethod() const { return !isInstanceMethod(); }
440 
441  bool isPropertyAccessor() const {
442  return ObjCMethodDeclBits.IsPropertyAccessor;
443  }
444 
445  void setPropertyAccessor(bool isAccessor) {
446  ObjCMethodDeclBits.IsPropertyAccessor = isAccessor;
447  }
448 
450  return ObjCMethodDeclBits.IsSynthesizedAccessorStub;
451  }
452 
454  ObjCMethodDeclBits.IsSynthesizedAccessorStub = isSynthesizedAccessorStub;
455  }
456 
457  bool isDefined() const { return ObjCMethodDeclBits.IsDefined; }
458  void setDefined(bool isDefined) { ObjCMethodDeclBits.IsDefined = isDefined; }
459 
460  /// Whether this method overrides any other in the class hierarchy.
461  ///
462  /// A method is said to override any method in the class's
463  /// base classes, its protocols, or its categories' protocols, that has
464  /// the same selector and is of the same kind (class or instance).
465  /// A method in an implementation is not considered as overriding the same
466  /// method in the interface or its categories.
467  bool isOverriding() const { return ObjCMethodDeclBits.IsOverriding; }
468  void setOverriding(bool IsOver) { ObjCMethodDeclBits.IsOverriding = IsOver; }
469 
470  /// Return overridden methods for the given \p Method.
471  ///
472  /// An ObjC method is considered to override any method in the class's
473  /// base classes (and base's categories), its protocols, or its categories'
474  /// protocols, that has
475  /// the same selector and is of the same kind (class or instance).
476  /// A method in an implementation is not considered as overriding the same
477  /// method in the interface or its categories.
479  SmallVectorImpl<const ObjCMethodDecl *> &Overridden) const;
480 
481  /// True if the method was a definition but its body was skipped.
482  bool hasSkippedBody() const { return ObjCMethodDeclBits.HasSkippedBody; }
483  void setHasSkippedBody(bool Skipped = true) {
484  ObjCMethodDeclBits.HasSkippedBody = Skipped;
485  }
486 
487  /// True if the method is tagged as objc_direct
488  bool isDirectMethod() const;
489 
490  /// True if the method has a parameter that's destroyed in the callee.
491  bool hasParamDestroyedInCallee() const;
492 
493  /// Returns the property associated with this method's selector.
494  ///
495  /// Note that even if this particular method is not marked as a property
496  /// accessor, it is still possible for it to match a property declared in a
497  /// superclass. Pass \c false if you only want to check the current class.
498  const ObjCPropertyDecl *findPropertyDecl(bool CheckOverrides = true) const;
499 
500  // Related to protocols declared in \@protocol
502  ObjCMethodDeclBits.DeclImplementation = ic;
503  }
504 
506  return ImplementationControl(ObjCMethodDeclBits.DeclImplementation);
507  }
508 
509  bool isOptional() const {
511  }
512 
513  /// Returns true if this specific method declaration is marked with the
514  /// designated initializer attribute.
516 
517  /// Returns true if the method selector resolves to a designated initializer
518  /// in the class's interface.
519  ///
520  /// \param InitMethod if non-null and the function returns true, it receives
521  /// the method declaration that was marked with the designated initializer
522  /// attribute.
524  const ObjCMethodDecl **InitMethod = nullptr) const;
525 
526  /// Determine whether this method has a body.
527  bool hasBody() const override { return Body.isValid(); }
528 
529  /// Retrieve the body of this method, if it has one.
530  Stmt *getBody() const override;
531 
532  void setLazyBody(uint64_t Offset) { Body = Offset; }
533 
535  void setBody(Stmt *B) { Body = B; }
536 
537  /// Returns whether this specific method is a definition.
538  bool isThisDeclarationADefinition() const { return hasBody(); }
539 
540  /// Is this method defined in the NSObject base class?
541  bool definedInNSObject(const ASTContext &) const;
542 
543  // Implement isa/cast/dyncast/etc.
544  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
545  static bool classofKind(Kind K) { return K == ObjCMethod; }
546 
548  return static_cast<DeclContext *>(const_cast<ObjCMethodDecl*>(D));
549  }
550 
552  return static_cast<ObjCMethodDecl *>(const_cast<DeclContext*>(DC));
553  }
554 };
555 
556 /// Describes the variance of a given generic parameter.
557 enum class ObjCTypeParamVariance : uint8_t {
558  /// The parameter is invariant: must match exactly.
559  Invariant,
560 
561  /// The parameter is covariant, e.g., X<T> is a subtype of X<U> when
562  /// the type parameter is covariant and T is a subtype of U.
563  Covariant,
564 
565  /// The parameter is contravariant, e.g., X<T> is a subtype of X<U>
566  /// when the type parameter is covariant and U is a subtype of T.
568 };
569 
570 /// Represents the declaration of an Objective-C type parameter.
571 ///
572 /// \code
573 /// @interface NSDictionary<Key : id<NSCopying>, Value>
574 /// @end
575 /// \endcode
576 ///
577 /// In the example above, both \c Key and \c Value are represented by
578 /// \c ObjCTypeParamDecl. \c Key has an explicit bound of \c id<NSCopying>,
579 /// while \c Value gets an implicit bound of \c id.
580 ///
581 /// Objective-C type parameters are typedef-names in the grammar,
583  /// Index of this type parameter in the type parameter list.
584  unsigned Index : 14;
585 
586  /// The variance of the type parameter.
587  unsigned Variance : 2;
588 
589  /// The location of the variance, if any.
590  SourceLocation VarianceLoc;
591 
592  /// The location of the ':', which will be valid when the bound was
593  /// explicitly specified.
594  SourceLocation ColonLoc;
595 
597  ObjCTypeParamVariance variance, SourceLocation varianceLoc,
598  unsigned index,
600  SourceLocation colonLoc, TypeSourceInfo *boundInfo)
601  : TypedefNameDecl(ObjCTypeParam, ctx, dc, nameLoc, nameLoc, name,
602  boundInfo),
603  Index(index), Variance(static_cast<unsigned>(variance)),
604  VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
605 
606  void anchor() override;
607 
608 public:
609  friend class ASTDeclReader;
610  friend class ASTDeclWriter;
611 
613  ObjCTypeParamVariance variance,
614  SourceLocation varianceLoc,
615  unsigned index,
616  SourceLocation nameLoc,
618  SourceLocation colonLoc,
619  TypeSourceInfo *boundInfo);
620  static ObjCTypeParamDecl *CreateDeserialized(ASTContext &ctx, unsigned ID);
621 
622  SourceRange getSourceRange() const override LLVM_READONLY;
623 
624  /// Determine the variance of this type parameter.
626  return static_cast<ObjCTypeParamVariance>(Variance);
627  }
628 
629  /// Set the variance of this type parameter.
631  Variance = static_cast<unsigned>(variance);
632  }
633 
634  /// Retrieve the location of the variance keyword.
635  SourceLocation getVarianceLoc() const { return VarianceLoc; }
636 
637  /// Retrieve the index into its type parameter list.
638  unsigned getIndex() const { return Index; }
639 
640  /// Whether this type parameter has an explicitly-written type bound, e.g.,
641  /// "T : NSView".
642  bool hasExplicitBound() const { return ColonLoc.isValid(); }
643 
644  /// Retrieve the location of the ':' separating the type parameter name
645  /// from the explicitly-specified bound.
646  SourceLocation getColonLoc() const { return ColonLoc; }
647 
648  // Implement isa/cast/dyncast/etc.
649  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
650  static bool classofKind(Kind K) { return K == ObjCTypeParam; }
651 };
652 
653 /// Stores a list of Objective-C type parameters for a parameterized class
654 /// or a category/extension thereof.
655 ///
656 /// \code
657 /// @interface NSArray<T> // stores the <T>
658 /// @end
659 /// \endcode
660 class ObjCTypeParamList final
661  : private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
662  /// Location of the left and right angle brackets.
663  SourceRange Brackets;
664  /// The number of parameters in the list, which are tail-allocated.
665  unsigned NumParams;
666 
669  SourceLocation rAngleLoc);
670 
671 public:
673 
674  /// Create a new Objective-C type parameter list.
675  static ObjCTypeParamList *create(ASTContext &ctx,
676  SourceLocation lAngleLoc,
678  SourceLocation rAngleLoc);
679 
680  /// Iterate through the type parameters in the list.
682 
683  iterator begin() { return getTrailingObjects<ObjCTypeParamDecl *>(); }
684 
685  iterator end() { return begin() + size(); }
686 
687  /// Determine the number of type parameters in this list.
688  unsigned size() const { return NumParams; }
689 
690  // Iterate through the type parameters in the list.
692 
694  return getTrailingObjects<ObjCTypeParamDecl *>();
695  }
696 
697  const_iterator end() const {
698  return begin() + size();
699  }
700 
702  assert(size() > 0 && "empty Objective-C type parameter list");
703  return *begin();
704  }
705 
707  assert(size() > 0 && "empty Objective-C type parameter list");
708  return *(end() - 1);
709  }
710 
711  SourceLocation getLAngleLoc() const { return Brackets.getBegin(); }
712  SourceLocation getRAngleLoc() const { return Brackets.getEnd(); }
713  SourceRange getSourceRange() const { return Brackets; }
714 
715  /// Gather the default set of type arguments to be substituted for
716  /// these type parameters when dealing with an unspecialized type.
717  void gatherDefaultTypeArgs(SmallVectorImpl<QualType> &typeArgs) const;
718 };
719 
720 enum class ObjCPropertyQueryKind : uint8_t {
721  OBJC_PR_query_unknown = 0x00,
724 };
725 
726 /// Represents one property declaration in an Objective-C interface.
727 ///
728 /// For example:
729 /// \code{.mm}
730 /// \@property (assign, readwrite) int MyProperty;
731 /// \endcode
732 class ObjCPropertyDecl : public NamedDecl {
733  void anchor() override;
734 
735 public:
738 
739 private:
740  // location of \@property
741  SourceLocation AtLoc;
742 
743  // location of '(' starting attribute list or null.
744  SourceLocation LParenLoc;
745 
746  QualType DeclType;
747  TypeSourceInfo *DeclTypeSourceInfo;
748  unsigned PropertyAttributes : NumObjCPropertyAttrsBits;
749  unsigned PropertyAttributesAsWritten : NumObjCPropertyAttrsBits;
750 
751  // \@required/\@optional
752  unsigned PropertyImplementation : 2;
753 
754  // getter name of NULL if no getter
755  Selector GetterName;
756 
757  // setter name of NULL if no setter
758  Selector SetterName;
759 
760  // location of the getter attribute's value
761  SourceLocation GetterNameLoc;
762 
763  // location of the setter attribute's value
764  SourceLocation SetterNameLoc;
765 
766  // Declaration of getter instance method
767  ObjCMethodDecl *GetterMethodDecl = nullptr;
768 
769  // Declaration of setter instance method
770  ObjCMethodDecl *SetterMethodDecl = nullptr;
771 
772  // Synthesize ivar for this property
773  ObjCIvarDecl *PropertyIvarDecl = nullptr;
774 
776  SourceLocation AtLocation, SourceLocation LParenLocation,
777  QualType T, TypeSourceInfo *TSI, PropertyControl propControl)
778  : NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
779  LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
780  PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
781  PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
782  PropertyImplementation(propControl) {}
783 
784 public:
785  static ObjCPropertyDecl *
786  Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
787  SourceLocation AtLocation, SourceLocation LParenLocation, QualType T,
788  TypeSourceInfo *TSI, PropertyControl propControl = None);
789 
790  static ObjCPropertyDecl *CreateDeserialized(ASTContext &C, unsigned ID);
791 
792  SourceLocation getAtLoc() const { return AtLoc; }
793  void setAtLoc(SourceLocation L) { AtLoc = L; }
794 
795  SourceLocation getLParenLoc() const { return LParenLoc; }
796  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
797 
798  TypeSourceInfo *getTypeSourceInfo() const { return DeclTypeSourceInfo; }
799 
800  QualType getType() const { return DeclType; }
801 
803  DeclType = T;
804  DeclTypeSourceInfo = TSI;
805  }
806 
807  /// Retrieve the type when this property is used with a specific base object
808  /// type.
809  QualType getUsageType(QualType objectType) const;
810 
812  return ObjCPropertyAttribute::Kind(PropertyAttributes);
813  }
814 
816  PropertyAttributes |= PRVal;
817  }
818 
819  void overwritePropertyAttributes(unsigned PRVal) {
820  PropertyAttributes = PRVal;
821  }
822 
824  return ObjCPropertyAttribute::Kind(PropertyAttributesAsWritten);
825  }
826 
828  PropertyAttributesAsWritten = PRVal;
829  }
830 
831  // Helper methods for accessing attributes.
832 
833  /// isReadOnly - Return true iff the property has a setter.
834  bool isReadOnly() const {
835  return (PropertyAttributes & ObjCPropertyAttribute::kind_readonly);
836  }
837 
838  /// isAtomic - Return true if the property is atomic.
839  bool isAtomic() const {
840  return (PropertyAttributes & ObjCPropertyAttribute::kind_atomic);
841  }
842 
843  /// isRetaining - Return true if the property retains its value.
844  bool isRetaining() const {
845  return (PropertyAttributes & (ObjCPropertyAttribute::kind_retain |
848  }
849 
850  bool isInstanceProperty() const { return !isClassProperty(); }
851  bool isClassProperty() const {
852  return PropertyAttributes & ObjCPropertyAttribute::kind_class;
853  }
854  bool isDirectProperty() const;
855 
859  }
860 
864  }
865 
866  /// getSetterKind - Return the method used for doing assignment in
867  /// the property setter. This is only valid if the property has been
868  /// defined to have a setter.
870  if (PropertyAttributes & ObjCPropertyAttribute::kind_strong)
871  return getType()->isBlockPointerType() ? Copy : Retain;
872  if (PropertyAttributes & ObjCPropertyAttribute::kind_retain)
873  return Retain;
874  if (PropertyAttributes & ObjCPropertyAttribute::kind_copy)
875  return Copy;
876  if (PropertyAttributes & ObjCPropertyAttribute::kind_weak)
877  return Weak;
878  return Assign;
879  }
880 
881  Selector getGetterName() const { return GetterName; }
882  SourceLocation getGetterNameLoc() const { return GetterNameLoc; }
883 
885  GetterName = Sel;
886  GetterNameLoc = Loc;
887  }
888 
889  Selector getSetterName() const { return SetterName; }
890  SourceLocation getSetterNameLoc() const { return SetterNameLoc; }
891 
893  SetterName = Sel;
894  SetterNameLoc = Loc;
895  }
896 
897  ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
898  void setGetterMethodDecl(ObjCMethodDecl *gDecl) { GetterMethodDecl = gDecl; }
899 
900  ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; }
901  void setSetterMethodDecl(ObjCMethodDecl *gDecl) { SetterMethodDecl = gDecl; }
902 
903  // Related to \@optional/\@required declared in \@protocol
905  PropertyImplementation = pc;
906  }
907 
909  return PropertyControl(PropertyImplementation);
910  }
911 
912  bool isOptional() const {
914  }
915 
917  PropertyIvarDecl = Ivar;
918  }
919 
921  return PropertyIvarDecl;
922  }
923 
924  SourceRange getSourceRange() const override LLVM_READONLY {
925  return SourceRange(AtLoc, getLocation());
926  }
927 
928  /// Get the default name of the synthesized ivar.
930 
931  /// Lookup a property by name in the specified DeclContext.
933  const IdentifierInfo *propertyID,
934  ObjCPropertyQueryKind queryKind);
935 
936  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
937  static bool classofKind(Kind K) { return K == ObjCProperty; }
938 };
939 
940 /// ObjCContainerDecl - Represents a container for method declarations.
941 /// Current sub-classes are ObjCInterfaceDecl, ObjCCategoryDecl,
942 /// ObjCProtocolDecl, and ObjCImplDecl.
943 ///
944 class ObjCContainerDecl : public NamedDecl, public DeclContext {
945  // This class stores some data in DeclContext::ObjCContainerDeclBits
946  // to save some space. Use the provided accessors to access it.
947 
948  // These two locations in the range mark the end of the method container.
949  // The first points to the '@' token, and the second to the 'end' token.
950  SourceRange AtEnd;
951 
952  void anchor() override;
953 
954 public:
956  SourceLocation nameLoc, SourceLocation atStartLoc);
957 
958  // Iterator access to instance/class properties.
960  using prop_range =
961  llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>;
962 
964 
966  return prop_iterator(decls_begin());
967  }
968 
970  return prop_iterator(decls_end());
971  }
972 
973  using instprop_iterator =
974  filtered_decl_iterator<ObjCPropertyDecl,
976  using instprop_range = llvm::iterator_range<instprop_iterator>;
977 
980  }
981 
983  return instprop_iterator(decls_begin());
984  }
985 
987  return instprop_iterator(decls_end());
988  }
989 
990  using classprop_iterator =
991  filtered_decl_iterator<ObjCPropertyDecl,
993  using classprop_range = llvm::iterator_range<classprop_iterator>;
994 
997  }
998 
1000  return classprop_iterator(decls_begin());
1001  }
1002 
1004  return classprop_iterator(decls_end());
1005  }
1006 
1007  // Iterator access to instance/class methods.
1009  using method_range =
1010  llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>;
1011 
1013  return method_range(meth_begin(), meth_end());
1014  }
1015 
1017  return method_iterator(decls_begin());
1018  }
1019 
1021  return method_iterator(decls_end());
1022  }
1023 
1024  using instmeth_iterator =
1025  filtered_decl_iterator<ObjCMethodDecl,
1027  using instmeth_range = llvm::iterator_range<instmeth_iterator>;
1028 
1031  }
1032 
1034  return instmeth_iterator(decls_begin());
1035  }
1036 
1038  return instmeth_iterator(decls_end());
1039  }
1040 
1041  using classmeth_iterator =
1042  filtered_decl_iterator<ObjCMethodDecl,
1044  using classmeth_range = llvm::iterator_range<classmeth_iterator>;
1045 
1048  }
1049 
1051  return classmeth_iterator(decls_begin());
1052  }
1053 
1055  return classmeth_iterator(decls_end());
1056  }
1057 
1058  // Get the local instance/class method declared in this interface.
1059  ObjCMethodDecl *getMethod(Selector Sel, bool isInstance,
1060  bool AllowHidden = false) const;
1061 
1063  bool AllowHidden = false) const {
1064  return getMethod(Sel, true/*isInstance*/, AllowHidden);
1065  }
1066 
1067  ObjCMethodDecl *getClassMethod(Selector Sel, bool AllowHidden = false) const {
1068  return getMethod(Sel, false/*isInstance*/, AllowHidden);
1069  }
1070 
1071  bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const;
1073 
1075  bool IsInstance) const;
1076 
1078  FindPropertyDeclaration(const IdentifierInfo *PropertyId,
1079  ObjCPropertyQueryKind QueryKind) const;
1080 
1081  using PropertyMap =
1082  llvm::DenseMap<std::pair<IdentifierInfo *, unsigned/*isClassProperty*/>,
1084  using ProtocolPropertySet = llvm::SmallDenseSet<const ObjCProtocolDecl *, 8>;
1086 
1087  /// This routine collects list of properties to be implemented in the class.
1088  /// This includes, class's and its conforming protocols' properties.
1089  /// Note, the superclass's properties are not included in the list.
1091  PropertyDeclOrder &PO) const {}
1092 
1094 
1096  ObjCContainerDeclBits.AtStart = Loc;
1097  }
1098 
1099  // Marks the end of the container.
1100  SourceRange getAtEndRange() const { return AtEnd; }
1101 
1102  void setAtEndRange(SourceRange atEnd) { AtEnd = atEnd; }
1103 
1104  SourceRange getSourceRange() const override LLVM_READONLY {
1105  return SourceRange(getAtStartLoc(), getAtEndRange().getEnd());
1106  }
1107 
1108  // Implement isa/cast/dyncast/etc.
1109  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1110 
1111  static bool classofKind(Kind K) {
1112  return K >= firstObjCContainer &&
1113  K <= lastObjCContainer;
1114  }
1115 
1117  return static_cast<DeclContext *>(const_cast<ObjCContainerDecl*>(D));
1118  }
1119 
1121  return static_cast<ObjCContainerDecl *>(const_cast<DeclContext*>(DC));
1122  }
1123 };
1124 
1125 /// Represents an ObjC class declaration.
1126 ///
1127 /// For example:
1128 ///
1129 /// \code
1130 /// // MostPrimitive declares no super class (not particularly useful).
1131 /// \@interface MostPrimitive
1132 /// // no instance variables or methods.
1133 /// \@end
1134 ///
1135 /// // NSResponder inherits from NSObject & implements NSCoding (a protocol).
1136 /// \@interface NSResponder : NSObject <NSCoding>
1137 /// { // instance variables are represented by ObjCIvarDecl.
1138 /// id nextResponder; // nextResponder instance variable.
1139 /// }
1140 /// - (NSResponder *)nextResponder; // return a pointer to NSResponder.
1141 /// - (void)mouseMoved:(NSEvent *)theEvent; // return void, takes a pointer
1142 /// \@end // to an NSEvent.
1143 /// \endcode
1144 ///
1145 /// Unlike C/C++, forward class declarations are accomplished with \@class.
1146 /// Unlike C/C++, \@class allows for a list of classes to be forward declared.
1147 /// Unlike C++, ObjC is a single-rooted class model. In Cocoa, classes
1148 /// typically inherit from NSObject (an exception is NSProxy).
1149 ///
1151  , public Redeclarable<ObjCInterfaceDecl> {
1152  friend class ASTContext;
1153 
1154  /// TypeForDecl - This indicates the Type object that represents this
1155  /// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType
1156  mutable const Type *TypeForDecl = nullptr;
1157 
1158  struct DefinitionData {
1159  /// The definition of this class, for quick access from any
1160  /// declaration.
1161  ObjCInterfaceDecl *Definition = nullptr;
1162 
1163  /// When non-null, this is always an ObjCObjectType.
1164  TypeSourceInfo *SuperClassTInfo = nullptr;
1165 
1166  /// Protocols referenced in the \@interface declaration
1167  ObjCProtocolList ReferencedProtocols;
1168 
1169  /// Protocols reference in both the \@interface and class extensions.
1170  ObjCList<ObjCProtocolDecl> AllReferencedProtocols;
1171 
1172  /// List of categories and class extensions defined for this class.
1173  ///
1174  /// Categories are stored as a linked list in the AST, since the categories
1175  /// and class extensions come long after the initial interface declaration,
1176  /// and we avoid dynamically-resized arrays in the AST wherever possible.
1177  ObjCCategoryDecl *CategoryList = nullptr;
1178 
1179  /// IvarList - List of all ivars defined by this class; including class
1180  /// extensions and implementation. This list is built lazily.
1181  ObjCIvarDecl *IvarList = nullptr;
1182 
1183  /// Indicates that the contents of this Objective-C class will be
1184  /// completed by the external AST source when required.
1185  mutable unsigned ExternallyCompleted : 1;
1186 
1187  /// Indicates that the ivar cache does not yet include ivars
1188  /// declared in the implementation.
1189  mutable unsigned IvarListMissingImplementation : 1;
1190 
1191  /// Indicates that this interface decl contains at least one initializer
1192  /// marked with the 'objc_designated_initializer' attribute.
1193  unsigned HasDesignatedInitializers : 1;
1194 
1195  enum InheritedDesignatedInitializersState {
1196  /// We didn't calculate whether the designated initializers should be
1197  /// inherited or not.
1198  IDI_Unknown = 0,
1199 
1200  /// Designated initializers are inherited for the super class.
1201  IDI_Inherited = 1,
1202 
1203  /// The class does not inherit designated initializers.
1204  IDI_NotInherited = 2
1205  };
1206 
1207  /// One of the \c InheritedDesignatedInitializersState enumeratos.
1208  mutable unsigned InheritedDesignatedInitializers : 2;
1209 
1210  /// The location of the last location in this declaration, before
1211  /// the properties/methods. For example, this will be the '>', '}', or
1212  /// identifier,
1213  SourceLocation EndLoc;
1214 
1215  DefinitionData()
1216  : ExternallyCompleted(false), IvarListMissingImplementation(true),
1217  HasDesignatedInitializers(false),
1218  InheritedDesignatedInitializers(IDI_Unknown) {}
1219  };
1220 
1221  /// The type parameters associated with this class, if any.
1222  ObjCTypeParamList *TypeParamList = nullptr;
1223 
1224  /// Contains a pointer to the data associated with this class,
1225  /// which will be NULL if this class has not yet been defined.
1226  ///
1227  /// The bit indicates when we don't need to check for out-of-date
1228  /// declarations. It will be set unless modules are enabled.
1229  llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1230 
1231  ObjCInterfaceDecl(const ASTContext &C, DeclContext *DC, SourceLocation AtLoc,
1232  IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1233  SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1234  bool IsInternal);
1235 
1236  void anchor() override;
1237 
1238  void LoadExternalDefinition() const;
1239 
1240  DefinitionData &data() const {
1241  assert(Data.getPointer() && "Declaration has no definition!");
1242  return *Data.getPointer();
1243  }
1244 
1245  /// Allocate the definition data for this class.
1246  void allocateDefinitionData();
1247 
1248  using redeclarable_base = Redeclarable<ObjCInterfaceDecl>;
1249 
1250  ObjCInterfaceDecl *getNextRedeclarationImpl() override {
1251  return getNextRedeclaration();
1252  }
1253 
1254  ObjCInterfaceDecl *getPreviousDeclImpl() override {
1255  return getPreviousDecl();
1256  }
1257 
1258  ObjCInterfaceDecl *getMostRecentDeclImpl() override {
1259  return getMostRecentDecl();
1260  }
1261 
1262 public:
1263  static ObjCInterfaceDecl *Create(const ASTContext &C, DeclContext *DC,
1264  SourceLocation atLoc,
1265  IdentifierInfo *Id,
1266  ObjCTypeParamList *typeParamList,
1267  ObjCInterfaceDecl *PrevDecl,
1268  SourceLocation ClassLoc = SourceLocation(),
1269  bool isInternal = false);
1270 
1271  static ObjCInterfaceDecl *CreateDeserialized(const ASTContext &C, unsigned ID);
1272 
1273  /// Retrieve the type parameters of this class.
1274  ///
1275  /// This function looks for a type parameter list for the given
1276  /// class; if the class has been declared (with \c \@class) but not
1277  /// defined (with \c \@interface), it will search for a declaration that
1278  /// has type parameters, skipping any declarations that do not.
1279  ObjCTypeParamList *getTypeParamList() const;
1280 
1281  /// Set the type parameters of this class.
1282  ///
1283  /// This function is used by the AST importer, which must import the type
1284  /// parameters after creating their DeclContext to avoid loops.
1285  void setTypeParamList(ObjCTypeParamList *TPL);
1286 
1287  /// Retrieve the type parameters written on this particular declaration of
1288  /// the class.
1290  return TypeParamList;
1291  }
1292 
1293  SourceRange getSourceRange() const override LLVM_READONLY {
1296 
1297  return SourceRange(getAtStartLoc(), getLocation());
1298  }
1299 
1300  /// Indicate that this Objective-C class is complete, but that
1301  /// the external AST source will be responsible for filling in its contents
1302  /// when a complete class is required.
1303  void setExternallyCompleted();
1304 
1305  /// Indicate that this interface decl contains at least one initializer
1306  /// marked with the 'objc_designated_initializer' attribute.
1308 
1309  /// Returns true if this interface decl contains at least one initializer
1310  /// marked with the 'objc_designated_initializer' attribute.
1311  bool hasDesignatedInitializers() const;
1312 
1313  /// Returns true if this interface decl declares a designated initializer
1314  /// or it inherites one from its super class.
1316  return hasDesignatedInitializers() || inheritsDesignatedInitializers();
1317  }
1318 
1320  assert(hasDefinition() && "Caller did not check for forward reference!");
1321  if (data().ExternallyCompleted)
1322  LoadExternalDefinition();
1323 
1324  return data().ReferencedProtocols;
1325  }
1326 
1329 
1331 
1332  // Get the local instance/class method declared in a category.
1335 
1336  ObjCMethodDecl *getCategoryMethod(Selector Sel, bool isInstance) const {
1337  return isInstance ? getCategoryInstanceMethod(Sel)
1338  : getCategoryClassMethod(Sel);
1339  }
1340 
1342  using protocol_range = llvm::iterator_range<protocol_iterator>;
1343 
1346  }
1347 
1349  // FIXME: Should make sure no callers ever do this.
1350  if (!hasDefinition())
1351  return protocol_iterator();
1352 
1353  if (data().ExternallyCompleted)
1354  LoadExternalDefinition();
1355 
1356  return data().ReferencedProtocols.begin();
1357  }
1358 
1360  // FIXME: Should make sure no callers ever do this.
1361  if (!hasDefinition())
1362  return protocol_iterator();
1363 
1364  if (data().ExternallyCompleted)
1365  LoadExternalDefinition();
1366 
1367  return data().ReferencedProtocols.end();
1368  }
1369 
1371  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
1372 
1375  }
1376 
1378  // FIXME: Should make sure no callers ever do this.
1379  if (!hasDefinition())
1380  return protocol_loc_iterator();
1381 
1382  if (data().ExternallyCompleted)
1383  LoadExternalDefinition();
1384 
1385  return data().ReferencedProtocols.loc_begin();
1386  }
1387 
1389  // FIXME: Should make sure no callers ever do this.
1390  if (!hasDefinition())
1391  return protocol_loc_iterator();
1392 
1393  if (data().ExternallyCompleted)
1394  LoadExternalDefinition();
1395 
1396  return data().ReferencedProtocols.loc_end();
1397  }
1398 
1400  using all_protocol_range = llvm::iterator_range<all_protocol_iterator>;
1401 
1405  }
1406 
1408  // FIXME: Should make sure no callers ever do this.
1409  if (!hasDefinition())
1410  return all_protocol_iterator();
1411 
1412  if (data().ExternallyCompleted)
1413  LoadExternalDefinition();
1414 
1415  return data().AllReferencedProtocols.empty()
1416  ? protocol_begin()
1417  : data().AllReferencedProtocols.begin();
1418  }
1419 
1421  // FIXME: Should make sure no callers ever do this.
1422  if (!hasDefinition())
1423  return all_protocol_iterator();
1424 
1425  if (data().ExternallyCompleted)
1426  LoadExternalDefinition();
1427 
1428  return data().AllReferencedProtocols.empty()
1429  ? protocol_end()
1430  : data().AllReferencedProtocols.end();
1431  }
1432 
1434  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
1435 
1436  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
1437 
1439  if (const ObjCInterfaceDecl *Def = getDefinition())
1440  return ivar_iterator(Def->decls_begin());
1441 
1442  // FIXME: Should make sure no callers ever do this.
1443  return ivar_iterator();
1444  }
1445 
1447  if (const ObjCInterfaceDecl *Def = getDefinition())
1448  return ivar_iterator(Def->decls_end());
1449 
1450  // FIXME: Should make sure no callers ever do this.
1451  return ivar_iterator();
1452  }
1453 
1454  unsigned ivar_size() const {
1455  return std::distance(ivar_begin(), ivar_end());
1456  }
1457 
1458  bool ivar_empty() const { return ivar_begin() == ivar_end(); }
1459 
1462  // Even though this modifies IvarList, it's conceptually const:
1463  // the ivar chain is essentially a cached property of ObjCInterfaceDecl.
1464  return const_cast<ObjCInterfaceDecl *>(this)->all_declared_ivar_begin();
1465  }
1466  void setIvarList(ObjCIvarDecl *ivar) { data().IvarList = ivar; }
1467 
1468  /// setProtocolList - Set the list of protocols that this interface
1469  /// implements.
1470  void setProtocolList(ObjCProtocolDecl *const* List, unsigned Num,
1471  const SourceLocation *Locs, ASTContext &C) {
1472  data().ReferencedProtocols.set(List, Num, Locs, C);
1473  }
1474 
1475  /// mergeClassExtensionProtocolList - Merge class extension's protocol list
1476  /// into the protocol list for this class.
1478  unsigned Num,
1479  ASTContext &C);
1480 
1481  /// Produce a name to be used for class's metadata. It comes either via
1482  /// objc_runtime_name attribute or class name.
1483  StringRef getObjCRuntimeNameAsString() const;
1484 
1485  /// Returns the designated initializers for the interface.
1486  ///
1487  /// If this declaration does not have methods marked as designated
1488  /// initializers then the interface inherits the designated initializers of
1489  /// its super class.
1492 
1493  /// Returns true if the given selector is a designated initializer for the
1494  /// interface.
1495  ///
1496  /// If this declaration does not have methods marked as designated
1497  /// initializers then the interface inherits the designated initializers of
1498  /// its super class.
1499  ///
1500  /// \param InitMethod if non-null and the function returns true, it receives
1501  /// the method that was marked as a designated initializer.
1502  bool
1504  const ObjCMethodDecl **InitMethod = nullptr) const;
1505 
1506  /// Determine whether this particular declaration of this class is
1507  /// actually also a definition.
1509  return getDefinition() == this;
1510  }
1511 
1512  /// Determine whether this class has been defined.
1513  bool hasDefinition() const {
1514  // If the name of this class is out-of-date, bring it up-to-date, which
1515  // might bring in a definition.
1516  // Note: a null value indicates that we don't have a definition and that
1517  // modules are enabled.
1518  if (!Data.getOpaqueValue())
1520 
1521  return Data.getPointer();
1522  }
1523 
1524  /// Retrieve the definition of this class, or NULL if this class
1525  /// has been forward-declared (with \@class) but not yet defined (with
1526  /// \@interface).
1528  return hasDefinition()? Data.getPointer()->Definition : nullptr;
1529  }
1530 
1531  /// Retrieve the definition of this class, or NULL if this class
1532  /// has been forward-declared (with \@class) but not yet defined (with
1533  /// \@interface).
1535  return hasDefinition()? Data.getPointer()->Definition : nullptr;
1536  }
1537 
1538  /// Starts the definition of this Objective-C class, taking it from
1539  /// a forward declaration (\@class) to a definition (\@interface).
1540  void startDefinition();
1541 
1542  /// Retrieve the superclass type.
1544  if (TypeSourceInfo *TInfo = getSuperClassTInfo())
1545  return TInfo->getType()->castAs<ObjCObjectType>();
1546 
1547  return nullptr;
1548  }
1549 
1550  // Retrieve the type source information for the superclass.
1552  // FIXME: Should make sure no callers ever do this.
1553  if (!hasDefinition())
1554  return nullptr;
1555 
1556  if (data().ExternallyCompleted)
1557  LoadExternalDefinition();
1558 
1559  return data().SuperClassTInfo;
1560  }
1561 
1562  // Retrieve the declaration for the superclass of this class, which
1563  // does not include any type arguments that apply to the superclass.
1565 
1566  void setSuperClass(TypeSourceInfo *superClass) {
1567  data().SuperClassTInfo = superClass;
1568  }
1569 
1570  /// Iterator that walks over the list of categories, filtering out
1571  /// those that do not meet specific criteria.
1572  ///
1573  /// This class template is used for the various permutations of category
1574  /// and extension iterators.
1575  template<bool (*Filter)(ObjCCategoryDecl *)>
1577  ObjCCategoryDecl *Current = nullptr;
1578 
1579  void findAcceptableCategory();
1580 
1581  public:
1586  using iterator_category = std::input_iterator_tag;
1587 
1588  filtered_category_iterator() = default;
1590  : Current(Current) {
1591  findAcceptableCategory();
1592  }
1593 
1594  reference operator*() const { return Current; }
1595  pointer operator->() const { return Current; }
1596 
1598 
1600  filtered_category_iterator Tmp = *this;
1601  ++(*this);
1602  return Tmp;
1603  }
1604 
1607  return X.Current == Y.Current;
1608  }
1609 
1612  return X.Current != Y.Current;
1613  }
1614  };
1615 
1616 private:
1617  /// Test whether the given category is visible.
1618  ///
1619  /// Used in the \c visible_categories_iterator.
1620  static bool isVisibleCategory(ObjCCategoryDecl *Cat);
1621 
1622 public:
1623  /// Iterator that walks over the list of categories and extensions
1624  /// that are visible, i.e., not hidden in a non-imported submodule.
1627 
1628  using visible_categories_range =
1629  llvm::iterator_range<visible_categories_iterator>;
1630 
1634  }
1635 
1636  /// Retrieve an iterator to the beginning of the visible-categories
1637  /// list.
1640  }
1641 
1642  /// Retrieve an iterator to the end of the visible-categories list.
1644  return visible_categories_iterator();
1645  }
1646 
1647  /// Determine whether the visible-categories list is empty.
1650  }
1651 
1652 private:
1653  /// Test whether the given category... is a category.
1654  ///
1655  /// Used in the \c known_categories_iterator.
1656  static bool isKnownCategory(ObjCCategoryDecl *) { return true; }
1657 
1658 public:
1659  /// Iterator that walks over all of the known categories and
1660  /// extensions, including those that are hidden.
1662  using known_categories_range =
1663  llvm::iterator_range<known_categories_iterator>;
1664 
1668  }
1669 
1670  /// Retrieve an iterator to the beginning of the known-categories
1671  /// list.
1674  }
1675 
1676  /// Retrieve an iterator to the end of the known-categories list.
1678  return known_categories_iterator();
1679  }
1680 
1681  /// Determine whether the known-categories list is empty.
1682  bool known_categories_empty() const {
1684  }
1685 
1686 private:
1687  /// Test whether the given category is a visible extension.
1688  ///
1689  /// Used in the \c visible_extensions_iterator.
1690  static bool isVisibleExtension(ObjCCategoryDecl *Cat);
1691 
1692 public:
1693  /// Iterator that walks over all of the visible extensions, skipping
1694  /// any that are known but hidden.
1697 
1698  using visible_extensions_range =
1699  llvm::iterator_range<visible_extensions_iterator>;
1700 
1704  }
1705 
1706  /// Retrieve an iterator to the beginning of the visible-extensions
1707  /// list.
1710  }
1711 
1712  /// Retrieve an iterator to the end of the visible-extensions list.
1714  return visible_extensions_iterator();
1715  }
1716 
1717  /// Determine whether the visible-extensions list is empty.
1720  }
1721 
1722 private:
1723  /// Test whether the given category is an extension.
1724  ///
1725  /// Used in the \c known_extensions_iterator.
1726  static bool isKnownExtension(ObjCCategoryDecl *Cat);
1727 
1728 public:
1729  friend class ASTDeclReader;
1730  friend class ASTDeclWriter;
1731  friend class ASTReader;
1732 
1733  /// Iterator that walks over all of the known extensions.
1736  using known_extensions_range =
1737  llvm::iterator_range<known_extensions_iterator>;
1738 
1742  }
1743 
1744  /// Retrieve an iterator to the beginning of the known-extensions
1745  /// list.
1748  }
1749 
1750  /// Retrieve an iterator to the end of the known-extensions list.
1752  return known_extensions_iterator();
1753  }
1754 
1755  /// Determine whether the known-extensions list is empty.
1756  bool known_extensions_empty() const {
1758  }
1759 
1760  /// Retrieve the raw pointer to the start of the category/extension
1761  /// list.
1763  // FIXME: Should make sure no callers ever do this.
1764  if (!hasDefinition())
1765  return nullptr;
1766 
1767  if (data().ExternallyCompleted)
1768  LoadExternalDefinition();
1769 
1770  return data().CategoryList;
1771  }
1772 
1773  /// Set the raw pointer to the start of the category/extension
1774  /// list.
1776  data().CategoryList = category;
1777  }
1778 
1781  ObjCPropertyQueryKind QueryKind) const;
1782 
1784  PropertyDeclOrder &PO) const override;
1785 
1786  /// isSuperClassOf - Return true if this class is the specified class or is a
1787  /// super class of the specified interface class.
1788  bool isSuperClassOf(const ObjCInterfaceDecl *I) const {
1789  // If RHS is derived from LHS it is OK; else it is not OK.
1790  while (I != nullptr) {
1791  if (declaresSameEntity(this, I))
1792  return true;
1793 
1794  I = I->getSuperClass();
1795  }
1796  return false;
1797  }
1798 
1799  /// isArcWeakrefUnavailable - Checks for a class or one of its super classes
1800  /// to be incompatible with __weak references. Returns true if it is.
1801  bool isArcWeakrefUnavailable() const;
1802 
1803  /// isObjCRequiresPropertyDefs - Checks that a class or one of its super
1804  /// classes must not be auto-synthesized. Returns class decl. if it must not
1805  /// be; 0, otherwise.
1807 
1809  ObjCInterfaceDecl *&ClassDeclared);
1811  ObjCInterfaceDecl *ClassDeclared;
1812  return lookupInstanceVariable(IVarName, ClassDeclared);
1813  }
1814 
1816 
1817  // Lookup a method. First, we search locally. If a method isn't
1818  // found, we search referenced protocols and class categories.
1819  ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance,
1820  bool shallowCategoryLookup = false,
1821  bool followSuper = true,
1822  const ObjCCategoryDecl *C = nullptr) const;
1823 
1824  /// Lookup an instance method for a given selector.
1826  return lookupMethod(Sel, true/*isInstance*/);
1827  }
1828 
1829  /// Lookup a class method for a given selector.
1831  return lookupMethod(Sel, false/*isInstance*/);
1832  }
1833 
1835 
1836  /// Lookup a method in the classes implementation hierarchy.
1838  bool Instance=true) const;
1839 
1841  return lookupPrivateMethod(Sel, false);
1842  }
1843 
1844  /// Lookup a setter or getter in the class hierarchy,
1845  /// including in all categories except for category passed
1846  /// as argument.
1848  const ObjCCategoryDecl *Cat,
1849  bool IsClassProperty) const {
1850  return lookupMethod(Sel, !IsClassProperty/*isInstance*/,
1851  false/*shallowCategoryLookup*/,
1852  true /* followsSuper */,
1853  Cat);
1854  }
1855 
1857  if (!hasDefinition())
1858  return getLocation();
1859 
1860  return data().EndLoc;
1861  }
1862 
1863  void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; }
1864 
1865  /// Retrieve the starting location of the superclass.
1867 
1868  /// isImplicitInterfaceDecl - check that this is an implicitly declared
1869  /// ObjCInterfaceDecl node. This is for legacy objective-c \@implementation
1870  /// declaration without an \@interface declaration.
1872  return hasDefinition() ? data().Definition->isImplicit() : isImplicit();
1873  }
1874 
1875  /// ClassImplementsProtocol - Checks that 'lProto' protocol
1876  /// has been implemented in IDecl class, its super class or categories (if
1877  /// lookupCategory is true).
1879  bool lookupCategory,
1880  bool RHSIsQualifiedID = false);
1881 
1883  using redecl_iterator = redeclarable_base::redecl_iterator;
1884 
1891 
1892  /// Retrieves the canonical declaration of this Objective-C class.
1894  const ObjCInterfaceDecl *getCanonicalDecl() const { return getFirstDecl(); }
1895 
1896  // Low-level accessor
1897  const Type *getTypeForDecl() const { return TypeForDecl; }
1898  void setTypeForDecl(const Type *TD) const { TypeForDecl = TD; }
1899 
1900  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1901  static bool classofKind(Kind K) { return K == ObjCInterface; }
1902 
1903 private:
1904  const ObjCInterfaceDecl *findInterfaceWithDesignatedInitializers() const;
1905  bool inheritsDesignatedInitializers() const;
1906 };
1907 
1908 /// ObjCIvarDecl - Represents an ObjC instance variable. In general, ObjC
1909 /// instance variables are identical to C. The only exception is Objective-C
1910 /// supports C++ style access control. For example:
1911 ///
1912 /// \@interface IvarExample : NSObject
1913 /// {
1914 /// id defaultToProtected;
1915 /// \@public:
1916 /// id canBePublic; // same as C++.
1917 /// \@protected:
1918 /// id canBeProtected; // same as C++.
1919 /// \@package:
1920 /// id canBePackage; // framework visibility (not available in C++).
1921 /// }
1922 ///
1923 class ObjCIvarDecl : public FieldDecl {
1924  void anchor() override;
1925 
1926 public:
1929  };
1930 
1931 private:
1934  QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW,
1935  bool synthesized)
1936  : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
1937  /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
1938  DeclAccess(ac), Synthesized(synthesized) {}
1939 
1940 public:
1941  static ObjCIvarDecl *Create(ASTContext &C, ObjCContainerDecl *DC,
1942  SourceLocation StartLoc, SourceLocation IdLoc,
1943  IdentifierInfo *Id, QualType T,
1944  TypeSourceInfo *TInfo,
1945  AccessControl ac, Expr *BW = nullptr,
1946  bool synthesized=false);
1947 
1948  static ObjCIvarDecl *CreateDeserialized(ASTContext &C, unsigned ID);
1949 
1950  /// Return the class interface that this ivar is logically contained
1951  /// in; this is either the interface where the ivar was declared, or the
1952  /// interface the ivar is conceptually a part of in the case of synthesized
1953  /// ivars.
1954  const ObjCInterfaceDecl *getContainingInterface() const;
1955 
1956  ObjCIvarDecl *getNextIvar() { return NextIvar; }
1957  const ObjCIvarDecl *getNextIvar() const { return NextIvar; }
1958  void setNextIvar(ObjCIvarDecl *ivar) { NextIvar = ivar; }
1959 
1961  return cast<ObjCIvarDecl>(FieldDecl::getCanonicalDecl());
1962  }
1964  return const_cast<ObjCIvarDecl *>(this)->getCanonicalDecl();
1965  }
1966 
1967  void setAccessControl(AccessControl ac) { DeclAccess = ac; }
1968 
1969  AccessControl getAccessControl() const { return AccessControl(DeclAccess); }
1970 
1972  return DeclAccess == None ? Protected : AccessControl(DeclAccess);
1973  }
1974 
1975  void setSynthesize(bool synth) { Synthesized = synth; }
1976  bool getSynthesize() const { return Synthesized; }
1977 
1978  /// Retrieve the type of this instance variable when viewed as a member of a
1979  /// specific object type.
1980  QualType getUsageType(QualType objectType) const;
1981 
1982  // Implement isa/cast/dyncast/etc.
1983  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1984  static bool classofKind(Kind K) { return K == ObjCIvar; }
1985 
1986 private:
1987  /// NextIvar - Next Ivar in the list of ivars declared in class; class's
1988  /// extensions and class's implementation
1989  ObjCIvarDecl *NextIvar = nullptr;
1990 
1991  // NOTE: VC++ treats enums as signed, avoid using the AccessControl enum
1992  unsigned DeclAccess : 3;
1993  unsigned Synthesized : 1;
1994 };
1995 
1996 /// Represents a field declaration created by an \@defs(...).
2000  QualType T, Expr *BW)
2001  : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
2002  /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
2003  BW, /*Mutable=*/false, /*HasInit=*/ICIS_NoInit) {}
2004 
2005  void anchor() override;
2006 
2007 public:
2009  SourceLocation StartLoc,
2011  QualType T, Expr *BW);
2012 
2013  static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2014 
2015  // Implement isa/cast/dyncast/etc.
2016  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2017  static bool classofKind(Kind K) { return K == ObjCAtDefsField; }
2018 };
2019 
2020 /// Represents an Objective-C protocol declaration.
2021 ///
2022 /// Objective-C protocols declare a pure abstract type (i.e., no instance
2023 /// variables are permitted). Protocols originally drew inspiration from
2024 /// C++ pure virtual functions (a C++ feature with nice semantics and lousy
2025 /// syntax:-). Here is an example:
2026 ///
2027 /// \code
2028 /// \@protocol NSDraggingInfo <refproto1, refproto2>
2029 /// - (NSWindow *)draggingDestinationWindow;
2030 /// - (NSImage *)draggedImage;
2031 /// \@end
2032 /// \endcode
2033 ///
2034 /// This says that NSDraggingInfo requires two methods and requires everything
2035 /// that the two "referenced protocols" 'refproto1' and 'refproto2' require as
2036 /// well.
2037 ///
2038 /// \code
2039 /// \@interface ImplementsNSDraggingInfo : NSObject <NSDraggingInfo>
2040 /// \@end
2041 /// \endcode
2042 ///
2043 /// ObjC protocols inspired Java interfaces. Unlike Java, ObjC classes and
2044 /// protocols are in distinct namespaces. For example, Cocoa defines both
2045 /// an NSObject protocol and class (which isn't allowed in Java). As a result,
2046 /// protocols are referenced using angle brackets as follows:
2047 ///
2048 /// id <NSDraggingInfo> anyObjectThatImplementsNSDraggingInfo;
2050  public Redeclarable<ObjCProtocolDecl> {
2051  struct DefinitionData {
2052  // The declaration that defines this protocol.
2053  ObjCProtocolDecl *Definition;
2054 
2055  /// Referenced protocols
2056  ObjCProtocolList ReferencedProtocols;
2057  };
2058 
2059  /// Contains a pointer to the data associated with this class,
2060  /// which will be NULL if this class has not yet been defined.
2061  ///
2062  /// The bit indicates when we don't need to check for out-of-date
2063  /// declarations. It will be set unless modules are enabled.
2064  llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
2065 
2067  SourceLocation nameLoc, SourceLocation atStartLoc,
2068  ObjCProtocolDecl *PrevDecl);
2069 
2070  void anchor() override;
2071 
2072  DefinitionData &data() const {
2073  assert(Data.getPointer() && "Objective-C protocol has no definition!");
2074  return *Data.getPointer();
2075  }
2076 
2077  void allocateDefinitionData();
2078 
2080 
2081  ObjCProtocolDecl *getNextRedeclarationImpl() override {
2082  return getNextRedeclaration();
2083  }
2084 
2085  ObjCProtocolDecl *getPreviousDeclImpl() override {
2086  return getPreviousDecl();
2087  }
2088 
2089  ObjCProtocolDecl *getMostRecentDeclImpl() override {
2090  return getMostRecentDecl();
2091  }
2092 
2093 public:
2094  friend class ASTDeclReader;
2095  friend class ASTDeclWriter;
2096  friend class ASTReader;
2097 
2099  IdentifierInfo *Id,
2100  SourceLocation nameLoc,
2101  SourceLocation atStartLoc,
2102  ObjCProtocolDecl *PrevDecl);
2103 
2104  static ObjCProtocolDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2105 
2107  assert(hasDefinition() && "No definition available!");
2108  return data().ReferencedProtocols;
2109  }
2110 
2112  using protocol_range = llvm::iterator_range<protocol_iterator>;
2113 
2116  }
2117 
2119  if (!hasDefinition())
2120  return protocol_iterator();
2121 
2122  return data().ReferencedProtocols.begin();
2123  }
2124 
2126  if (!hasDefinition())
2127  return protocol_iterator();
2128 
2129  return data().ReferencedProtocols.end();
2130  }
2131 
2133  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
2134 
2137  }
2138 
2140  if (!hasDefinition())
2141  return protocol_loc_iterator();
2142 
2143  return data().ReferencedProtocols.loc_begin();
2144  }
2145 
2147  if (!hasDefinition())
2148  return protocol_loc_iterator();
2149 
2150  return data().ReferencedProtocols.loc_end();
2151  }
2152 
2153  unsigned protocol_size() const {
2154  if (!hasDefinition())
2155  return 0;
2156 
2157  return data().ReferencedProtocols.size();
2158  }
2159 
2160  /// setProtocolList - Set the list of protocols that this interface
2161  /// implements.
2162  void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num,
2163  const SourceLocation *Locs, ASTContext &C) {
2164  assert(hasDefinition() && "Protocol is not defined");
2165  data().ReferencedProtocols.set(List, Num, Locs, C);
2166  }
2167 
2168  /// This is true iff the protocol is tagged with the
2169  /// `objc_non_runtime_protocol` attribute.
2170  bool isNonRuntimeProtocol() const;
2171 
2172  /// Get the set of all protocols implied by this protocols inheritance
2173  /// hierarchy.
2175 
2177 
2178  // Lookup a method. First, we search locally. If a method isn't
2179  // found, we search referenced protocols and class categories.
2180  ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance) const;
2181 
2183  return lookupMethod(Sel, true/*isInstance*/);
2184  }
2185 
2187  return lookupMethod(Sel, false/*isInstance*/);
2188  }
2189 
2190  /// Determine whether this protocol has a definition.
2191  bool hasDefinition() const {
2192  // If the name of this protocol is out-of-date, bring it up-to-date, which
2193  // might bring in a definition.
2194  // Note: a null value indicates that we don't have a definition and that
2195  // modules are enabled.
2196  if (!Data.getOpaqueValue())
2198 
2199  return Data.getPointer();
2200  }
2201 
2202  /// Retrieve the definition of this protocol, if any.
2204  return hasDefinition()? Data.getPointer()->Definition : nullptr;
2205  }
2206 
2207  /// Retrieve the definition of this protocol, if any.
2209  return hasDefinition()? Data.getPointer()->Definition : nullptr;
2210  }
2211 
2212  /// Determine whether this particular declaration is also the
2213  /// definition.
2215  return getDefinition() == this;
2216  }
2217 
2218  /// Starts the definition of this Objective-C protocol.
2219  void startDefinition();
2220 
2221  /// Produce a name to be used for protocol's metadata. It comes either via
2222  /// objc_runtime_name attribute or protocol name.
2223  StringRef getObjCRuntimeNameAsString() const;
2224 
2225  SourceRange getSourceRange() const override LLVM_READONLY {
2228 
2229  return SourceRange(getAtStartLoc(), getLocation());
2230  }
2231 
2233  using redecl_iterator = redeclarable_base::redecl_iterator;
2234 
2241 
2242  /// Retrieves the canonical declaration of this Objective-C protocol.
2244  const ObjCProtocolDecl *getCanonicalDecl() const { return getFirstDecl(); }
2245 
2247  PropertyDeclOrder &PO) const override;
2248 
2250  ProtocolPropertySet &PS,
2251  PropertyDeclOrder &PO) const;
2252 
2253  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2254  static bool classofKind(Kind K) { return K == ObjCProtocol; }
2255 };
2256 
2257 /// ObjCCategoryDecl - Represents a category declaration. A category allows
2258 /// you to add methods to an existing class (without subclassing or modifying
2259 /// the original class interface or implementation:-). Categories don't allow
2260 /// you to add instance data. The following example adds "myMethod" to all
2261 /// NSView's within a process:
2262 ///
2263 /// \@interface NSView (MyViewMethods)
2264 /// - myMethod;
2265 /// \@end
2266 ///
2267 /// Categories also allow you to split the implementation of a class across
2268 /// several files (a feature more naturally supported in C++).
2269 ///
2270 /// Categories were originally inspired by dynamic languages such as Common
2271 /// Lisp and Smalltalk. More traditional class-based languages (C++, Java)
2272 /// don't support this level of dynamism, which is both powerful and dangerous.
2274  /// Interface belonging to this category
2275  ObjCInterfaceDecl *ClassInterface;
2276 
2277  /// The type parameters associated with this category, if any.
2278  ObjCTypeParamList *TypeParamList = nullptr;
2279 
2280  /// referenced protocols in this category.
2281  ObjCProtocolList ReferencedProtocols;
2282 
2283  /// Next category belonging to this class.
2284  /// FIXME: this should not be a singly-linked list. Move storage elsewhere.
2285  ObjCCategoryDecl *NextClassCategory = nullptr;
2286 
2287  /// The location of the category name in this declaration.
2288  SourceLocation CategoryNameLoc;
2289 
2290  /// class extension may have private ivars.
2291  SourceLocation IvarLBraceLoc;
2292  SourceLocation IvarRBraceLoc;
2293 
2295  SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc,
2297  ObjCTypeParamList *typeParamList,
2298  SourceLocation IvarLBraceLoc = SourceLocation(),
2299  SourceLocation IvarRBraceLoc = SourceLocation());
2300 
2301  void anchor() override;
2302 
2303 public:
2304  friend class ASTDeclReader;
2305  friend class ASTDeclWriter;
2306 
2308  SourceLocation AtLoc,
2309  SourceLocation ClassNameLoc,
2310  SourceLocation CategoryNameLoc,
2311  IdentifierInfo *Id,
2312  ObjCInterfaceDecl *IDecl,
2313  ObjCTypeParamList *typeParamList,
2314  SourceLocation IvarLBraceLoc=SourceLocation(),
2315  SourceLocation IvarRBraceLoc=SourceLocation());
2316  static ObjCCategoryDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2317 
2318  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
2319  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
2320 
2321  /// Retrieve the type parameter list associated with this category or
2322  /// extension.
2323  ObjCTypeParamList *getTypeParamList() const { return TypeParamList; }
2324 
2325  /// Set the type parameters of this category.
2326  ///
2327  /// This function is used by the AST importer, which must import the type
2328  /// parameters after creating their DeclContext to avoid loops.
2330 
2331 
2334 
2335  /// setProtocolList - Set the list of protocols that this interface
2336  /// implements.
2337  void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num,
2338  const SourceLocation *Locs, ASTContext &C) {
2339  ReferencedProtocols.set(List, Num, Locs, C);
2340  }
2341 
2343  return ReferencedProtocols;
2344  }
2345 
2347  using protocol_range = llvm::iterator_range<protocol_iterator>;
2348 
2351  }
2352 
2354  return ReferencedProtocols.begin();
2355  }
2356 
2357  protocol_iterator protocol_end() const { return ReferencedProtocols.end(); }
2358  unsigned protocol_size() const { return ReferencedProtocols.size(); }
2359 
2361  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
2362 
2365  }
2366 
2368  return ReferencedProtocols.loc_begin();
2369  }
2370 
2372  return ReferencedProtocols.loc_end();
2373  }
2374 
2375  ObjCCategoryDecl *getNextClassCategory() const { return NextClassCategory; }
2376 
2377  /// Retrieve the pointer to the next stored category (or extension),
2378  /// which may be hidden.
2380  return NextClassCategory;
2381  }
2382 
2383  bool IsClassExtension() const { return getIdentifier() == nullptr; }
2384 
2386  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2387 
2388  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
2389 
2391  return ivar_iterator(decls_begin());
2392  }
2393 
2395  return ivar_iterator(decls_end());
2396  }
2397 
2398  unsigned ivar_size() const {
2399  return std::distance(ivar_begin(), ivar_end());
2400  }
2401 
2402  bool ivar_empty() const {
2403  return ivar_begin() == ivar_end();
2404  }
2405 
2406  SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
2407  void setCategoryNameLoc(SourceLocation Loc) { CategoryNameLoc = Loc; }
2408 
2409  void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
2410  SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
2411  void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
2412  SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
2413 
2414  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2415  static bool classofKind(Kind K) { return K == ObjCCategory; }
2416 };
2417 
2419  /// Class interface for this class/category implementation
2420  ObjCInterfaceDecl *ClassInterface;
2421 
2422  void anchor() override;
2423 
2424 protected:
2426  ObjCInterfaceDecl *classInterface,
2427  IdentifierInfo *Id,
2428  SourceLocation nameLoc, SourceLocation atStartLoc)
2429  : ObjCContainerDecl(DK, DC, Id, nameLoc, atStartLoc),
2430  ClassInterface(classInterface) {}
2431 
2432 public:
2433  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
2434  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
2435  void setClassInterface(ObjCInterfaceDecl *IFace);
2436 
2438  // FIXME: Context should be set correctly before we get here.
2439  method->setLexicalDeclContext(this);
2440  addDecl(method);
2441  }
2442 
2444  // FIXME: Context should be set correctly before we get here.
2445  method->setLexicalDeclContext(this);
2446  addDecl(method);
2447  }
2448 
2450 
2452  ObjCPropertyQueryKind queryKind) const;
2454 
2455  // Iterator access to properties.
2457  using propimpl_range =
2458  llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>;
2459 
2462  }
2463 
2465  return propimpl_iterator(decls_begin());
2466  }
2467 
2469  return propimpl_iterator(decls_end());
2470  }
2471 
2472  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2473 
2474  static bool classofKind(Kind K) {
2475  return K >= firstObjCImpl && K <= lastObjCImpl;
2476  }
2477 };
2478 
2479 /// ObjCCategoryImplDecl - An object of this class encapsulates a category
2480 /// \@implementation declaration. If a category class has declaration of a
2481 /// property, its implementation must be specified in the category's
2482 /// \@implementation declaration. Example:
2483 /// \@interface I \@end
2484 /// \@interface I(CATEGORY)
2485 /// \@property int p1, d1;
2486 /// \@end
2487 /// \@implementation I(CATEGORY)
2488 /// \@dynamic p1,d1;
2489 /// \@end
2490 ///
2491 /// ObjCCategoryImplDecl
2493  // Category name location
2494  SourceLocation CategoryNameLoc;
2495 
2497  ObjCInterfaceDecl *classInterface,
2498  SourceLocation nameLoc, SourceLocation atStartLoc,
2499  SourceLocation CategoryNameLoc)
2500  : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id,
2501  nameLoc, atStartLoc),
2502  CategoryNameLoc(CategoryNameLoc) {}
2503 
2504  void anchor() override;
2505 
2506 public:
2507  friend class ASTDeclReader;
2508  friend class ASTDeclWriter;
2509 
2511  IdentifierInfo *Id,
2512  ObjCInterfaceDecl *classInterface,
2513  SourceLocation nameLoc,
2514  SourceLocation atStartLoc,
2515  SourceLocation CategoryNameLoc);
2517 
2519 
2520  SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
2521 
2522  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2523  static bool classofKind(Kind K) { return K == ObjCCategoryImpl;}
2524 };
2525 
2526 raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID);
2527 
2528 /// ObjCImplementationDecl - Represents a class definition - this is where
2529 /// method definitions are specified. For example:
2530 ///
2531 /// @code
2532 /// \@implementation MyClass
2533 /// - (void)myMethod { /* do something */ }
2534 /// \@end
2535 /// @endcode
2536 ///
2537 /// In a non-fragile runtime, instance variables can appear in the class
2538 /// interface, class extensions (nameless categories), and in the implementation
2539 /// itself, as well as being synthesized as backing storage for properties.
2540 ///
2541 /// In a fragile runtime, instance variables are specified in the class
2542 /// interface, \em not in the implementation. Nevertheless (for legacy reasons),
2543 /// we allow instance variables to be specified in the implementation. When
2544 /// specified, they need to be \em identical to the interface.
2546  /// Implementation Class's super class.
2547  ObjCInterfaceDecl *SuperClass;
2548  SourceLocation SuperLoc;
2549 
2550  /// \@implementation may have private ivars.
2551  SourceLocation IvarLBraceLoc;
2552  SourceLocation IvarRBraceLoc;
2553 
2554  /// Support for ivar initialization.
2555  /// The arguments used to initialize the ivars
2556  LazyCXXCtorInitializersPtr IvarInitializers;
2557  unsigned NumIvarInitializers = 0;
2558 
2559  /// Do the ivars of this class require initialization other than
2560  /// zero-initialization?
2561  bool HasNonZeroConstructors : 1;
2562 
2563  /// Do the ivars of this class require non-trivial destruction?
2564  bool HasDestructors : 1;
2565 
2567  ObjCInterfaceDecl *classInterface,
2568  ObjCInterfaceDecl *superDecl,
2569  SourceLocation nameLoc, SourceLocation atStartLoc,
2570  SourceLocation superLoc = SourceLocation(),
2571  SourceLocation IvarLBraceLoc=SourceLocation(),
2572  SourceLocation IvarRBraceLoc=SourceLocation())
2573  : ObjCImplDecl(ObjCImplementation, DC, classInterface,
2574  classInterface ? classInterface->getIdentifier()
2575  : nullptr,
2576  nameLoc, atStartLoc),
2577  SuperClass(superDecl), SuperLoc(superLoc),
2578  IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2579  HasNonZeroConstructors(false), HasDestructors(false) {}
2580 
2581  void anchor() override;
2582 
2583 public:
2584  friend class ASTDeclReader;
2585  friend class ASTDeclWriter;
2586 
2588  ObjCInterfaceDecl *classInterface,
2589  ObjCInterfaceDecl *superDecl,
2590  SourceLocation nameLoc,
2591  SourceLocation atStartLoc,
2592  SourceLocation superLoc = SourceLocation(),
2593  SourceLocation IvarLBraceLoc=SourceLocation(),
2594  SourceLocation IvarRBraceLoc=SourceLocation());
2595 
2597 
2598  /// init_iterator - Iterates through the ivar initializer list.
2600 
2601  /// init_const_iterator - Iterates through the ivar initializer list.
2603 
2604  using init_range = llvm::iterator_range<init_iterator>;
2605  using init_const_range = llvm::iterator_range<init_const_iterator>;
2606 
2608 
2610  return init_const_range(init_begin(), init_end());
2611  }
2612 
2613  /// init_begin() - Retrieve an iterator to the first initializer.
2615  const auto *ConstThis = this;
2616  return const_cast<init_iterator>(ConstThis->init_begin());
2617  }
2618 
2619  /// begin() - Retrieve an iterator to the first initializer.
2621 
2622  /// init_end() - Retrieve an iterator past the last initializer.
2624  return init_begin() + NumIvarInitializers;
2625  }
2626 
2627  /// end() - Retrieve an iterator past the last initializer.
2629  return init_begin() + NumIvarInitializers;
2630  }
2631 
2632  /// getNumArgs - Number of ivars which must be initialized.
2633  unsigned getNumIvarInitializers() const {
2634  return NumIvarInitializers;
2635  }
2636 
2637  void setNumIvarInitializers(unsigned numNumIvarInitializers) {
2638  NumIvarInitializers = numNumIvarInitializers;
2639  }
2640 
2642  CXXCtorInitializer ** initializers,
2643  unsigned numInitializers);
2644 
2645  /// Do any of the ivars of this class (not counting its base classes)
2646  /// require construction other than zero-initialization?
2647  bool hasNonZeroConstructors() const { return HasNonZeroConstructors; }
2648  void setHasNonZeroConstructors(bool val) { HasNonZeroConstructors = val; }
2649 
2650  /// Do any of the ivars of this class (not counting its base classes)
2651  /// require non-trivial destruction?
2652  bool hasDestructors() const { return HasDestructors; }
2653  void setHasDestructors(bool val) { HasDestructors = val; }
2654 
2655  /// getIdentifier - Get the identifier that names the class
2656  /// interface associated with this implementation.
2658  return getClassInterface()->getIdentifier();
2659  }
2660 
2661  /// getName - Get the name of identifier for the class interface associated
2662  /// with this implementation as a StringRef.
2663  //
2664  // FIXME: This is a bad API, we are hiding NamedDecl::getName with a different
2665  // meaning.
2666  StringRef getName() const {
2667  assert(getIdentifier() && "Name is not a simple identifier");
2668  return getIdentifier()->getName();
2669  }
2670 
2671  /// Get the name of the class associated with this interface.
2672  //
2673  // FIXME: Move to StringRef API.
2675 
2676  /// Produce a name to be used for class's metadata. It comes either via
2677  /// class's objc_runtime_name attribute or class name.
2678  StringRef getObjCRuntimeNameAsString() const;
2679 
2680  const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
2681  ObjCInterfaceDecl *getSuperClass() { return SuperClass; }
2682  SourceLocation getSuperClassLoc() const { return SuperLoc; }
2683 
2684  void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }
2685 
2686  void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
2687  SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
2688  void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
2689  SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
2690 
2692  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2693 
2694  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
2695 
2697  return ivar_iterator(decls_begin());
2698  }
2699 
2701  return ivar_iterator(decls_end());
2702  }
2703 
2704  unsigned ivar_size() const {
2705  return std::distance(ivar_begin(), ivar_end());
2706  }
2707 
2708  bool ivar_empty() const {
2709  return ivar_begin() == ivar_end();
2710  }
2711 
2712  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2713  static bool classofKind(Kind K) { return K == ObjCImplementation; }
2714 };
2715 
2716 raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID);
2717 
2718 /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is
2719 /// declared as \@compatibility_alias alias class.
2721  /// Class that this is an alias of.
2722  ObjCInterfaceDecl *AliasedClass;
2723 
2725  ObjCInterfaceDecl* aliasedClass)
2726  : NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2727 
2728  void anchor() override;
2729 
2730 public:
2733  ObjCInterfaceDecl* aliasedClass);
2734 
2736  unsigned ID);
2737 
2738  const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; }
2739  ObjCInterfaceDecl *getClassInterface() { return AliasedClass; }
2740  void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; }
2741 
2742  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2743  static bool classofKind(Kind K) { return K == ObjCCompatibleAlias; }
2744 };
2745 
2746 /// ObjCPropertyImplDecl - Represents implementation declaration of a property
2747 /// in a class or category implementation block. For example:
2748 /// \@synthesize prop1 = ivar1;
2749 ///
2750 class ObjCPropertyImplDecl : public Decl {
2751 public:
2752  enum Kind {
2755  };
2756 
2757 private:
2758  SourceLocation AtLoc; // location of \@synthesize or \@dynamic
2759 
2760  /// For \@synthesize, the location of the ivar, if it was written in
2761  /// the source code.
2762  ///
2763  /// \code
2764  /// \@synthesize int a = b
2765  /// \endcode
2766  SourceLocation IvarLoc;
2767 
2768  /// Property declaration being implemented
2769  ObjCPropertyDecl *PropertyDecl;
2770 
2771  /// Null for \@dynamic. Required for \@synthesize.
2772  ObjCIvarDecl *PropertyIvarDecl;
2773 
2774  /// The getter's definition, which has an empty body if synthesized.
2775  ObjCMethodDecl *GetterMethodDecl = nullptr;
2776  /// The getter's definition, which has an empty body if synthesized.
2777  ObjCMethodDecl *SetterMethodDecl = nullptr;
2778 
2779  /// Null for \@dynamic. Non-null if property must be copy-constructed in
2780  /// getter.
2781  Expr *GetterCXXConstructor = nullptr;
2782 
2783  /// Null for \@dynamic. Non-null if property has assignment operator to call
2784  /// in Setter synthesis.
2785  Expr *SetterCXXAssignment = nullptr;
2786 
2788  ObjCPropertyDecl *property,
2789  Kind PK,
2790  ObjCIvarDecl *ivarDecl,
2791  SourceLocation ivarLoc)
2792  : Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2793  IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2794  assert(PK == Dynamic || PropertyIvarDecl);
2795  }
2796 
2797 public:
2798  friend class ASTDeclReader;
2799 
2801  SourceLocation atLoc, SourceLocation L,
2802  ObjCPropertyDecl *property,
2803  Kind PK,
2804  ObjCIvarDecl *ivarDecl,
2805  SourceLocation ivarLoc);
2806 
2808 
2809  SourceRange getSourceRange() const override LLVM_READONLY;
2810 
2811  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
2812  void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
2813 
2815  return PropertyDecl;
2816  }
2817  void setPropertyDecl(ObjCPropertyDecl *Prop) { PropertyDecl = Prop; }
2818 
2820  return PropertyIvarDecl ? Synthesize : Dynamic;
2821  }
2822 
2824  return PropertyIvarDecl;
2825  }
2826  SourceLocation getPropertyIvarDeclLoc() const { return IvarLoc; }
2827 
2829  SourceLocation IvarLoc) {
2830  PropertyIvarDecl = Ivar;
2831  this->IvarLoc = IvarLoc;
2832  }
2833 
2834  /// For \@synthesize, returns true if an ivar name was explicitly
2835  /// specified.
2836  ///
2837  /// \code
2838  /// \@synthesize int a = b; // true
2839  /// \@synthesize int a; // false
2840  /// \endcode
2841  bool isIvarNameSpecified() const {
2842  return IvarLoc.isValid() && IvarLoc != getLocation();
2843  }
2844 
2845  ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
2846  void setGetterMethodDecl(ObjCMethodDecl *MD) { GetterMethodDecl = MD; }
2847 
2848  ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; }
2849  void setSetterMethodDecl(ObjCMethodDecl *MD) { SetterMethodDecl = MD; }
2850 
2852  return GetterCXXConstructor;
2853  }
2854 
2855  void setGetterCXXConstructor(Expr *getterCXXConstructor) {
2856  GetterCXXConstructor = getterCXXConstructor;
2857  }
2858 
2860  return SetterCXXAssignment;
2861  }
2862 
2863  void setSetterCXXAssignment(Expr *setterCXXAssignment) {
2864  SetterCXXAssignment = setterCXXAssignment;
2865  }
2866 
2867  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2868  static bool classofKind(Decl::Kind K) { return K == ObjCPropertyImpl; }
2869 };
2870 
2871 template<bool (*Filter)(ObjCCategoryDecl *)>
2872 void
2873 ObjCInterfaceDecl::filtered_category_iterator<Filter>::
2874 findAcceptableCategory() {
2875  while (Current && !Filter(Current))
2876  Current = Current->getNextClassCategoryRaw();
2877 }
2878 
2879 template<bool (*Filter)(ObjCCategoryDecl *)>
2880 inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2882  Current = Current->getNextClassCategoryRaw();
2883  findAcceptableCategory();
2884  return *this;
2885 }
2886 
2887 inline bool ObjCInterfaceDecl::isVisibleCategory(ObjCCategoryDecl *Cat) {
2888  return Cat->isUnconditionallyVisible();
2889 }
2890 
2891 inline bool ObjCInterfaceDecl::isVisibleExtension(ObjCCategoryDecl *Cat) {
2892  return Cat->IsClassExtension() && Cat->isUnconditionallyVisible();
2893 }
2894 
2895 inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2896  return Cat->IsClassExtension();
2897 }
2898 
2899 } // namespace clang
2900 
2901 #endif // LLVM_CLANG_AST_DECLOBJC_H
clang::Decl::setLexicalDeclContext
void setLexicalDeclContext(DeclContext *DC)
Definition: DeclBase.cpp:331
clang::ObjCMethodDecl::Required
@ Required
Definition: DeclObjC.h:144
clang::ObjCInterfaceDecl
Represents an ObjC class declaration.
Definition: DeclObjC.h:1150
clang::ObjCCategoryDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:2367
clang::ObjCMethodDecl::setHasRedeclaration
void setHasRedeclaration(bool HRD) const
Definition: DeclObjC.h:275
clang::ObjCTypeParamDecl::hasExplicitBound
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:642
clang::ObjCInterfaceDecl::filtered_category_iterator::difference_type
std::ptrdiff_t difference_type
Definition: DeclObjC.h:1585
clang::ObjCListBase::operator=
ObjCListBase & operator=(const ObjCListBase &)=delete
clang::ObjCInterfaceDecl::visible_extensions_end
visible_extensions_iterator visible_extensions_end() const
Retrieve an iterator to the end of the visible-extensions list.
Definition: DeclObjC.h:1713
clang::ObjCImplementationDecl::setSuperClass
void setSuperClass(ObjCInterfaceDecl *superCls)
Definition: DeclObjC.h:2684
clang::ObjCPropertyDecl::isReadOnly
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
Definition: DeclObjC.h:834
clang::ObjCListBase::ObjCListBase
ObjCListBase()=default
clang::ObjCInterfaceDecl::CreateDeserialized
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1523
clang::ObjCPropertyImplDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2823
clang::getStandardSelectorLoc
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 ...
Definition: SelectorLocationsKind.cpp:103
clang::ObjCCompatibleAliasDecl
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2720
clang::ObjCContainerDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1111
clang::ObjCProtocolDecl::lookupClassMethod
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Definition: DeclObjC.h:2186
clang::ObjCPropertyDecl::getUsageType
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
Definition: DeclObjC.cpp:2310
clang::DeclContext::decls_end
decl_iterator decls_end() const
Definition: DeclBase.h:2125
clang::ObjCMethodDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:545
clang::ObjCMethodDecl::castFromDeclContext
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclObjC.h:551
clang::ObjCMethodDecl::hasRedeclaration
bool hasRedeclaration() const
True if redeclared in the same interface.
Definition: DeclObjC.h:274
clang::ObjCInterfaceDecl::known_categories_range
llvm::iterator_range< known_categories_iterator > known_categories_range
Definition: DeclObjC.h:1663
clang::ObjCMethodDecl::param_range
llvm::iterator_range< param_iterator > param_range
Definition: DeclObjC.h:354
clang::ObjCPropertyDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:937
clang::ObjCProtocolDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2114
clang::ObjCContainerDecl::instmeth_range
llvm::iterator_range< instmeth_iterator > instmeth_range
Definition: DeclObjC.h:1027
clang::Type::isBlockPointerType
bool isBlockPointerType() const
Definition: Type.h:6706
clang::ObjCPropertyImplDecl::setPropertyIvarDecl
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Definition: DeclObjC.h:2828
clang::ObjCImplementationDecl::getName
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
Definition: DeclObjC.h:2666
Specifiers.h
clang::ObjCMethodDecl::castToDeclContext
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
Definition: DeclObjC.h:547
clang::ObjCInterfaceDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:1293
clang::ObjCInterfaceDecl::filtered_category_iterator
Iterator that walks over the list of categories, filtering out those that do not meet specific criter...
Definition: DeclObjC.h:1576
clang::ObjCInterfaceDecl::collectPropertiesToImplement
void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const override
This routine collects list of properties to be implemented in the class.
Definition: DeclObjC.cpp:406
clang::DeclContext::specific_decl_iterator
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
Definition: DeclBase.h:2143
clang::ObjCMethodDecl::param_const_range
llvm::iterator_range< param_const_iterator > param_const_range
Definition: DeclObjC.h:355
clang::ObjCContainerDecl::getProperty
ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const
Definition: DeclObjC.cpp:235
clang::ObjCPropertyDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:924
clang::ObjCIvarDecl::None
@ None
Definition: DeclObjC.h:1928
clang::ObjCInterfaceDecl::setTypeForDecl
void setTypeForDecl(const Type *TD) const
Definition: DeclObjC.h:1898
clang::ObjCInterfaceDecl::setHasDesignatedInitializers
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
Definition: DeclObjC.cpp:1566
clang::ObjCPropertyDecl::setPropertyAttributesAsWritten
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
Definition: DeclObjC.h:827
clang::ObjCInterfaceDecl::lookupMethod
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const
lookupMethod - This method returns an instance/class method by looking in the class,...
Definition: DeclObjC.cpp:692
clang::ObjCImplementationDecl::init_end
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Definition: DeclObjC.h:2623
clang::ObjCMethodDecl::setPropertyAccessor
void setPropertyAccessor(bool isAccessor)
Definition: DeclObjC.h:445
clang::SourceRange
A trivial tuple used to represent a source range.
Definition: SourceLocation.h:210
clang::DeclContext::ObjCContainerDeclBits
ObjCContainerDeclBitfields ObjCContainerDeclBits
Definition: DeclBase.h:1812
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::ObjCMethodFamily
ObjCMethodFamily
A family of Objective-C methods.
Definition: IdentifierTable.h:686
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1355
clang::ObjCIvarDecl::getNextIvar
ObjCIvarDecl * getNextIvar()
Definition: DeclObjC.h:1956
clang::Redeclarable
Provides common interface for the Decls that can be redeclared.
Definition: Redeclarable.h:84
clang::ObjCPropertyImplDecl::getSetterCXXAssignment
Expr * getSetterCXXAssignment() const
Definition: DeclObjC.h:2859
clang::ObjCPropertyDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:897
Optional
llvm::Optional< T > Optional
Definition: ByteCodeExprGen.cpp:23
clang::ObjCMethodDecl::getDeclaratorEndLoc
SourceLocation getDeclaratorEndLoc() const
Returns the location where the declarator ends.
Definition: DeclObjC.h:282
clang::ObjCImplementationDecl::init_const_iterator
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
Definition: DeclObjC.h:2602
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2545
clang::ObjCMethodDecl::param_type_end
param_type_iterator param_type_end() const
Definition: DeclObjC.h:408
clang::ObjCContainerDecl::method_range
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
Definition: DeclObjC.h:1010
clang::ObjCIvarDecl::getCanonicalDecl
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
Definition: DeclObjC.h:1960
clang::ObjCMethodDecl::getSelfType
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
Definition: DeclObjC.cpp:1110
clang::ObjCTypeParamVariance::Invariant
@ Invariant
The parameter is invariant: must match exactly.
clang::ObjCProtocolDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:2118
clang::ObjCContainerDecl::instprop_iterator
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
Definition: DeclObjC.h:975
clang::Redeclarable< ObjCInterfaceDecl >::redecls_begin
redecl_iterator redecls_begin() const
Definition: Redeclarable.h:302
clang::ObjCIvarDecl::Protected
@ Protected
Definition: DeclObjC.h:1928
clang::ObjCTypeParamList::gatherDefaultTypeArgs
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
Definition: DeclObjC.cpp:1496
clang::ObjCPropertyAttribute::kind_class
@ kind_class
Definition: DeclObjCCommon.h:40
clang::ObjCImplDecl::propimpl_range
llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range
Definition: DeclObjC.h:2458
clang::ObjCMethodDecl::getCategory
const ObjCCategoryDecl * getCategory() const
Definition: DeclObjC.h:326
clang::ObjCImplementationDecl::init_begin
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
Definition: DeclObjC.h:2614
llvm::SmallVector
Definition: LLVM.h:38
clang::ObjCInterfaceDecl::setExternallyCompleted
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
Definition: DeclObjC.cpp:1558
clang::ObjCInterfaceDecl::filtered_category_iterator::operator++
filtered_category_iterator & operator++()
Definition: DeclObjC.h:2881
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::ObjCImplementationDecl::setHasNonZeroConstructors
void setHasNonZeroConstructors(bool val)
Definition: DeclObjC.h:2648
clang::ObjCInterfaceDecl::hasDesignatedInitializers
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
Definition: DeclObjC.cpp:1573
clang::ObjCInterfaceDecl::setEndOfDefinitionLoc
void setEndOfDefinitionLoc(SourceLocation LE)
Definition: DeclObjC.h:1863
clang::ObjCProtocolDecl::protocol_loc_iterator
ObjCProtocolList::loc_iterator protocol_loc_iterator
Definition: DeclObjC.h:2132
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:247
clang::ObjCInterfaceDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:1438
clang::ObjCInterfaceDecl::getDefinition
const ObjCInterfaceDecl * getDefinition() const
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
Definition: DeclObjC.h:1534
clang::ObjCMethodDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:544
clang::ObjCImplementationDecl::inits
init_const_range inits() const
Definition: DeclObjC.h:2609
clang::ObjCPropertyDecl::setSetterMethodDecl
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
Definition: DeclObjC.h:901
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:674
clang::ObjCPropertyDecl::isClassProperty
bool isClassProperty() const
Definition: DeclObjC.h:851
clang::ObjCProtocolDecl::Create
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
Definition: DeclObjC.cpp:1907
clang::ObjCInterfaceDecl::isArcWeakrefUnavailable
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
Definition: DeclObjC.cpp:426
clang::Selector::isUnarySelector
bool isUnarySelector() const
Definition: IdentifierTable.h:825
clang::Redeclarable< ObjCInterfaceDecl >::redecls_end
redecl_iterator redecls_end() const
Definition: Redeclarable.h:303
clang::ObjCMethodDecl::getParamDecl
const ParmVarDecl * getParamDecl(unsigned Idx) const
Definition: DeclObjC.h:385
AttributeLangSupport::C
@ C
Definition: SemaDeclAttr.cpp:54
clang::ObjCImplementationDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:2694
clang::ObjCCategoryDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:2353
clang::SelLoc_NonStandard
@ SelLoc_NonStandard
Non-standard.
Definition: SelectorLocationsKind.h:29
clang::tooling::Filter
llvm::cl::opt< std::string > Filter
clang::ObjCIvarDecl::getAccessControl
AccessControl getAccessControl() const
Definition: DeclObjC.h:1969
clang::ObjCInterfaceDecl::lookupClassMethod
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
Definition: DeclObjC.h:1830
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2838
clang::ObjCInterfaceDecl::getCategoryMethod
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
Definition: DeclObjC.h:1336
clang::Decl::redecl_range
llvm::iterator_range< redecl_iterator > redecl_range
Definition: DeclBase.h:976
clang::ObjCTypeParamDecl::getVariance
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:625
clang::ObjCPropertyDecl::isInstanceProperty
bool isInstanceProperty() const
Definition: DeclObjC.h:850
clang::ObjCImplementationDecl::setNumIvarInitializers
void setNumIvarInitializers(unsigned numNumIvarInitializers)
Definition: DeclObjC.h:2637
clang::ObjCInterfaceDecl::visible_categories_end
visible_categories_iterator visible_categories_end() const
Retrieve an iterator to the end of the visible-categories list.
Definition: DeclObjC.h:1643
clang::ObjCContainerDecl::instmeth_end
instmeth_iterator instmeth_end() const
Definition: DeclObjC.h:1037
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1663
clang::ObjCPropertyDecl::isOptional
bool isOptional() const
Definition: DeclObjC.h:912
clang::Redeclarable< ObjCInterfaceDecl >::getFirstDecl
ObjCInterfaceDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Definition: Redeclarable.h:216
clang::ObjCContainerDecl::instance_methods
instmeth_range instance_methods() const
Definition: DeclObjC.h:1029
clang::ObjCProtocolDecl::getCanonicalDecl
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
Definition: DeclObjC.h:2243
clang::ObjCPropertyImplDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:2845
clang::ObjCCategoryDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2318
clang::ObjCMethodDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.cpp:1176
clang::ObjCContainerDecl::instmeth_iterator
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
Definition: DeclObjC.h:1026
clang::ObjCList::set
void set(T *const *InList, unsigned Elts, ASTContext &Ctx)
Definition: DeclObjC.h:85
clang::ObjCImplementationDecl::getIdentifier
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the class interface associated with this implementation...
Definition: DeclObjC.h:2657
clang::ObjCPropertyDecl::isDirectProperty
bool isDirectProperty() const
Definition: DeclObjC.cpp:2315
clang::ObjCCategoryDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:2386
clang::ObjCProtocolDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:2139
clang::ObjCTypeParamVariance::Covariant
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
clang::ObjCInterfaceDecl::filtered_category_iterator::operator++
filtered_category_iterator operator++(int)
Definition: DeclObjC.h:1599
distance
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
clang::ObjCPropertyImplDecl
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2750
llvm::Optional
Definition: LLVM.h:40
clang::ObjCCategoryDecl::IsClassExtension
bool IsClassExtension() const
Definition: DeclObjC.h:2383
clang::ObjCImplementationDecl::setHasDestructors
void setHasDestructors(bool val)
Definition: DeclObjC.h:2653
clang::ObjCMethodDecl::param_end
param_const_iterator param_end() const
Definition: DeclObjC.h:361
clang::ObjCInterfaceDecl::known_extensions_iterator
filtered_category_iterator< isKnownExtension > known_extensions_iterator
Iterator that walks over all of the known extensions.
Definition: DeclObjC.h:1735
clang::ObjCList::operator[]
T * operator[](unsigned Idx) const
Definition: DeclObjC.h:94
clang::ObjCContainerDecl::HasUserDeclaredSetterMethod
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class,...
Definition: DeclObjC.cpp:124
clang::ObjCProtocolDecl::collectPropertiesToImplement
void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const override
This routine collects list of properties to be implemented in the class.
Definition: DeclObjC.cpp:1996
clang::ObjCInterfaceDecl::visible_categories_range
llvm::iterator_range< visible_categories_iterator > visible_categories_range
Definition: DeclObjC.h:1629
clang::ObjCPropertyDecl::setPropertyAttributes
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
Definition: DeclObjC.h:815
clang::ObjCContainerDecl::ProtocolPropertySet
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
Definition: DeclObjC.h:1084
clang::ObjCInterfaceDecl::visible_extensions
visible_extensions_range visible_extensions() const
Definition: DeclObjC.h:1701
clang::tooling::X
static ToolExecutorPluginRegistry::Add< AllTUsToolExecutorPlugin > X("all-TUs", "Runs FrontendActions on all TUs in the compilation database. " "Tool results are stored in memory.")
clang::ObjCCompatibleAliasDecl::CreateDeserialized
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2280
clang::ObjCPropertyImplDecl::getPropertyIvarDeclLoc
SourceLocation getPropertyIvarDeclLoc() const
Definition: DeclObjC.h:2826
clang::ObjCContainerDecl::classprop_iterator
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator
Definition: DeclObjC.h:992
clang::ObjCContainerDecl::PropertyMap
llvm::DenseMap< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
Definition: DeclObjC.h:1083
clang::ObjCCategoryDecl::setIvarLBraceLoc
void setIvarLBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2409
clang::ObjCCompatibleAliasDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2742
clang::ObjCProtocolList::loc_iterator
const SourceLocation * loc_iterator
Definition: DeclObjC.h:110
clang::ObjCPropertyDecl::getPropertyImplementation
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:908
clang::ObjCContainerDecl::classmeth_iterator
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
Definition: DeclObjC.h:1043
clang::DeclContext::ObjCMethodDeclBits
ObjCMethodDeclBitfields ObjCMethodDeclBits
Definition: DeclBase.h:1811
clang::ObjCIvarDecl::Public
@ Public
Definition: DeclObjC.h:1928
clang::ObjCMethodDecl::isThisDeclarationADesignatedInitializer
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
Definition: DeclObjC.cpp:841
clang::ObjCCategoryDecl::getNextClassCategory
ObjCCategoryDecl * getNextClassCategory() const
Definition: DeclObjC.h:2375
clang::ObjCMethodDecl::Create
static ObjCMethodDecl * Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance=true, bool isVariadic=false, bool isPropertyAccessor=false, bool isSynthesizedAccessorStub=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false)
Definition: DeclObjC.cpp:818
clang::ObjCProtocolDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:2125
clang::ObjCInterfaceDecl::all_declared_ivar_begin
const ObjCIvarDecl * all_declared_ivar_begin() const
Definition: DeclObjC.h:1461
clang::ObjCMethodDecl::isOverriding
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
Definition: DeclObjC.h:467
clang::ObjCMethodDecl::getNumSelectorLocs
unsigned getNumSelectorLocs() const
Definition: DeclObjC.h:309
clang::ObjCImplDecl::propimpl_end
propimpl_iterator propimpl_end() const
Definition: DeclObjC.h:2468
clang::ObjCContainerDecl::instprop_range
llvm::iterator_range< instprop_iterator > instprop_range
Definition: DeclObjC.h:976
clang::ObjCContainerDecl::castFromDeclContext
static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclObjC.h:1120
clang::ObjCInterfaceDecl::known_extensions
known_extensions_range known_extensions() const
Definition: DeclObjC.h:1739
clang::ObjCPropertyAttribute::kind_strong
@ kind_strong
Definition: DeclObjCCommon.h:34
clang::ObjCImplDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2433
clang::ObjCTypeParamDecl::getVarianceLoc
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
Definition: DeclObjC.h:635
clang::ObjCCategoryDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:2402
clang::ObjCInterfaceDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:1377
clang::ObjCContainerDecl::classprop_end
classprop_iterator classprop_end() const
Definition: DeclObjC.h:1003
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1491
clang::ObjCTypeParamDecl::getColonLoc
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
Definition: DeclObjC.h:646
clang::ObjCMethodDecl::createImplicitParams
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
Definition: DeclObjC.cpp:1155
clang::ObjCTypeParamList::getSourceRange
SourceRange getSourceRange() const
Definition: DeclObjC.h:713
clang::ObjCIvarDecl::AccessControl
AccessControl
Definition: DeclObjC.h:1927
Decl.h
clang::ObjCImplementationDecl::setIvarInitializers
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
Definition: DeclObjC.cpp:2242
clang::ObjCTypeParamList::getLAngleLoc
SourceLocation getLAngleLoc() const
Definition: DeclObjC.h:711
clang::ObjCObjectType
Represents a class type in Objective C.
Definition: Type.h:5842
clang::Redeclarable< ObjCInterfaceDecl >::redecl_range
llvm::iterator_range< redecl_iterator > redecl_range
Definition: Redeclarable.h:292
Offset
unsigned Offset
Definition: Format.cpp:2431
clang::ObjCList::end
iterator end() const
Definition: DeclObjC.h:92
clang::ObjCImplementationDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:2696
clang::SelLoc_StandardWithSpace
@ SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
Definition: SelectorLocationsKind.h:41
clang::ObjCCategoryDecl::setTypeParamList
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
Definition: DeclObjC.cpp:2101
clang::ObjCInterfaceDecl::known_categories_empty
bool known_categories_empty() const
Determine whether the known-categories list is empty.
Definition: DeclObjC.h:1682
clang::ObjCInterfaceDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
Definition: DeclObjC.h:1508
clang::ObjCTypeParamDecl::Create
static ObjCTypeParamDecl * Create(ASTContext &ctx, DeclContext *dc, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, SourceLocation nameLoc, IdentifierInfo *name, SourceLocation colonLoc, TypeSourceInfo *boundInfo)
Definition: DeclObjC.cpp:1438
clang::ObjCInterfaceDecl::visible_extensions_empty
bool visible_extensions_empty() const
Determine whether the visible-extensions list is empty.
Definition: DeclObjC.h:1718
clang::ObjCMethodDecl::param_const_iterator
const ParmVarDecl *const * param_const_iterator
Definition: DeclObjC.h:352
clang::ObjCMethodDecl::getReturnTypeSourceRange
SourceRange getReturnTypeSourceRange() const
Definition: DeclObjC.cpp:1196
clang::ObjCListBase::List
void ** List
List is an array of pointers to objects that are not owned by this object.
Definition: DeclObjC.h:63
clang::ObjCMethodDecl::getCompoundBody
CompoundStmt * getCompoundBody()
Definition: DeclObjC.h:534
clang::ObjCInterfaceDecl::getDesignatedInitializers
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
Definition: DeclObjC.cpp:552
clang::ObjCPropertyImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2867
clang::ObjCTypeParamDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:650
clang::ObjCProtocolList::ObjCProtocolList
ObjCProtocolList()=default
clang::ObjCInterfaceDecl::filtered_category_iterator::operator!=
friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)
Definition: DeclObjC.h:1610
clang::ObjCInterfaceDecl::lookupNestedProtocol
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
Definition: DeclObjC.cpp:680
clang::ObjCPropertyAttribute::kind_atomic
@ kind_atomic
Definition: DeclObjCCommon.h:32
clang::ObjCProtocolDecl::collectInheritedProtocolProperties
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
Definition: DeclObjC.cpp:2012
clang::ObjCPropertyAttribute::kind_copy
@ kind_copy
Definition: DeclObjCCommon.h:29
clang::ObjCImplementationDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2713
clang::LazyOffsetPtr< Stmt, uint64_t, &ExternalASTSource::GetExternalDeclStmt >
clang::ObjCMethodDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:319
clang::ObjCPropertyImplDecl::getSetterMethodDecl
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:2848
clang::ObjCProtocolDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2153
clang::ObjCInterfaceDecl::mergeClassExtensionProtocolList
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
Definition: DeclObjC.cpp:446
clang::ObjCInterfaceDecl::lookupInstanceMethod
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
Definition: DeclObjC.h:1825
clang::Decl::Kind
Kind
Lists the kind of concrete classes of Decl.
Definition: DeclBase.h:86
clang::ObjCMethodDecl::setSelfDecl
void setSelfDecl(ImplicitParamDecl *SD)
Definition: DeclObjC.h:424
clang::ObjCMethodDecl::hasRelatedResultType
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
Definition: DeclObjC.h:259
clang::DeclarationName::getObjCSelector
Selector getObjCSelector() const
Get the Objective-C selector stored in this declaration name.
Definition: DeclarationName.h:479
clang::ObjCPropertyImplDecl::setGetterCXXConstructor
void setGetterCXXConstructor(Expr *getterCXXConstructor)
Definition: DeclObjC.h:2855
clang::CompoundStmt
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1404
clang::ObjCInterfaceDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:1454
clang::ObjCPropertyDecl::isAtomic
bool isAtomic() const
isAtomic - Return true if the property is atomic.
Definition: DeclObjC.h:839
clang::ObjCTypeParamVariance::Contravariant
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
clang::ObjCPropertyDecl::setPropertyImplementation
void setPropertyImplementation(PropertyControl pc)
Definition: DeclObjC.h:904
clang::ObjCContainerDecl::prop_iterator
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
Definition: DeclObjC.h:959
clang::ObjCCategoryDecl::ivar_end
ivar_iterator ivar_end() const
Definition: DeclObjC.h:2394
clang::ObjCImplementationDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Definition: DeclObjC.h:2682
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:427
clang::ObjCInterfaceDecl::getImplementation
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1600
clang::ObjCMethodDecl::isDefined
bool isDefined() const
Definition: DeclObjC.h:457
clang::ObjCProtocolDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:2225
clang::ObjCInterfaceDecl::getCanonicalDecl
const ObjCInterfaceDecl * getCanonicalDecl() const
Definition: DeclObjC.h:1894
Id
int Id
Definition: ASTDiff.cpp:191
clang::ObjCMethodDecl::setReturnType
void setReturnType(QualType T)
Definition: DeclObjC.h:333
clang::ObjCInterfaceDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:1344
DeclBase.h
clang::ObjCCategoryImplDecl::CreateDeserialized
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2129
clang::ObjCIvarDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1983
clang::ObjCInterfaceDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:1341
clang::ObjCCategoryDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:2388
clang::ObjCInterfaceDecl::visible_categories
visible_categories_range visible_categories() const
Definition: DeclObjC.h:1631
clang::ObjCListBase::set
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
Definition: DeclObjC.cpp:45
clang::interp::LE
bool LE(InterpState &S, CodePtr OpPC)
Definition: Interp.h:239
clang::ObjCContainerDecl::classprop_range
llvm::iterator_range< classprop_iterator > classprop_range
Definition: DeclObjC.h:993
clang::ObjCInterfaceDecl::visible_extensions_begin
visible_extensions_iterator visible_extensions_begin() const
Retrieve an iterator to the beginning of the visible-extensions list.
Definition: DeclObjC.h:1708
clang::ObjCPropertyImplDecl::Create
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
Definition: DeclObjC.cpp:2324
clang::ObjCInterfaceDecl::ClassImplementsProtocol
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class,...
Definition: DeclObjC.cpp:1754
clang::Decl::ObjCDeclQualifier
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Definition: DeclBase.h:195
clang::ObjCTypeParamList::end
const_iterator end() const
Definition: DeclObjC.h:697
clang::ObjCImplementationDecl::hasDestructors
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
Definition: DeclObjC.h:2652
clang::ObjCIvarDecl::getCanonicalDecl
const ObjCIvarDecl * getCanonicalDecl() const
Definition: DeclObjC.h:1963
clang::ObjCPropertyImplDecl::Synthesize
@ Synthesize
Definition: DeclObjC.h:2753
clang::ObjCPropertyAttribute::kind_weak
@ kind_weak
Definition: DeclObjCCommon.h:33
clang::ObjCMethodDecl::getMethodFamily
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
Definition: DeclObjC.cpp:1018
clang::ObjCTypeParamList::back
ObjCTypeParamDecl * back() const
Definition: DeclObjC.h:706
Redeclarable.h
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:208
clang::ObjCInterfaceDecl::lookupPrivateMethod
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
Definition: DeclObjC.cpp:749
clang::ObjCListBase
Definition: DeclObjC.h:60
clang::ObjCMethodDecl::setDeclImplementation
void setDeclImplementation(ImplementationControl ic)
Definition: DeclObjC.h:501
clang::ObjCPropertyDecl::getSetterMethodDecl
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:900
clang::ObjCPropertyDecl::Assign
@ Assign
Definition: DeclObjC.h:736
clang::Selector::getNumArgs
unsigned getNumArgs() const
Definition: IdentifierTable.cpp:480
clang::ObjCCompatibleAliasDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2739
clang::ObjCProtocolDecl::setProtocolList
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
Definition: DeclObjC.h:2162
clang::ObjCProtocolDecl::startDefinition
void startDefinition()
Starts the definition of this Objective-C protocol.
Definition: DeclObjC.cpp:1988
clang::ObjCInterfaceDecl::declaresOrInheritsDesignatedInitializers
bool declaresOrInheritsDesignatedInitializers() const
Returns true if this interface decl declares a designated initializer or it inherites one from its su...
Definition: DeclObjC.h:1315
clang::ObjCContainerDecl::methods
method_range methods() const
Definition: DeclObjC.h:1012
clang::ObjCMethodDecl::setHasSkippedBody
void setHasSkippedBody(bool Skipped=true)
Definition: DeclObjC.h:483
clang::ObjCProtocolDecl::getCanonicalDecl
const ObjCProtocolDecl * getCanonicalDecl() const
Definition: DeclObjC.h:2244
clang::ObjCInterfaceDecl::all_protocol_iterator
ObjCList< ObjCProtocolDecl >::iterator all_protocol_iterator
Definition: DeclObjC.h:1399
clang::ObjCImplDecl::propimpl_begin
propimpl_iterator propimpl_begin() const
Definition: DeclObjC.h:2464
clang::ObjCMethodDecl::setIsRedeclaration
void setIsRedeclaration(bool RD)
Definition: DeclObjC.h:270
clang::ObjCInterfaceDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:1319
clang::ObjCPropertyDecl::getSetterName
Selector getSetterName() const
Definition: DeclObjC.h:889
clang::ObjCIvarDecl::getContainingInterface
const ObjCInterfaceDecl * getContainingInterface() const
Return the class interface that this ivar is logically contained in; this is either the interface whe...
Definition: DeclObjC.cpp:1841
clang::ObjCMethodDecl::getSelector
Selector getSelector() const
Definition: DeclObjC.h:330
clang::ObjCProtocolList
A list of Objective-C protocols, along with the source locations at which they were referenced.
Definition: DeclObjC.h:102
clang::ObjCCategoryDecl::getImplementation
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2092
clang::ObjCImplementationDecl::getSuperClass
ObjCInterfaceDecl * getSuperClass()
Definition: DeclObjC.h:2681
clang::ObjCInterfaceDecl::lookupInstanceVariable
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
Definition: DeclObjC.cpp:630
clang::ObjCPropertyQueryKind::OBJC_PR_query_class
@ OBJC_PR_query_class
clang::ObjCCompatibleAliasDecl::setClassInterface
void setClassInterface(ObjCInterfaceDecl *D)
Definition: DeclObjC.h:2740
clang::ObjCPropertyImplDecl::getGetterCXXConstructor
Expr * getGetterCXXConstructor() const
Definition: DeclObjC.h:2851
clang::ObjCImplementationDecl::init_const_range
llvm::iterator_range< init_const_iterator > init_const_range
Definition: DeclObjC.h:2605
clang::ObjCIvarDecl::getNextIvar
const ObjCIvarDecl * getNextIvar() const
Definition: DeclObjC.h:1957
clang::ObjCMethodDecl::CreateDeserialized
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:831
clang::ObjCMethodDecl::isDirectMethod
bool isDirectMethod() const
True if the method is tagged as objc_direct.
Definition: DeclObjC.cpp:836
clang::ObjCTypeParamList::begin
const_iterator begin() const
Definition: DeclObjC.h:693
clang::ObjCContainerDecl::class_properties
classprop_range class_properties() const
Definition: DeclObjC.h:995
clang::ObjCMethodDecl::getSelectorStartLoc
SourceLocation getSelectorStartLoc() const
Definition: DeclObjC.h:291
clang::ObjCCategoryDecl::setImplementation
void setImplementation(ObjCCategoryImplDecl *ImplD)
Definition: DeclObjC.cpp:2097
clang::ObjCMethodDecl::getSelfDecl
ImplicitParamDecl * getSelfDecl() const
Definition: DeclObjC.h:423
clang::ObjCInterfaceDecl::lookupPropertyAccessor
ObjCMethodDecl * lookupPropertyAccessor(const Selector Sel, const ObjCCategoryDecl *Cat, bool IsClassProperty) const
Lookup a setter or getter in the class hierarchy, including in all categories except for category pas...
Definition: DeclObjC.h:1847
clang::ObjCAtDefsFieldDecl::CreateDeserialized
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1883
clang::ObjCInterfaceDecl::protocol_loc_iterator
ObjCProtocolList::loc_iterator protocol_loc_iterator
Definition: DeclObjC.h:1370
clang::ObjCInterfaceDecl::all_protocol_range
llvm::iterator_range< all_protocol_iterator > all_protocol_range
Definition: DeclObjC.h:1400
clang::ObjCCategoryDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2414
clang::ObjCInterfaceDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:1436
clang::ObjCImplementationDecl::getObjCRuntimeNameAsString
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
Definition: DeclObjC.cpp:1592
clang::ObjCInterfaceDecl::all_referenced_protocol_begin
all_protocol_iterator all_referenced_protocol_begin() const
Definition: DeclObjC.h:1407
clang::ObjCMethodDecl::setLazyBody
void setLazyBody(uint64_t Offset)
Definition: DeclObjC.h:532
clang::ObjCIvarDecl::getSynthesize
bool getSynthesize() const
Definition: DeclObjC.h:1976
clang::ObjCInterfaceDecl::getTypeParamList
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
Definition: DeclObjC.cpp:321
IdentifierTable.h
clang::ObjCImplDecl::addPropertyImplementation
void addPropertyImplementation(ObjCPropertyImplDecl *property)
Definition: DeclObjC.cpp:2145
clang::ObjCInterfaceDecl::getCategoryListRaw
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
Definition: DeclObjC.h:1762
clang::ObjCMethodDecl::setDefined
void setDefined(bool isDefined)
Definition: DeclObjC.h:458
Type.h
clang::ImplicitParamDecl
Definition: Decl.h:1599
clang::ObjCMethodDecl::setAsRedeclaration
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
Definition: DeclObjC.cpp:878
clang::NumObjCPropertyAttrsBits
@ NumObjCPropertyAttrsBits
Number of bits fitting all the property attributes.
Definition: DeclObjCCommon.h:50
clang::ObjCTypeParamDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.cpp:1462
clang::ObjCInterfaceDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:1348
clang::Redeclarable< ObjCInterfaceDecl >::redecls
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Definition: Redeclarable.h:296
clang::ObjCContainerDecl::castToDeclContext
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
Definition: DeclObjC.h:1116
clang::ObjCCategoryDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2319
clang::ObjCInterfaceDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:1359
clang::ObjCMethodDecl::hasSkippedBody
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
Definition: DeclObjC.h:482
clang::ObjCMethodDecl::setBody
void setBody(Stmt *B)
Definition: DeclObjC.h:535
clang::ObjCMethodDecl::getReturnType
QualType getReturnType() const
Definition: DeclObjC.h:332
clang::ObjCProtocolDecl::lookupProtocolNamed
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
Definition: DeclObjC.cpp:1948
clang::ObjCProtocolDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:2146
clang::ObjCIvarDecl::Private
@ Private
Definition: DeclObjC.h:1928
clang::ObjCListBase::NumElts
unsigned NumElts
Definition: DeclObjC.h:64
clang::SelectorLocationsKind
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
Definition: SelectorLocationsKind.h:27
clang::ObjCInterfaceDecl::setTypeParamList
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
Definition: DeclObjC.cpp:342
clang::ObjCTypeParamVariance
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
Definition: DeclObjC.h:557
clang::ObjCCategoryImplDecl
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2492
clang::ObjCImplDecl::addInstanceMethod
void addInstanceMethod(ObjCMethodDecl *method)
Definition: DeclObjC.h:2437
llvm::DenseSet
Definition: Sema.h:77
clang::ObjCProtocolDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2253
clang::ObjCContainerDecl::ObjCContainerDecl
ObjCContainerDecl(Kind DK, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
Definition: DeclObjC.cpp:68
clang::ObjCPropertyDecl::overwritePropertyAttributes
void overwritePropertyAttributes(unsigned PRVal)
Definition: DeclObjC.h:819
clang::ObjCMethodDecl::getSelectorLocs
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
Definition: DeclObjC.cpp:903
clang::ObjCInterfaceDecl::setSuperClass
void setSuperClass(TypeSourceInfo *superClass)
Definition: DeclObjC.h:1566
clang::ObjCProtocolDecl::protocol_loc_range
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
Definition: DeclObjC.h:2133
clang::ObjCPropertyAttribute::kind_readonly
@ kind_readonly
Definition: DeclObjCCommon.h:24
clang::ObjCImplementationDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2712
clang::ObjCContainerDecl::setAtStartLoc
void setAtStartLoc(SourceLocation Loc)
Definition: DeclObjC.h:1095
clang::ObjCInterfaceDecl::getTypeParamListAsWritten
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
Definition: DeclObjC.h:1289
clang::ObjCContainerDecl::getIvarDecl
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
Definition: DeclObjC.cpp:80
clang::ObjCMethodDecl::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: DeclObjC.cpp:1012
clang::ObjCAtDefsFieldDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2017
clang::ObjCContainerDecl::instmeth_begin
instmeth_iterator instmeth_begin() const
Definition: DeclObjC.h:1033
clang::ObjCInterfaceDecl::getCategoryClassMethod
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
Definition: DeclObjC.cpp:1741
clang::Redeclarable< ObjCInterfaceDecl >::getPreviousDecl
ObjCInterfaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Definition: Redeclarable.h:204
clang::ObjCImplementationDecl::setIvarLBraceLoc
void setIvarLBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2686
clang::ObjCMethodDecl::getReturnTypeSourceInfo
TypeSourceInfo * getReturnTypeSourceInfo() const
Definition: DeclObjC.h:346
clang::ObjCCategoryDecl::protocol_loc_range
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
Definition: DeclObjC.h:2361
clang::ObjCImplementationDecl::init_range
llvm::iterator_range< init_iterator > init_range
Definition: DeclObjC.h:2604
clang::ObjCPropertyDecl::getType
QualType getType() const
Definition: DeclObjC.h:800
clang::Redeclarable< ObjCInterfaceDecl >::isFirstDecl
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Definition: Redeclarable.h:223
clang::ObjCImplDecl::ObjCImplDecl
ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
Definition: DeclObjC.h:2425
clang::FieldDecl::FieldDecl
FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
Definition: Decl.h:2885
clang::ObjCMethodDecl::Optional
@ Optional
Definition: DeclObjC.h:144
clang::operator<<
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
Definition: ASTContext.cpp:11871
clang::ObjCMethodDecl::setVariadic
void setVariadic(bool isVar)
Definition: DeclObjC.h:437
clang::ObjCImplementationDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2687
clang::ObjCContainerDecl::properties
prop_range properties() const
Definition: DeclObjC.h:963
clang::ObjCPropertyDecl::setSetterName
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
Definition: DeclObjC.h:892
clang::ObjCMethodDecl::getCanonicalDecl
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclObjC.cpp:977
clang::ObjCTypeParamDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:649
clang::ObjCCategoryImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2522
clang::ObjCCategoryDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:2385
clang::ObjCTypeParamList::begin
iterator begin()
Definition: DeclObjC.h:683
clang::ObjCInterfaceDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:1434
clang::ObjCPropertyDecl::setAtLoc
void setAtLoc(SourceLocation L)
Definition: DeclObjC.h:793
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:557
clang::ObjCContainerDecl::prop_range
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
Definition: DeclObjC.h:961
clang::ObjCImplementationDecl::getSuperClass
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2680
clang::ObjCProtocolDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:2112
clang::LazyOffsetPtr::isValid
bool isValid() const
Whether this pointer is non-NULL.
Definition: ExternalASTSource.h:364
clang::ObjCInterfaceDecl::lookupInstanceVariable
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
Definition: DeclObjC.h:1810
clang::ObjCContainerDecl::setAtEndRange
void setAtEndRange(SourceRange atEnd)
Definition: DeclObjC.h:1102
ExternalASTSource.h
clang::ObjCProtocolDecl::getObjCRuntimeNameAsString
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
Definition: DeclObjC.cpp:2033
clang::ObjCInterfaceDecl::lookupInheritedClass
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
Definition: DeclObjC.cpp:661
clang::ObjCCategoryDecl
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2273
clang::ObjCMethodDecl::param_end
param_iterator param_end()
Definition: DeclObjC.h:366
clang::ObjCContainerDecl::classprop_begin
classprop_iterator classprop_begin() const
Definition: DeclObjC.h:999
clang::ObjCPropertyDecl::getSetterKind
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
Definition: DeclObjC.h:869
clang::ObjCInterfaceDecl::isObjCRequiresPropertyDefs
const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...
Definition: DeclObjC.cpp:436
clang::ObjCImplementationDecl::CreateDeserialized
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2237
clang::ObjCPropertyDecl::Copy
@ Copy
Definition: DeclObjC.h:736
clang::ObjCMethodDecl::param_begin
param_iterator param_begin()
Definition: DeclObjC.h:365
clang::ObjCImplementationDecl::getNameAsString
std::string getNameAsString() const
Get the name of the class associated with this interface.
Definition: DeclObjC.h:2674
clang::Type::castAs
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7252
clang::ObjCListBase::size
unsigned size() const
Definition: DeclObjC.h:71
clang::ObjCMethodDecl::getObjCDeclQualifier
ObjCDeclQualifier getObjCDeclQualifier() const
Definition: DeclObjC.h:249
clang::NamedDecl::NamedDecl
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
Definition: Decl.h:259
clang::ObjCProtocolDecl::lookupInstanceMethod
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Definition: DeclObjC.h:2182
clang::ObjCImplementationDecl::inits
init_range inits()
Definition: DeclObjC.h:2607
clang::ObjCMethodDecl::param_iterator
ParmVarDecl *const * param_iterator
Definition: DeclObjC.h:353
clang::ObjCInterfaceDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:1458
clang::ObjCInterfaceDecl::redecl_iterator
redeclarable_base::redecl_iterator redecl_iterator
Definition: DeclObjC.h:1883
clang::ObjCImplementationDecl::Create
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
Definition: DeclObjC.cpp:2221
SourceLocation.h
clang::ObjCCategoryImplDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2520
clang::ObjCInterfaceDecl::known_extensions_end
known_extensions_iterator known_extensions_end() const
Retrieve an iterator to the end of the known-extensions list.
Definition: DeclObjC.h:1751
clang::ObjCImplDecl::property_impls
propimpl_range property_impls() const
Definition: DeclObjC.h:2460
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::ObjCInterfaceDecl::getCategoryInstanceMethod
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
Definition: DeclObjC.cpp:1731
clang::ObjCContainerDecl::getAtStartLoc
SourceLocation getAtStartLoc() const
Definition: DeclObjC.h:1093
clang::ObjCInterfaceDecl::setCategoryListRaw
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
Definition: DeclObjC.h:1775
clang::ObjCMethodDecl::getOverriddenMethods
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
Definition: DeclObjC.cpp:1325
clang::ObjCImplDecl::FindPropertyImplIvarDecl
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
Definition: DeclObjC.cpp:2170
clang::ObjCPropertyDecl::getDefaultSynthIvarName
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
Definition: DeclObjC.cpp:226
clang::ObjCPropertyQueryKind::OBJC_PR_query_unknown
@ OBJC_PR_query_unknown
clang::ObjCPropertyImplDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: DeclObjC.h:2811
clang::ObjCCategoryDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:2390
SelectorLocationsKind.h
clang::ObjCContainerDecl::prop_end
prop_iterator prop_end() const
Definition: DeclObjC.h:969
clang::ObjCImplDecl::propimpl_iterator
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
Definition: DeclObjC.h:2456
clang::ObjCCategoryDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:2363
clang::ObjCInterfaceDecl::all_referenced_protocol_end
all_protocol_iterator all_referenced_protocol_end() const
Definition: DeclObjC.h:1420
clang::ObjCContainerDecl::classmeth_begin
classmeth_iterator classmeth_begin() const
Definition: DeclObjC.h:1050
clang::ObjCContainerDecl::meth_begin
method_iterator meth_begin() const
Definition: DeclObjC.h:1016
false
#define false
Definition: stdbool.h:17
clang::ObjCMethodDecl::GetTypeFn
Definition: DeclObjC.h:397
clang::ObjCPropertyAttribute::kind_noattr
@ kind_noattr
Definition: DeclObjCCommon.h:23
clang::ObjCTypeParamList::end
iterator end()
Definition: DeclObjC.h:685
clang::ObjCInterfaceDecl::known_extensions_empty
bool known_extensions_empty() const
Determine whether the known-extensions list is empty.
Definition: DeclObjC.h:1756
clang::ObjCInterfaceDecl::known_categories_iterator
filtered_category_iterator< isKnownCategory > known_categories_iterator
Iterator that walks over all of the known categories and extensions, including those that are hidden.
Definition: DeclObjC.h:1661
clang::NamedDecl::getIdentifier
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Definition: Decl.h:268
clang::ObjCMethodDecl::setRelatedResultType
void setRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
Definition: DeclObjC.h:264
clang::DeclContext::addDecl
void addDecl(Decl *D)
Add the declaration D into this context.
Definition: DeclBase.cpp:1569
clang::ObjCInterfaceDecl::filtered_category_iterator::iterator_category
std::input_iterator_tag iterator_category
Definition: DeclObjC.h:1586
clang::ObjCImplDecl
Definition: DeclObjC.h:2418
clang::ObjCInterfaceDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:1342
clang::ObjCPropertyDecl::getLParenLoc
SourceLocation getLParenLoc() const
Definition: DeclObjC.h:795
clang::ObjCPropertyDecl::CreateDeserialized
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2303
clang::ObjCCategoryDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2349
clang::ObjCCompatibleAliasDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2738
clang::ObjCInterfaceDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:1373
clang::Redeclarable< ObjCInterfaceDecl >::getNextRedeclaration
ObjCInterfaceDecl * getNextRedeclaration() const
Definition: Redeclarable.h:189
clang::ObjCTypeParamList::front
ObjCTypeParamDecl * front() const
Definition: DeclObjC.h:701
clang::ObjCInterfaceDecl::getSuperClassType
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
Definition: DeclObjC.h:1543
clang::ObjCMethodDecl::isSynthesizedAccessorStub
bool isSynthesizedAccessorStub() const
Definition: DeclObjC.h:449
clang::ObjCPropertyDecl::None
@ None
Definition: DeclObjC.h:737
llvm::ArrayRef
Definition: LLVM.h:34
clang::ObjCImplDecl::addClassMethod
void addClassMethod(ObjCMethodDecl *method)
Definition: DeclObjC.h:2443
clang::ObjCContainerDecl::instprop_begin
instprop_iterator instprop_begin() const
Definition: DeclObjC.h:982
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::ObjCCompatibleAliasDecl::Create
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
Definition: DeclObjC.cpp:2272
clang::ObjCPropertyDecl::SetterKind
SetterKind
Definition: DeclObjC.h:736
clang::ObjCPropertyQueryKind
ObjCPropertyQueryKind
Definition: DeclObjC.h:720
clang::ObjCPropertyDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:920
clang::ObjCMethodDecl::getCanonicalDecl
const ObjCMethodDecl * getCanonicalDecl() const
Definition: DeclObjC.h:245
clang::ObjCPropertyDecl
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:732
clang::ObjCInterfaceDecl::filtered_category_iterator::operator==
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
Definition: DeclObjC.h:1605
clang::ObjCCategoryDecl::setIvarRBraceLoc
void setIvarRBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2411
clang::ObjCIvarDecl::getCanonicalAccessControl
AccessControl getCanonicalAccessControl() const
Definition: DeclObjC.h:1971
clang::ObjCMethodDecl::isInstanceMethod
bool isInstanceMethod() const
Definition: DeclObjC.h:431
clang::ObjCPropertyDecl::setType
void setType(QualType T, TypeSourceInfo *TSI)
Definition: DeclObjC.h:802
clang::ObjCInterfaceDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:1433
clang::ObjCCategoryImplDecl::getCategoryDecl
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2136
clang::ObjCContainerDecl::getMethod
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
Definition: DeclObjC.cpp:92
clang::ObjCProtocolList::loc_begin
loc_iterator loc_begin() const
Definition: DeclObjC.h:112
clang::ObjCMethodDecl::definedInNSObject
bool definedInNSObject(const ASTContext &) const
Is this method defined in the NSObject base class?
Definition: DeclObjC.cpp:846
clang::ObjCInterfaceDecl::lookupPrivateClassMethod
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
Definition: DeclObjC.h:1840
clang::ObjCInterfaceDecl::hasDefinition
bool hasDefinition() const
Determine whether this class has been defined.
Definition: DeclObjC.h:1513
clang::ObjCTypeParamList::size
unsigned size() const
Determine the number of type parameters in this list.
Definition: DeclObjC.h:688
clang::ObjCMethodDecl::getSelectorLoc
SourceLocation getSelectorLoc(unsigned Index) const
Definition: DeclObjC.h:297
LLVM.h
clang::ObjCPropertyDecl::getGetterNameLoc
SourceLocation getGetterNameLoc() const
Definition: DeclObjC.h:882
clang::ObjCPropertyDecl::setGetterName
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
Definition: DeclObjC.h:884
clang::ObjCImplementationDecl::setIvarRBraceLoc
void setIvarRBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2688
clang::ObjCPropertyImplDecl::Dynamic
@ Dynamic
Definition: DeclObjC.h:2754
clang::ObjCInterfaceDecl::filtered_category_iterator::filtered_category_iterator
filtered_category_iterator()=default
clang::ObjCPropertyDecl::getQueryKind
ObjCPropertyQueryKind getQueryKind() const
Definition: DeclObjC.h:856
clang::ObjCCategoryDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2410
clang::ObjCImplementationDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:2691
clang::ObjCPropertyDecl::Weak
@ Weak
Definition: DeclObjC.h:736
clang::ObjCInterfaceDecl::getSuperClass
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:351
clang::ObjCAtDefsFieldDecl::Create
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
Definition: DeclObjC.cpp:1877
clang::ObjCContainerDecl::instprop_end
instprop_iterator instprop_end() const
Definition: DeclObjC.h:986
clang::ObjCPropertyImplDecl::setPropertyDecl
void setPropertyDecl(ObjCPropertyDecl *Prop)
Definition: DeclObjC.h:2817
clang::ObjCCategoryDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:2398
clang::ObjCInterfaceDecl::ASTContext
friend class ASTContext
Definition: DeclObjC.h:1152
clang::ObjCImplementationDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2689
clang::ObjCPropertyImplDecl::getPropertyImplementation
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2819
clang::ObjCInterfaceDecl::setImplementation
void setImplementation(ObjCImplementationDecl *ImplD)
Definition: DeclObjC.cpp:1613
clang::DeclContext::filtered_decl_iterator
Iterates over a filtered subrange of declarations stored in a DeclContext.
Definition: DeclBase.h:2219
clang::Redeclarable< ObjCInterfaceDecl >::getMostRecentDecl
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
Definition: Redeclarable.h:226
clang::ObjCImplementationDecl::hasNonZeroConstructors
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
Definition: DeclObjC.h:2647
clang::ObjCTypeParamList::TrailingObjects
friend TrailingObjects
Definition: DeclObjC.h:672
clang::ObjCMethodDecl::isOptional
bool isOptional() const
Definition: DeclObjC.h:509
clang::ObjCTypeParamList::getRAngleLoc
SourceLocation getRAngleLoc() const
Definition: DeclObjC.h:712
clang::ObjCMethodDecl::setObjCDeclQualifier
void setObjCDeclQualifier(ObjCDeclQualifier QV)
Definition: DeclObjC.h:253
clang::ObjCAtDefsFieldDecl
Represents a field declaration created by an @defs(...).
Definition: DeclObjC.h:1997
clang::ObjCMethodDecl::None
@ None
Definition: DeclObjC.h:144
clang::ObjCIvarDecl::setNextIvar
void setNextIvar(ObjCIvarDecl *ivar)
Definition: DeclObjC.h:1958
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:84
clang::ObjCList< clang::ObjCProtocolDecl >::iterator
clang::ObjCProtocolDecl *const * iterator
Definition: DeclObjC.h:89
clang::ObjCImplementationDecl::init_end
init_const_iterator init_end() const
end() - Retrieve an iterator past the last initializer.
Definition: DeclObjC.h:2628
clang::ObjCInterfaceDecl::filtered_category_iterator::filtered_category_iterator
filtered_category_iterator(ObjCCategoryDecl *Current)
Definition: DeclObjC.h:1589
clang::ObjCImplDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2434
clang::ObjCCategoryDecl::CreateDeserialized
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2085
clang::ObjCCategoryDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:2347
clang::ObjCPropertyImplDecl::getPropertyDecl
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2814
clang::ObjCInterfaceDecl::getCanonicalDecl
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
Definition: DeclObjC.h:1893
clang::ObjCPropertyDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:936
clang::ObjCInterfaceDecl::visible_extensions_iterator
filtered_category_iterator< isVisibleExtension > visible_extensions_iterator
Iterator that walks over all of the visible extensions, skipping any that are known but hidden.
Definition: DeclObjC.h:1696
clang::ObjCPropertyDecl::getPropertyAttributesAsWritten
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
Definition: DeclObjC.h:823
clang::ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
Definition: DeclObjC.cpp:382
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::ObjCContainerDecl::classmeth_end
classmeth_iterator classmeth_end() const
Definition: DeclObjC.h:1054
clang::ObjCTypeParamDecl
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:582
clang::ObjCCategoryDecl::getNextClassCategoryRaw
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
Definition: DeclObjC.h:2379
clang::ObjCPropertyDecl::getGetterName
Selector getGetterName() const
Definition: DeclObjC.h:881
clang::ObjCPropertyDecl::getSetterNameLoc
SourceLocation getSetterNameLoc() const
Definition: DeclObjC.h:890
clang::ObjCMethodDecl::getBody
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:874
clang::ObjCInterfaceDecl::visible_categories_empty
bool visible_categories_empty() const
Determine whether the visible-categories list is empty.
Definition: DeclObjC.h:1648
clang::ASTReader
Reads an AST files chain containing the contents of a translation unit.
Definition: ASTReader.h:340
clang::ObjCInterfaceDecl::known_extensions_range
llvm::iterator_range< known_extensions_iterator > known_extensions_range
Definition: DeclObjC.h:1737
clang::ObjCImplementationDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:2704
clang::ObjCMethodDecl::setSynthesizedAccessorStub
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
Definition: DeclObjC.h:453
clang::ObjCProtocolDecl::CreateDeserialized
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1918
clang::ObjCInterfaceDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1900
clang::ObjCPropertyImplDecl::Kind
Kind
Definition: DeclObjC.h:2752
clang::ObjCMethodDecl::setOverriding
void setOverriding(bool IsOver)
Definition: DeclObjC.h:468
clang::ObjCPropertyImplDecl::isIvarNameSpecified
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
Definition: DeclObjC.h:2841
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::ObjCInterfaceDecl::known_categories_begin
known_categories_iterator known_categories_begin() const
Retrieve an iterator to the beginning of the known-categories list.
Definition: DeclObjC.h:1672
clang::Decl::isUnconditionallyVisible
bool isUnconditionallyVisible() const
Determine whether this declaration is definitely visible to name lookup, independent of whether the o...
Definition: DeclBase.h:797
clang::ObjCImplDecl::FindPropertyImplDecl
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
Definition: DeclObjC.cpp:2182
clang::ObjCMethodDecl::param_type_begin
param_type_iterator param_type_begin() const
Definition: DeclObjC.h:404
clang::ObjCMethodDecl::hasBody
bool hasBody() const override
Determine whether this method has a body.
Definition: DeclObjC.h:527
clang::ObjCPropertyQueryKind::OBJC_PR_query_instance
@ OBJC_PR_query_instance
clang::ObjCInterfaceDecl::known_categories_end
known_categories_iterator known_categories_end() const
Retrieve an iterator to the end of the known-categories list.
Definition: DeclObjC.h:1677
clang::ObjCInterfaceDecl::FindCategoryDeclaration
ObjCCategoryDecl * FindCategoryDeclaration(IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
Definition: DeclObjC.cpp:1715
clang::ObjCMethodDecl::param_begin
param_const_iterator param_begin() const
Definition: DeclObjC.h:357
clang::ObjCImplementationDecl::ivar_end
ivar_iterator ivar_end() const
Definition: DeclObjC.h:2700
clang::ObjCInterfaceDecl::getEndOfDefinitionLoc
SourceLocation getEndOfDefinitionLoc() const
Definition: DeclObjC.h:1856
clang::ObjCImplDecl::setClassInterface
void setClassInterface(ObjCInterfaceDecl *IFace)
Definition: DeclObjC.cpp:2151
clang::ObjCMethodDecl::getCmdDecl
ImplicitParamDecl * getCmdDecl() const
Definition: DeclObjC.h:425
clang::ObjCImplementationDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:2708
clang::ObjCPropertyDecl::setGetterMethodDecl
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
Definition: DeclObjC.h:898
clang::ObjCMethodDecl::findPropertyDecl
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
Definition: DeclObjC.cpp:1343
clang::ObjCContainerDecl::class_methods
classmeth_range class_methods() const
Definition: DeclObjC.h:1046
clang::IdentifierInfo::getName
StringRef getName() const
Return the actual identifier string.
Definition: IdentifierTable.h:195
clang::ObjCInterfaceDecl::known_categories
known_categories_range known_categories() const
Definition: DeclObjC.h:1665
clang::Builtin::ID
ID
Definition: Builtins.h:48
clang::ObjCTypeParamList
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Definition: DeclObjC.h:660
clang::ObjCInterfaceDecl::visible_categories_iterator
filtered_category_iterator< isVisibleCategory > visible_categories_iterator
Iterator that walks over the list of categories and extensions that are visible, i....
Definition: DeclObjC.h:1626
clang::ObjCPropertyDecl::isRetaining
bool isRetaining() const
isRetaining - Return true if the property retains its value.
Definition: DeclObjC.h:844
clang::ObjCIvarDecl::Create
static ObjCIvarDecl * Create(ASTContext &C, ObjCContainerDecl *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW=nullptr, bool synthesized=false)
Definition: DeclObjC.cpp:1799
clang
Definition: CalledOnceCheck.h:17
clang::ObjCContainerDecl::getInstanceMethod
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
Definition: DeclObjC.h:1062
clang::ObjCProtocolList::loc_end
loc_iterator loc_end() const
Definition: DeclObjC.h:113
clang::ObjCPropertyDecl::Required
@ Required
Definition: DeclObjC.h:737
clang::ObjCInterfaceDecl::filtered_category_iterator::operator*
reference operator*() const
Definition: DeclObjC.h:1594
clang::ObjCInterfaceDecl::protocol_loc_range
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
Definition: DeclObjC.h:1371
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:748
clang::ObjCPropertyDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: DeclObjC.h:798
clang::ObjCMethodDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: DeclObjC.h:285
clang::ObjCMethodDecl::isDesignatedInitializerForTheInterface
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface.
Definition: DeclObjC.cpp:854
clang::ObjCMethodDecl::setInstanceMethod
void setInstanceMethod(bool isInst)
Definition: DeclObjC.h:432
clang::ObjCCategoryDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2415
clang::ObjCInterfaceDecl::filtered_category_iterator::value_type
ObjCCategoryDecl * value_type
Definition: DeclObjC.h:1582
clang::ObjCListBase::empty
bool empty() const
Definition: DeclObjC.h:72
clang::ObjCInterfaceDecl::getSuperClassTInfo
TypeSourceInfo * getSuperClassTInfo() const
Definition: DeclObjC.h:1551
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:69
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1923
ptrdiff_t
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
Definition: opencl-c-base.h:110
clang::ObjCProtocolDecl::isNonRuntimeProtocol
bool isNonRuntimeProtocol() const
This is true iff the protocol is tagged with the objc_non_runtime_protocol attribute.
Definition: DeclObjC.cpp:1927
clang::ObjCInterfaceDecl::ivar_end
ivar_iterator ivar_end() const
Definition: DeclObjC.h:1446
clang::ObjCContainerDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:1104
clang::ObjCCategoryDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2412
clang::ObjCCategoryDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:2371
clang::ObjCMethodDecl::setReturnTypeSourceInfo
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
Definition: DeclObjC.h:347
clang::ObjCContainerDecl::PropertyDeclOrder
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
Definition: DeclObjC.h:1085
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2049
clang::ObjCPropertyImplDecl::setSetterCXXAssignment
void setSetterCXXAssignment(Expr *setterCXXAssignment)
Definition: DeclObjC.h:2863
clang::ObjCPropertyImplDecl::setSetterMethodDecl
void setSetterMethodDecl(ObjCMethodDecl *MD)
Definition: DeclObjC.h:2849
clang::SourceLocation::isValid
bool isValid() const
Return true if this is a valid SourceLocation object.
Definition: SourceLocation.h:110
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6421
clang::ObjCInterfaceDecl::filtered_category_iterator::operator->
pointer operator->() const
Definition: DeclObjC.h:1595
clang::NamedDecl::getDeclName
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:311
clang::ObjCCompatibleAliasDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2743
clang::ObjCMethodDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:287
clang::ObjCProtocolDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:2135
clang::ObjCPropertyDecl::setLParenLoc
void setLParenLoc(SourceLocation L)
Definition: DeclObjC.h:796
clang::ObjCCategoryDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:2342
clang::ObjCProtocolDecl::redecl_iterator
redeclarable_base::redecl_iterator redecl_iterator
Definition: DeclObjC.h:2233
clang::ObjCImplementationDecl::getNumIvarInitializers
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
Definition: DeclObjC.h:2633
clang::Decl::DeclContext
friend class DeclContext
Definition: DeclBase.h:242
clang::ObjCCategoryDecl::getTypeParamList
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
Definition: DeclObjC.h:2323
clang::ObjCTypeParamList::const_iterator
ObjCTypeParamDecl *const * const_iterator
Definition: DeclObjC.h:691
clang::ObjCCategoryDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:2357
clang::ObjCContainerDecl::FindPropertyDeclaration
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
Definition: DeclObjC.cpp:249
clang::ObjCMethodDecl::hasParamDestroyedInCallee
bool hasParamDestroyedInCallee() const
True if the method has a parameter that's destroyed in the callee.
Definition: DeclObjC.cpp:866
clang::ObjCPropertyDecl::Retain
@ Retain
Definition: DeclObjC.h:736
clang::ObjCInterfaceDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:1388
clang::ObjCContainerDecl::classmeth_range
llvm::iterator_range< classmeth_iterator > classmeth_range
Definition: DeclObjC.h:1044
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3183
clang::ObjCProtocolDecl::lookupMethod
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
Definition: DeclObjC.cpp:1963
clang::ObjCInterfaceDecl::all_referenced_protocols
all_protocol_range all_referenced_protocols() const
Definition: DeclObjC.h:1402
clang::ObjCInterfaceDecl::setIvarList
void setIvarList(ObjCIvarDecl *ivar)
Definition: DeclObjC.h:1466
clang::ObjCInterfaceDecl::all_declared_ivar_begin
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
Definition: DeclObjC.cpp:1643
clang::ObjCMethodDecl::getParamDecl
ParmVarDecl * getParamDecl(unsigned Idx)
Definition: DeclObjC.h:381
clang::ObjCContainerDecl
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:944
clang::ObjCIvarDecl::setAccessControl
void setAccessControl(AccessControl ac)
Definition: DeclObjC.h:1967
clang::ObjCCategoryDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2406
clang::ObjCContainerDecl::instance_properties
instprop_range instance_properties() const
Definition: DeclObjC.h:978
clang::ObjCTypeParamList::create
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
Definition: DeclObjC.cpp:1485
clang::ObjCMethodDecl::GetTypeFn::operator()
QualType operator()(const ParmVarDecl *PD) const
Definition: DeclObjC.h:398
clang::ObjCInterfaceDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1901
clang::ObjCMethodDecl::isPropertyAccessor
bool isPropertyAccessor() const
Definition: DeclObjC.h:441
clang::ObjCInterfaceDecl::isSuperClassOf
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
Definition: DeclObjC.h:1788
clang::ObjCIvarDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1984
clang::ObjCContainerDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1109
clang::ObjCContainerDecl::prop_begin
prop_iterator prop_begin() const
Definition: DeclObjC.h:965
clang::ObjCMethodDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:376
clang::ObjCIvarDecl::CreateDeserialized
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1835
clang::ObjCProtocolDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2254
clang::ObjCMethodDecl::isRedeclaration
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
Definition: DeclObjC.h:269
clang::ObjCContainerDecl::collectPropertiesToImplement
virtual void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const
This routine collects list of properties to be implemented in the class.
Definition: DeclObjC.h:1090
clang::ObjCPropertyDecl::getAtLoc
SourceLocation getAtLoc() const
Definition: DeclObjC.h:792
clang::ObjCImplDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2474
clang::ObjCInterfaceDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
Definition: DeclObjC.cpp:371
clang::ObjCPropertyImplDecl::setAtLoc
void setAtLoc(SourceLocation Loc)
Definition: DeclObjC.h:2812
clang::ObjCCategoryImplDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2523
clang::ObjCCategoryDecl::Create
static ObjCCategoryDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, ObjCTypeParamList *typeParamList, SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
Definition: DeclObjC.cpp:2059
llvm::SmallVectorImpl
Definition: LLVM.h:39
clang::ObjCMethodDecl::getCategory
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
Definition: DeclObjC.cpp:1188
clang::ObjCTypeParamDecl::CreateDeserialized
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
Definition: DeclObjC.cpp:1454
clang::ObjCIvarDecl::getUsageType
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
Definition: DeclObjC.cpp:1865
clang::ValueDecl::getType
QualType getType() const
Definition: Decl.h:685
true
#define true
Definition: stdbool.h:16
clang::ObjCPropertyDecl::PropertyControl
PropertyControl
Definition: DeclObjC.h:737
clang::ObjCMethodDecl::ImplementationControl
ImplementationControl
Definition: DeclObjC.h:144
clang::ObjCProtocolDecl::getImpliedProtocols
void getImpliedProtocols(llvm::DenseSet< const ObjCProtocolDecl * > &IPs) const
Get the set of all protocols implied by this protocols inheritance hierarchy.
Definition: DeclObjC.cpp:1931
clang::ObjCTypeParamDecl::getIndex
unsigned getIndex() const
Retrieve the index into its type parameter list.
Definition: DeclObjC.h:638
clang::ObjCInterfaceDecl::known_extensions_begin
known_extensions_iterator known_extensions_begin() const
Retrieve an iterator to the beginning of the known-extensions list.
Definition: DeclObjC.h:1746
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::FieldDecl::getCanonicalDecl
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
Definition: Decl.h:3041
clang::ObjCPropertyImplDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.cpp:2343
clang::ASTDeclReader
Definition: ASTReaderDecl.cpp:80
clang::ObjCProtocolDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2111
clang::ObjCContainerDecl::getClassMethod
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
Definition: DeclObjC.h:1067
clang::ObjCInterfaceDecl::getTypeForDecl
const Type * getTypeForDecl() const
Definition: DeclObjC.h:1897
clang::ObjCInterfaceDecl::isImplicitInterfaceDecl
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
Definition: DeclObjC.h:1871
clang::ObjCCategoryDecl::setCategoryNameLoc
void setCategoryNameLoc(SourceLocation Loc)
Definition: DeclObjC.h:2407
DeclObjCCommon.h
clang::ObjCAtDefsFieldDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2016
clang::ObjCInterfaceDecl::isDesignatedInitializer
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface.
Definition: DeclObjC.cpp:574
clang::TypedefNameDecl::TypedefNameDecl
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
Definition: Decl.h:3198
clang::ObjCMethodDecl::setCmdDecl
void setCmdDecl(ImplicitParamDecl *CD)
Definition: DeclObjC.h:426
clang::CXXCtorInitializer
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2171
clang::ObjCContainerDecl::meth_end
method_iterator meth_end() const
Definition: DeclObjC.h:1020
clang::ObjCMethodDecl::setMethodParams
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=llvm::None)
Sets the method's parameters and selector source locations.
Definition: DeclObjC.cpp:909
clang::transformer::name
RangeSelector name(std::string ID)
Given a node with a "name", (like NamedDecl, DeclRefExpr, CxxCtorInitializer, and TypeLoc) selects th...
Definition: RangeSelector.cpp:200
clang::ObjCMethodDecl::isClassMethod
bool isClassMethod() const
Definition: DeclObjC.h:439
clang::ObjCProtocolDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:2106
clang::ObjCContainerDecl::getAtEndRange
SourceRange getAtEndRange() const
Definition: DeclObjC.h:1100
clang::ObjCInterfaceDecl::visible_extensions_range
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
Definition: DeclObjC.h:1699
clang::ObjCPropertyDecl::getPropertyAttributes
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:811
clang::ASTDeclWriter
Definition: ASTWriterDecl.cpp:34
clang::ObjCTypeParamDecl::setVariance
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
Definition: DeclObjC.h:630
clang::ObjCMethodDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Definition: DeclObjC.h:538
clang::ObjCInterfaceDecl::visible_categories_begin
visible_categories_iterator visible_categories_begin() const
Retrieve an iterator to the beginning of the visible-categories list.
Definition: DeclObjC.h:1638
clang::Decl::getLocation
SourceLocation getLocation() const
Definition: DeclBase.h:424
clang::ObjCPropertyDecl::setPropertyIvarDecl
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
Definition: DeclObjC.h:916
clang::ObjCPropertyImplDecl::CreateDeserialized
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2336
clang::ObjCProtocolDecl::hasDefinition
bool hasDefinition() const
Determine whether this protocol has a definition.
Definition: DeclObjC.h:2191
clang::ObjCPropertyImplDecl::classofKind
static bool classofKind(Decl::Kind K)
Definition: DeclObjC.h:2868
clang::ObjCInterfaceDecl::startDefinition
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
Definition: DeclObjC.cpp:620
clang::ObjCList
ObjCList - This is a simple template class used to hold various lists of decls etc,...
Definition: DeclObjC.h:83
clang::ObjCProtocolDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
Definition: DeclObjC.h:2214
clang::ObjCPropertyDecl::getQueryKind
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
Definition: DeclObjC.h:861
clang::ObjCMethodDecl::getSendResultType
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
Definition: DeclObjC.cpp:1203
clang::ObjCPropertyDecl::findPropertyDecl
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
Definition: DeclObjC.cpp:178
clang::ObjCProtocolDecl::getDefinition
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
Definition: DeclObjC.h:2208
clang::ObjCPropertyAttribute::kind_retain
@ kind_retain
Definition: DeclObjCCommon.h:28
clang::ObjCCategoryDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2346
clang::ObjCCategoryDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2358
clang::ObjCProtocolList::set
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Definition: DeclObjC.cpp:54
clang::ObjCIvarDecl::setSynthesize
void setSynthesize(bool synth)
Definition: DeclObjC.h:1975
clang::ObjCPropertyDecl::Create
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
Definition: DeclObjC.cpp:2291
clang::ObjCImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2472
clang::ObjCInterfaceDecl::Create
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
Definition: DeclObjC.cpp:1507
clang::ObjCProtocolDecl::getDefinition
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
Definition: DeclObjC.h:2203
clang::ObjCList::begin
iterator begin() const
Definition: DeclObjC.h:91
clang::ICIS_NoInit
@ ICIS_NoInit
No in-class initializer.
Definition: Specifiers.h:257
clang::ObjCMethodDecl::isVariadic
bool isVariadic() const
Definition: DeclObjC.h:436
clang::ObjCContainerDecl::method_iterator
specific_decl_iterator< ObjCMethodDecl > method_iterator
Definition: DeclObjC.h:1008
clang::ObjCMethodDecl::param_type_iterator
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
Definition: DeclObjC.h:402
clang::ObjCInterfaceDecl::setProtocolList
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
Definition: DeclObjC.h:1470
clang::ObjCMethodDecl::param_size
unsigned param_size() const
Definition: DeclObjC.h:350
clang::declaresSameEntity
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
Definition: DeclBase.h:1206
clang::ObjCInterfaceDecl::getDefinition
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
Definition: DeclObjC.h:1527
clang::ObjCCategoryDecl::setProtocolList
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
Definition: DeclObjC.h:2337
clang::ObjCPropertyImplDecl::setGetterMethodDecl
void setGetterMethodDecl(ObjCMethodDecl *MD)
Definition: DeclObjC.h:2846
clang::ObjCIvarDecl::Package
@ Package
Definition: DeclObjC.h:1928
clang::ObjCMethodDecl::sel_param_end
param_const_iterator sel_param_end() const
Definition: DeclObjC.h:370
clang::ObjCInterfaceDecl::getObjCRuntimeNameAsString
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
Definition: DeclObjC.cpp:1584
clang::ObjCMethodDecl::getImplementationControl
ImplementationControl getImplementationControl() const
Definition: DeclObjC.h:505
clang::ObjCCategoryImplDecl::Create
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
Definition: DeclObjC.cpp:2117
clang::ObjCImplementationDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:2692
clang::DeclContext::decls_begin
decl_iterator decls_begin() const
Definition: DeclBase.cpp:1429