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  /// Returns the property associated with this method's selector.
491  ///
492  /// Note that even if this particular method is not marked as a property
493  /// accessor, it is still possible for it to match a property declared in a
494  /// superclass. Pass \c false if you only want to check the current class.
495  const ObjCPropertyDecl *findPropertyDecl(bool CheckOverrides = true) const;
496 
497  // Related to protocols declared in \@protocol
499  ObjCMethodDeclBits.DeclImplementation = ic;
500  }
501 
503  return ImplementationControl(ObjCMethodDeclBits.DeclImplementation);
504  }
505 
506  bool isOptional() const {
508  }
509 
510  /// Returns true if this specific method declaration is marked with the
511  /// designated initializer attribute.
513 
514  /// Returns true if the method selector resolves to a designated initializer
515  /// in the class's interface.
516  ///
517  /// \param InitMethod if non-null and the function returns true, it receives
518  /// the method declaration that was marked with the designated initializer
519  /// attribute.
521  const ObjCMethodDecl **InitMethod = nullptr) const;
522 
523  /// Determine whether this method has a body.
524  bool hasBody() const override { return Body.isValid(); }
525 
526  /// Retrieve the body of this method, if it has one.
527  Stmt *getBody() const override;
528 
529  void setLazyBody(uint64_t Offset) { Body = Offset; }
530 
532  void setBody(Stmt *B) { Body = B; }
533 
534  /// Returns whether this specific method is a definition.
535  bool isThisDeclarationADefinition() const { return hasBody(); }
536 
537  /// Is this method defined in the NSObject base class?
538  bool definedInNSObject(const ASTContext &) const;
539 
540  // Implement isa/cast/dyncast/etc.
541  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
542  static bool classofKind(Kind K) { return K == ObjCMethod; }
543 
545  return static_cast<DeclContext *>(const_cast<ObjCMethodDecl*>(D));
546  }
547 
549  return static_cast<ObjCMethodDecl *>(const_cast<DeclContext*>(DC));
550  }
551 };
552 
553 /// Describes the variance of a given generic parameter.
554 enum class ObjCTypeParamVariance : uint8_t {
555  /// The parameter is invariant: must match exactly.
556  Invariant,
557 
558  /// The parameter is covariant, e.g., X<T> is a subtype of X<U> when
559  /// the type parameter is covariant and T is a subtype of U.
560  Covariant,
561 
562  /// The parameter is contravariant, e.g., X<T> is a subtype of X<U>
563  /// when the type parameter is covariant and U is a subtype of T.
565 };
566 
567 /// Represents the declaration of an Objective-C type parameter.
568 ///
569 /// \code
570 /// @interface NSDictionary<Key : id<NSCopying>, Value>
571 /// @end
572 /// \endcode
573 ///
574 /// In the example above, both \c Key and \c Value are represented by
575 /// \c ObjCTypeParamDecl. \c Key has an explicit bound of \c id<NSCopying>,
576 /// while \c Value gets an implicit bound of \c id.
577 ///
578 /// Objective-C type parameters are typedef-names in the grammar,
580  /// Index of this type parameter in the type parameter list.
581  unsigned Index : 14;
582 
583  /// The variance of the type parameter.
584  unsigned Variance : 2;
585 
586  /// The location of the variance, if any.
587  SourceLocation VarianceLoc;
588 
589  /// The location of the ':', which will be valid when the bound was
590  /// explicitly specified.
591  SourceLocation ColonLoc;
592 
594  ObjCTypeParamVariance variance, SourceLocation varianceLoc,
595  unsigned index,
597  SourceLocation colonLoc, TypeSourceInfo *boundInfo)
598  : TypedefNameDecl(ObjCTypeParam, ctx, dc, nameLoc, nameLoc, name,
599  boundInfo),
600  Index(index), Variance(static_cast<unsigned>(variance)),
601  VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
602 
603  void anchor() override;
604 
605 public:
606  friend class ASTDeclReader;
607  friend class ASTDeclWriter;
608 
610  ObjCTypeParamVariance variance,
611  SourceLocation varianceLoc,
612  unsigned index,
613  SourceLocation nameLoc,
615  SourceLocation colonLoc,
616  TypeSourceInfo *boundInfo);
617  static ObjCTypeParamDecl *CreateDeserialized(ASTContext &ctx, unsigned ID);
618 
619  SourceRange getSourceRange() const override LLVM_READONLY;
620 
621  /// Determine the variance of this type parameter.
623  return static_cast<ObjCTypeParamVariance>(Variance);
624  }
625 
626  /// Set the variance of this type parameter.
628  Variance = static_cast<unsigned>(variance);
629  }
630 
631  /// Retrieve the location of the variance keyword.
632  SourceLocation getVarianceLoc() const { return VarianceLoc; }
633 
634  /// Retrieve the index into its type parameter list.
635  unsigned getIndex() const { return Index; }
636 
637  /// Whether this type parameter has an explicitly-written type bound, e.g.,
638  /// "T : NSView".
639  bool hasExplicitBound() const { return ColonLoc.isValid(); }
640 
641  /// Retrieve the location of the ':' separating the type parameter name
642  /// from the explicitly-specified bound.
643  SourceLocation getColonLoc() const { return ColonLoc; }
644 
645  // Implement isa/cast/dyncast/etc.
646  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
647  static bool classofKind(Kind K) { return K == ObjCTypeParam; }
648 };
649 
650 /// Stores a list of Objective-C type parameters for a parameterized class
651 /// or a category/extension thereof.
652 ///
653 /// \code
654 /// @interface NSArray<T> // stores the <T>
655 /// @end
656 /// \endcode
657 class ObjCTypeParamList final
658  : private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
659  /// Location of the left and right angle brackets.
660  SourceRange Brackets;
661  /// The number of parameters in the list, which are tail-allocated.
662  unsigned NumParams;
663 
666  SourceLocation rAngleLoc);
667 
668 public:
670 
671  /// Create a new Objective-C type parameter list.
672  static ObjCTypeParamList *create(ASTContext &ctx,
673  SourceLocation lAngleLoc,
675  SourceLocation rAngleLoc);
676 
677  /// Iterate through the type parameters in the list.
679 
680  iterator begin() { return getTrailingObjects<ObjCTypeParamDecl *>(); }
681 
682  iterator end() { return begin() + size(); }
683 
684  /// Determine the number of type parameters in this list.
685  unsigned size() const { return NumParams; }
686 
687  // Iterate through the type parameters in the list.
689 
691  return getTrailingObjects<ObjCTypeParamDecl *>();
692  }
693 
694  const_iterator end() const {
695  return begin() + size();
696  }
697 
699  assert(size() > 0 && "empty Objective-C type parameter list");
700  return *begin();
701  }
702 
704  assert(size() > 0 && "empty Objective-C type parameter list");
705  return *(end() - 1);
706  }
707 
708  SourceLocation getLAngleLoc() const { return Brackets.getBegin(); }
709  SourceLocation getRAngleLoc() const { return Brackets.getEnd(); }
710  SourceRange getSourceRange() const { return Brackets; }
711 
712  /// Gather the default set of type arguments to be substituted for
713  /// these type parameters when dealing with an unspecialized type.
714  void gatherDefaultTypeArgs(SmallVectorImpl<QualType> &typeArgs) const;
715 };
716 
717 enum class ObjCPropertyQueryKind : uint8_t {
718  OBJC_PR_query_unknown = 0x00,
721 };
722 
723 /// Represents one property declaration in an Objective-C interface.
724 ///
725 /// For example:
726 /// \code{.mm}
727 /// \@property (assign, readwrite) int MyProperty;
728 /// \endcode
729 class ObjCPropertyDecl : public NamedDecl {
730  void anchor() override;
731 
732 public:
735 
736 private:
737  // location of \@property
738  SourceLocation AtLoc;
739 
740  // location of '(' starting attribute list or null.
741  SourceLocation LParenLoc;
742 
743  QualType DeclType;
744  TypeSourceInfo *DeclTypeSourceInfo;
745  unsigned PropertyAttributes : NumObjCPropertyAttrsBits;
746  unsigned PropertyAttributesAsWritten : NumObjCPropertyAttrsBits;
747 
748  // \@required/\@optional
749  unsigned PropertyImplementation : 2;
750 
751  // getter name of NULL if no getter
752  Selector GetterName;
753 
754  // setter name of NULL if no setter
755  Selector SetterName;
756 
757  // location of the getter attribute's value
758  SourceLocation GetterNameLoc;
759 
760  // location of the setter attribute's value
761  SourceLocation SetterNameLoc;
762 
763  // Declaration of getter instance method
764  ObjCMethodDecl *GetterMethodDecl = nullptr;
765 
766  // Declaration of setter instance method
767  ObjCMethodDecl *SetterMethodDecl = nullptr;
768 
769  // Synthesize ivar for this property
770  ObjCIvarDecl *PropertyIvarDecl = nullptr;
771 
773  SourceLocation AtLocation, SourceLocation LParenLocation,
774  QualType T, TypeSourceInfo *TSI, PropertyControl propControl)
775  : NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
776  LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
777  PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
778  PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
779  PropertyImplementation(propControl), GetterName(Selector()),
780  SetterName(Selector()) {}
781 
782 public:
783  static ObjCPropertyDecl *Create(ASTContext &C, DeclContext *DC,
784  SourceLocation L,
785  IdentifierInfo *Id, SourceLocation AtLocation,
786  SourceLocation LParenLocation,
787  QualType T,
788  TypeSourceInfo *TSI,
789  PropertyControl propControl = None);
790 
791  static ObjCPropertyDecl *CreateDeserialized(ASTContext &C, unsigned ID);
792 
793  SourceLocation getAtLoc() const { return AtLoc; }
794  void setAtLoc(SourceLocation L) { AtLoc = L; }
795 
796  SourceLocation getLParenLoc() const { return LParenLoc; }
797  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
798 
799  TypeSourceInfo *getTypeSourceInfo() const { return DeclTypeSourceInfo; }
800 
801  QualType getType() const { return DeclType; }
802 
804  DeclType = T;
805  DeclTypeSourceInfo = TSI;
806  }
807 
808  /// Retrieve the type when this property is used with a specific base object
809  /// type.
810  QualType getUsageType(QualType objectType) const;
811 
813  return ObjCPropertyAttribute::Kind(PropertyAttributes);
814  }
815 
817  PropertyAttributes |= PRVal;
818  }
819 
820  void overwritePropertyAttributes(unsigned PRVal) {
821  PropertyAttributes = PRVal;
822  }
823 
825  return ObjCPropertyAttribute::Kind(PropertyAttributesAsWritten);
826  }
827 
829  PropertyAttributesAsWritten = PRVal;
830  }
831 
832  // Helper methods for accessing attributes.
833 
834  /// isReadOnly - Return true iff the property has a setter.
835  bool isReadOnly() const {
836  return (PropertyAttributes & ObjCPropertyAttribute::kind_readonly);
837  }
838 
839  /// isAtomic - Return true if the property is atomic.
840  bool isAtomic() const {
841  return (PropertyAttributes & ObjCPropertyAttribute::kind_atomic);
842  }
843 
844  /// isRetaining - Return true if the property retains its value.
845  bool isRetaining() const {
846  return (PropertyAttributes & (ObjCPropertyAttribute::kind_retain |
849  }
850 
851  bool isInstanceProperty() const { return !isClassProperty(); }
852  bool isClassProperty() const {
853  return PropertyAttributes & ObjCPropertyAttribute::kind_class;
854  }
855  bool isDirectProperty() const;
856 
860  }
861 
865  }
866 
867  /// getSetterKind - Return the method used for doing assignment in
868  /// the property setter. This is only valid if the property has been
869  /// defined to have a setter.
871  if (PropertyAttributes & ObjCPropertyAttribute::kind_strong)
872  return getType()->isBlockPointerType() ? Copy : Retain;
873  if (PropertyAttributes & ObjCPropertyAttribute::kind_retain)
874  return Retain;
875  if (PropertyAttributes & ObjCPropertyAttribute::kind_copy)
876  return Copy;
877  if (PropertyAttributes & ObjCPropertyAttribute::kind_weak)
878  return Weak;
879  return Assign;
880  }
881 
882  Selector getGetterName() const { return GetterName; }
883  SourceLocation getGetterNameLoc() const { return GetterNameLoc; }
884 
886  GetterName = Sel;
887  GetterNameLoc = Loc;
888  }
889 
890  Selector getSetterName() const { return SetterName; }
891  SourceLocation getSetterNameLoc() const { return SetterNameLoc; }
892 
894  SetterName = Sel;
895  SetterNameLoc = Loc;
896  }
897 
898  ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
899  void setGetterMethodDecl(ObjCMethodDecl *gDecl) { GetterMethodDecl = gDecl; }
900 
901  ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; }
902  void setSetterMethodDecl(ObjCMethodDecl *gDecl) { SetterMethodDecl = gDecl; }
903 
904  // Related to \@optional/\@required declared in \@protocol
906  PropertyImplementation = pc;
907  }
908 
910  return PropertyControl(PropertyImplementation);
911  }
912 
913  bool isOptional() const {
915  }
916 
918  PropertyIvarDecl = Ivar;
919  }
920 
922  return PropertyIvarDecl;
923  }
924 
925  SourceRange getSourceRange() const override LLVM_READONLY {
926  return SourceRange(AtLoc, getLocation());
927  }
928 
929  /// Get the default name of the synthesized ivar.
931 
932  /// Lookup a property by name in the specified DeclContext.
934  const IdentifierInfo *propertyID,
935  ObjCPropertyQueryKind queryKind);
936 
937  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
938  static bool classofKind(Kind K) { return K == ObjCProperty; }
939 };
940 
941 /// ObjCContainerDecl - Represents a container for method declarations.
942 /// Current sub-classes are ObjCInterfaceDecl, ObjCCategoryDecl,
943 /// ObjCProtocolDecl, and ObjCImplDecl.
944 ///
945 class ObjCContainerDecl : public NamedDecl, public DeclContext {
946  // This class stores some data in DeclContext::ObjCContainerDeclBits
947  // to save some space. Use the provided accessors to access it.
948 
949  // These two locations in the range mark the end of the method container.
950  // The first points to the '@' token, and the second to the 'end' token.
951  SourceRange AtEnd;
952 
953  void anchor() override;
954 
955 public:
957  SourceLocation nameLoc, SourceLocation atStartLoc);
958 
959  // Iterator access to instance/class properties.
961  using prop_range =
962  llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>;
963 
965 
967  return prop_iterator(decls_begin());
968  }
969 
971  return prop_iterator(decls_end());
972  }
973 
974  using instprop_iterator =
975  filtered_decl_iterator<ObjCPropertyDecl,
977  using instprop_range = llvm::iterator_range<instprop_iterator>;
978 
981  }
982 
984  return instprop_iterator(decls_begin());
985  }
986 
988  return instprop_iterator(decls_end());
989  }
990 
991  using classprop_iterator =
992  filtered_decl_iterator<ObjCPropertyDecl,
994  using classprop_range = llvm::iterator_range<classprop_iterator>;
995 
998  }
999 
1001  return classprop_iterator(decls_begin());
1002  }
1003 
1005  return classprop_iterator(decls_end());
1006  }
1007 
1008  // Iterator access to instance/class methods.
1010  using method_range =
1011  llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>;
1012 
1014  return method_range(meth_begin(), meth_end());
1015  }
1016 
1018  return method_iterator(decls_begin());
1019  }
1020 
1022  return method_iterator(decls_end());
1023  }
1024 
1025  using instmeth_iterator =
1026  filtered_decl_iterator<ObjCMethodDecl,
1028  using instmeth_range = llvm::iterator_range<instmeth_iterator>;
1029 
1032  }
1033 
1035  return instmeth_iterator(decls_begin());
1036  }
1037 
1039  return instmeth_iterator(decls_end());
1040  }
1041 
1042  using classmeth_iterator =
1043  filtered_decl_iterator<ObjCMethodDecl,
1045  using classmeth_range = llvm::iterator_range<classmeth_iterator>;
1046 
1049  }
1050 
1052  return classmeth_iterator(decls_begin());
1053  }
1054 
1056  return classmeth_iterator(decls_end());
1057  }
1058 
1059  // Get the local instance/class method declared in this interface.
1060  ObjCMethodDecl *getMethod(Selector Sel, bool isInstance,
1061  bool AllowHidden = false) const;
1062 
1064  bool AllowHidden = false) const {
1065  return getMethod(Sel, true/*isInstance*/, AllowHidden);
1066  }
1067 
1068  ObjCMethodDecl *getClassMethod(Selector Sel, bool AllowHidden = false) const {
1069  return getMethod(Sel, false/*isInstance*/, AllowHidden);
1070  }
1071 
1072  bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const;
1074 
1076  FindPropertyDeclaration(const IdentifierInfo *PropertyId,
1077  ObjCPropertyQueryKind QueryKind) const;
1078 
1079  using PropertyMap =
1080  llvm::DenseMap<std::pair<IdentifierInfo *, unsigned/*isClassProperty*/>,
1082  using ProtocolPropertySet = llvm::SmallDenseSet<const ObjCProtocolDecl *, 8>;
1084 
1085  /// This routine collects list of properties to be implemented in the class.
1086  /// This includes, class's and its conforming protocols' properties.
1087  /// Note, the superclass's properties are not included in the list.
1089  PropertyDeclOrder &PO) const {}
1090 
1092 
1094  ObjCContainerDeclBits.AtStart = Loc;
1095  }
1096 
1097  // Marks the end of the container.
1098  SourceRange getAtEndRange() const { return AtEnd; }
1099 
1100  void setAtEndRange(SourceRange atEnd) { AtEnd = atEnd; }
1101 
1102  SourceRange getSourceRange() const override LLVM_READONLY {
1103  return SourceRange(getAtStartLoc(), getAtEndRange().getEnd());
1104  }
1105 
1106  // Implement isa/cast/dyncast/etc.
1107  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1108 
1109  static bool classofKind(Kind K) {
1110  return K >= firstObjCContainer &&
1111  K <= lastObjCContainer;
1112  }
1113 
1115  return static_cast<DeclContext *>(const_cast<ObjCContainerDecl*>(D));
1116  }
1117 
1119  return static_cast<ObjCContainerDecl *>(const_cast<DeclContext*>(DC));
1120  }
1121 };
1122 
1123 /// Represents an ObjC class declaration.
1124 ///
1125 /// For example:
1126 ///
1127 /// \code
1128 /// // MostPrimitive declares no super class (not particularly useful).
1129 /// \@interface MostPrimitive
1130 /// // no instance variables or methods.
1131 /// \@end
1132 ///
1133 /// // NSResponder inherits from NSObject & implements NSCoding (a protocol).
1134 /// \@interface NSResponder : NSObject <NSCoding>
1135 /// { // instance variables are represented by ObjCIvarDecl.
1136 /// id nextResponder; // nextResponder instance variable.
1137 /// }
1138 /// - (NSResponder *)nextResponder; // return a pointer to NSResponder.
1139 /// - (void)mouseMoved:(NSEvent *)theEvent; // return void, takes a pointer
1140 /// \@end // to an NSEvent.
1141 /// \endcode
1142 ///
1143 /// Unlike C/C++, forward class declarations are accomplished with \@class.
1144 /// Unlike C/C++, \@class allows for a list of classes to be forward declared.
1145 /// Unlike C++, ObjC is a single-rooted class model. In Cocoa, classes
1146 /// typically inherit from NSObject (an exception is NSProxy).
1147 ///
1149  , public Redeclarable<ObjCInterfaceDecl> {
1150  friend class ASTContext;
1151 
1152  /// TypeForDecl - This indicates the Type object that represents this
1153  /// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType
1154  mutable const Type *TypeForDecl = nullptr;
1155 
1156  struct DefinitionData {
1157  /// The definition of this class, for quick access from any
1158  /// declaration.
1159  ObjCInterfaceDecl *Definition = nullptr;
1160 
1161  /// When non-null, this is always an ObjCObjectType.
1162  TypeSourceInfo *SuperClassTInfo = nullptr;
1163 
1164  /// Protocols referenced in the \@interface declaration
1165  ObjCProtocolList ReferencedProtocols;
1166 
1167  /// Protocols reference in both the \@interface and class extensions.
1168  ObjCList<ObjCProtocolDecl> AllReferencedProtocols;
1169 
1170  /// List of categories and class extensions defined for this class.
1171  ///
1172  /// Categories are stored as a linked list in the AST, since the categories
1173  /// and class extensions come long after the initial interface declaration,
1174  /// and we avoid dynamically-resized arrays in the AST wherever possible.
1175  ObjCCategoryDecl *CategoryList = nullptr;
1176 
1177  /// IvarList - List of all ivars defined by this class; including class
1178  /// extensions and implementation. This list is built lazily.
1179  ObjCIvarDecl *IvarList = nullptr;
1180 
1181  /// Indicates that the contents of this Objective-C class will be
1182  /// completed by the external AST source when required.
1183  mutable unsigned ExternallyCompleted : 1;
1184 
1185  /// Indicates that the ivar cache does not yet include ivars
1186  /// declared in the implementation.
1187  mutable unsigned IvarListMissingImplementation : 1;
1188 
1189  /// Indicates that this interface decl contains at least one initializer
1190  /// marked with the 'objc_designated_initializer' attribute.
1191  unsigned HasDesignatedInitializers : 1;
1192 
1193  enum InheritedDesignatedInitializersState {
1194  /// We didn't calculate whether the designated initializers should be
1195  /// inherited or not.
1196  IDI_Unknown = 0,
1197 
1198  /// Designated initializers are inherited for the super class.
1199  IDI_Inherited = 1,
1200 
1201  /// The class does not inherit designated initializers.
1202  IDI_NotInherited = 2
1203  };
1204 
1205  /// One of the \c InheritedDesignatedInitializersState enumeratos.
1206  mutable unsigned InheritedDesignatedInitializers : 2;
1207 
1208  /// The location of the last location in this declaration, before
1209  /// the properties/methods. For example, this will be the '>', '}', or
1210  /// identifier,
1211  SourceLocation EndLoc;
1212 
1213  DefinitionData()
1214  : ExternallyCompleted(false), IvarListMissingImplementation(true),
1215  HasDesignatedInitializers(false),
1216  InheritedDesignatedInitializers(IDI_Unknown) {}
1217  };
1218 
1219  /// The type parameters associated with this class, if any.
1220  ObjCTypeParamList *TypeParamList = nullptr;
1221 
1222  /// Contains a pointer to the data associated with this class,
1223  /// which will be NULL if this class has not yet been defined.
1224  ///
1225  /// The bit indicates when we don't need to check for out-of-date
1226  /// declarations. It will be set unless modules are enabled.
1227  llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1228 
1229  ObjCInterfaceDecl(const ASTContext &C, DeclContext *DC, SourceLocation AtLoc,
1230  IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1231  SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1232  bool IsInternal);
1233 
1234  void anchor() override;
1235 
1236  void LoadExternalDefinition() const;
1237 
1238  DefinitionData &data() const {
1239  assert(Data.getPointer() && "Declaration has no definition!");
1240  return *Data.getPointer();
1241  }
1242 
1243  /// Allocate the definition data for this class.
1244  void allocateDefinitionData();
1245 
1246  using redeclarable_base = Redeclarable<ObjCInterfaceDecl>;
1247 
1248  ObjCInterfaceDecl *getNextRedeclarationImpl() override {
1249  return getNextRedeclaration();
1250  }
1251 
1252  ObjCInterfaceDecl *getPreviousDeclImpl() override {
1253  return getPreviousDecl();
1254  }
1255 
1256  ObjCInterfaceDecl *getMostRecentDeclImpl() override {
1257  return getMostRecentDecl();
1258  }
1259 
1260 public:
1261  static ObjCInterfaceDecl *Create(const ASTContext &C, DeclContext *DC,
1262  SourceLocation atLoc,
1263  IdentifierInfo *Id,
1264  ObjCTypeParamList *typeParamList,
1265  ObjCInterfaceDecl *PrevDecl,
1266  SourceLocation ClassLoc = SourceLocation(),
1267  bool isInternal = false);
1268 
1269  static ObjCInterfaceDecl *CreateDeserialized(const ASTContext &C, unsigned ID);
1270 
1271  /// Retrieve the type parameters of this class.
1272  ///
1273  /// This function looks for a type parameter list for the given
1274  /// class; if the class has been declared (with \c \@class) but not
1275  /// defined (with \c \@interface), it will search for a declaration that
1276  /// has type parameters, skipping any declarations that do not.
1277  ObjCTypeParamList *getTypeParamList() const;
1278 
1279  /// Set the type parameters of this class.
1280  ///
1281  /// This function is used by the AST importer, which must import the type
1282  /// parameters after creating their DeclContext to avoid loops.
1283  void setTypeParamList(ObjCTypeParamList *TPL);
1284 
1285  /// Retrieve the type parameters written on this particular declaration of
1286  /// the class.
1288  return TypeParamList;
1289  }
1290 
1291  SourceRange getSourceRange() const override LLVM_READONLY {
1294 
1295  return SourceRange(getAtStartLoc(), getLocation());
1296  }
1297 
1298  /// Indicate that this Objective-C class is complete, but that
1299  /// the external AST source will be responsible for filling in its contents
1300  /// when a complete class is required.
1301  void setExternallyCompleted();
1302 
1303  /// Indicate that this interface decl contains at least one initializer
1304  /// marked with the 'objc_designated_initializer' attribute.
1306 
1307  /// Returns true if this interface decl contains at least one initializer
1308  /// marked with the 'objc_designated_initializer' attribute.
1309  bool hasDesignatedInitializers() const;
1310 
1311  /// Returns true if this interface decl declares a designated initializer
1312  /// or it inherites one from its super class.
1314  return hasDesignatedInitializers() || inheritsDesignatedInitializers();
1315  }
1316 
1318  assert(hasDefinition() && "Caller did not check for forward reference!");
1319  if (data().ExternallyCompleted)
1320  LoadExternalDefinition();
1321 
1322  return data().ReferencedProtocols;
1323  }
1324 
1327 
1329 
1330  // Get the local instance/class method declared in a category.
1333 
1334  ObjCMethodDecl *getCategoryMethod(Selector Sel, bool isInstance) const {
1335  return isInstance ? getCategoryInstanceMethod(Sel)
1336  : getCategoryClassMethod(Sel);
1337  }
1338 
1340  using protocol_range = llvm::iterator_range<protocol_iterator>;
1341 
1344  }
1345 
1347  // FIXME: Should make sure no callers ever do this.
1348  if (!hasDefinition())
1349  return protocol_iterator();
1350 
1351  if (data().ExternallyCompleted)
1352  LoadExternalDefinition();
1353 
1354  return data().ReferencedProtocols.begin();
1355  }
1356 
1358  // FIXME: Should make sure no callers ever do this.
1359  if (!hasDefinition())
1360  return protocol_iterator();
1361 
1362  if (data().ExternallyCompleted)
1363  LoadExternalDefinition();
1364 
1365  return data().ReferencedProtocols.end();
1366  }
1367 
1369  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
1370 
1373  }
1374 
1376  // FIXME: Should make sure no callers ever do this.
1377  if (!hasDefinition())
1378  return protocol_loc_iterator();
1379 
1380  if (data().ExternallyCompleted)
1381  LoadExternalDefinition();
1382 
1383  return data().ReferencedProtocols.loc_begin();
1384  }
1385 
1387  // FIXME: Should make sure no callers ever do this.
1388  if (!hasDefinition())
1389  return protocol_loc_iterator();
1390 
1391  if (data().ExternallyCompleted)
1392  LoadExternalDefinition();
1393 
1394  return data().ReferencedProtocols.loc_end();
1395  }
1396 
1398  using all_protocol_range = llvm::iterator_range<all_protocol_iterator>;
1399 
1403  }
1404 
1406  // FIXME: Should make sure no callers ever do this.
1407  if (!hasDefinition())
1408  return all_protocol_iterator();
1409 
1410  if (data().ExternallyCompleted)
1411  LoadExternalDefinition();
1412 
1413  return data().AllReferencedProtocols.empty()
1414  ? protocol_begin()
1415  : data().AllReferencedProtocols.begin();
1416  }
1417 
1419  // FIXME: Should make sure no callers ever do this.
1420  if (!hasDefinition())
1421  return all_protocol_iterator();
1422 
1423  if (data().ExternallyCompleted)
1424  LoadExternalDefinition();
1425 
1426  return data().AllReferencedProtocols.empty()
1427  ? protocol_end()
1428  : data().AllReferencedProtocols.end();
1429  }
1430 
1432  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
1433 
1434  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
1435 
1437  if (const ObjCInterfaceDecl *Def = getDefinition())
1438  return ivar_iterator(Def->decls_begin());
1439 
1440  // FIXME: Should make sure no callers ever do this.
1441  return ivar_iterator();
1442  }
1443 
1445  if (const ObjCInterfaceDecl *Def = getDefinition())
1446  return ivar_iterator(Def->decls_end());
1447 
1448  // FIXME: Should make sure no callers ever do this.
1449  return ivar_iterator();
1450  }
1451 
1452  unsigned ivar_size() const {
1453  return std::distance(ivar_begin(), ivar_end());
1454  }
1455 
1456  bool ivar_empty() const { return ivar_begin() == ivar_end(); }
1457 
1460  // Even though this modifies IvarList, it's conceptually const:
1461  // the ivar chain is essentially a cached property of ObjCInterfaceDecl.
1462  return const_cast<ObjCInterfaceDecl *>(this)->all_declared_ivar_begin();
1463  }
1464  void setIvarList(ObjCIvarDecl *ivar) { data().IvarList = ivar; }
1465 
1466  /// setProtocolList - Set the list of protocols that this interface
1467  /// implements.
1468  void setProtocolList(ObjCProtocolDecl *const* List, unsigned Num,
1469  const SourceLocation *Locs, ASTContext &C) {
1470  data().ReferencedProtocols.set(List, Num, Locs, C);
1471  }
1472 
1473  /// mergeClassExtensionProtocolList - Merge class extension's protocol list
1474  /// into the protocol list for this class.
1476  unsigned Num,
1477  ASTContext &C);
1478 
1479  /// Produce a name to be used for class's metadata. It comes either via
1480  /// objc_runtime_name attribute or class name.
1481  StringRef getObjCRuntimeNameAsString() const;
1482 
1483  /// Returns the designated initializers for the interface.
1484  ///
1485  /// If this declaration does not have methods marked as designated
1486  /// initializers then the interface inherits the designated initializers of
1487  /// its super class.
1490 
1491  /// Returns true if the given selector is a designated initializer for the
1492  /// interface.
1493  ///
1494  /// If this declaration does not have methods marked as designated
1495  /// initializers then the interface inherits the designated initializers of
1496  /// its super class.
1497  ///
1498  /// \param InitMethod if non-null and the function returns true, it receives
1499  /// the method that was marked as a designated initializer.
1500  bool
1502  const ObjCMethodDecl **InitMethod = nullptr) const;
1503 
1504  /// Determine whether this particular declaration of this class is
1505  /// actually also a definition.
1507  return getDefinition() == this;
1508  }
1509 
1510  /// Determine whether this class has been defined.
1511  bool hasDefinition() const {
1512  // If the name of this class is out-of-date, bring it up-to-date, which
1513  // might bring in a definition.
1514  // Note: a null value indicates that we don't have a definition and that
1515  // modules are enabled.
1516  if (!Data.getOpaqueValue())
1518 
1519  return Data.getPointer();
1520  }
1521 
1522  /// Retrieve the definition of this class, or NULL if this class
1523  /// has been forward-declared (with \@class) but not yet defined (with
1524  /// \@interface).
1526  return hasDefinition()? Data.getPointer()->Definition : nullptr;
1527  }
1528 
1529  /// Retrieve the definition of this class, or NULL if this class
1530  /// has been forward-declared (with \@class) but not yet defined (with
1531  /// \@interface).
1533  return hasDefinition()? Data.getPointer()->Definition : nullptr;
1534  }
1535 
1536  /// Starts the definition of this Objective-C class, taking it from
1537  /// a forward declaration (\@class) to a definition (\@interface).
1538  void startDefinition();
1539 
1540  /// Retrieve the superclass type.
1542  if (TypeSourceInfo *TInfo = getSuperClassTInfo())
1543  return TInfo->getType()->castAs<ObjCObjectType>();
1544 
1545  return nullptr;
1546  }
1547 
1548  // Retrieve the type source information for the superclass.
1550  // FIXME: Should make sure no callers ever do this.
1551  if (!hasDefinition())
1552  return nullptr;
1553 
1554  if (data().ExternallyCompleted)
1555  LoadExternalDefinition();
1556 
1557  return data().SuperClassTInfo;
1558  }
1559 
1560  // Retrieve the declaration for the superclass of this class, which
1561  // does not include any type arguments that apply to the superclass.
1563 
1564  void setSuperClass(TypeSourceInfo *superClass) {
1565  data().SuperClassTInfo = superClass;
1566  }
1567 
1568  /// Iterator that walks over the list of categories, filtering out
1569  /// those that do not meet specific criteria.
1570  ///
1571  /// This class template is used for the various permutations of category
1572  /// and extension iterators.
1573  template<bool (*Filter)(ObjCCategoryDecl *)>
1575  ObjCCategoryDecl *Current = nullptr;
1576 
1577  void findAcceptableCategory();
1578 
1579  public:
1584  using iterator_category = std::input_iterator_tag;
1585 
1586  filtered_category_iterator() = default;
1588  : Current(Current) {
1589  findAcceptableCategory();
1590  }
1591 
1592  reference operator*() const { return Current; }
1593  pointer operator->() const { return Current; }
1594 
1596 
1598  filtered_category_iterator Tmp = *this;
1599  ++(*this);
1600  return Tmp;
1601  }
1602 
1605  return X.Current == Y.Current;
1606  }
1607 
1610  return X.Current != Y.Current;
1611  }
1612  };
1613 
1614 private:
1615  /// Test whether the given category is visible.
1616  ///
1617  /// Used in the \c visible_categories_iterator.
1618  static bool isVisibleCategory(ObjCCategoryDecl *Cat);
1619 
1620 public:
1621  /// Iterator that walks over the list of categories and extensions
1622  /// that are visible, i.e., not hidden in a non-imported submodule.
1625 
1626  using visible_categories_range =
1627  llvm::iterator_range<visible_categories_iterator>;
1628 
1632  }
1633 
1634  /// Retrieve an iterator to the beginning of the visible-categories
1635  /// list.
1638  }
1639 
1640  /// Retrieve an iterator to the end of the visible-categories list.
1642  return visible_categories_iterator();
1643  }
1644 
1645  /// Determine whether the visible-categories list is empty.
1648  }
1649 
1650 private:
1651  /// Test whether the given category... is a category.
1652  ///
1653  /// Used in the \c known_categories_iterator.
1654  static bool isKnownCategory(ObjCCategoryDecl *) { return true; }
1655 
1656 public:
1657  /// Iterator that walks over all of the known categories and
1658  /// extensions, including those that are hidden.
1660  using known_categories_range =
1661  llvm::iterator_range<known_categories_iterator>;
1662 
1666  }
1667 
1668  /// Retrieve an iterator to the beginning of the known-categories
1669  /// list.
1672  }
1673 
1674  /// Retrieve an iterator to the end of the known-categories list.
1676  return known_categories_iterator();
1677  }
1678 
1679  /// Determine whether the known-categories list is empty.
1680  bool known_categories_empty() const {
1682  }
1683 
1684 private:
1685  /// Test whether the given category is a visible extension.
1686  ///
1687  /// Used in the \c visible_extensions_iterator.
1688  static bool isVisibleExtension(ObjCCategoryDecl *Cat);
1689 
1690 public:
1691  /// Iterator that walks over all of the visible extensions, skipping
1692  /// any that are known but hidden.
1695 
1696  using visible_extensions_range =
1697  llvm::iterator_range<visible_extensions_iterator>;
1698 
1702  }
1703 
1704  /// Retrieve an iterator to the beginning of the visible-extensions
1705  /// list.
1708  }
1709 
1710  /// Retrieve an iterator to the end of the visible-extensions list.
1712  return visible_extensions_iterator();
1713  }
1714 
1715  /// Determine whether the visible-extensions list is empty.
1718  }
1719 
1720 private:
1721  /// Test whether the given category is an extension.
1722  ///
1723  /// Used in the \c known_extensions_iterator.
1724  static bool isKnownExtension(ObjCCategoryDecl *Cat);
1725 
1726 public:
1727  friend class ASTDeclReader;
1728  friend class ASTDeclWriter;
1729  friend class ASTReader;
1730 
1731  /// Iterator that walks over all of the known extensions.
1734  using known_extensions_range =
1735  llvm::iterator_range<known_extensions_iterator>;
1736 
1740  }
1741 
1742  /// Retrieve an iterator to the beginning of the known-extensions
1743  /// list.
1746  }
1747 
1748  /// Retrieve an iterator to the end of the known-extensions list.
1750  return known_extensions_iterator();
1751  }
1752 
1753  /// Determine whether the known-extensions list is empty.
1754  bool known_extensions_empty() const {
1756  }
1757 
1758  /// Retrieve the raw pointer to the start of the category/extension
1759  /// list.
1761  // FIXME: Should make sure no callers ever do this.
1762  if (!hasDefinition())
1763  return nullptr;
1764 
1765  if (data().ExternallyCompleted)
1766  LoadExternalDefinition();
1767 
1768  return data().CategoryList;
1769  }
1770 
1771  /// Set the raw pointer to the start of the category/extension
1772  /// list.
1774  data().CategoryList = category;
1775  }
1776 
1779  ObjCPropertyQueryKind QueryKind) const;
1780 
1782  PropertyDeclOrder &PO) const override;
1783 
1784  /// isSuperClassOf - Return true if this class is the specified class or is a
1785  /// super class of the specified interface class.
1786  bool isSuperClassOf(const ObjCInterfaceDecl *I) const {
1787  // If RHS is derived from LHS it is OK; else it is not OK.
1788  while (I != nullptr) {
1789  if (declaresSameEntity(this, I))
1790  return true;
1791 
1792  I = I->getSuperClass();
1793  }
1794  return false;
1795  }
1796 
1797  /// isArcWeakrefUnavailable - Checks for a class or one of its super classes
1798  /// to be incompatible with __weak references. Returns true if it is.
1799  bool isArcWeakrefUnavailable() const;
1800 
1801  /// isObjCRequiresPropertyDefs - Checks that a class or one of its super
1802  /// classes must not be auto-synthesized. Returns class decl. if it must not
1803  /// be; 0, otherwise.
1805 
1807  ObjCInterfaceDecl *&ClassDeclared);
1809  ObjCInterfaceDecl *ClassDeclared;
1810  return lookupInstanceVariable(IVarName, ClassDeclared);
1811  }
1812 
1814 
1815  // Lookup a method. First, we search locally. If a method isn't
1816  // found, we search referenced protocols and class categories.
1817  ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance,
1818  bool shallowCategoryLookup = false,
1819  bool followSuper = true,
1820  const ObjCCategoryDecl *C = nullptr) const;
1821 
1822  /// Lookup an instance method for a given selector.
1824  return lookupMethod(Sel, true/*isInstance*/);
1825  }
1826 
1827  /// Lookup a class method for a given selector.
1829  return lookupMethod(Sel, false/*isInstance*/);
1830  }
1831 
1833 
1834  /// Lookup a method in the classes implementation hierarchy.
1836  bool Instance=true) const;
1837 
1839  return lookupPrivateMethod(Sel, false);
1840  }
1841 
1842  /// Lookup a setter or getter in the class hierarchy,
1843  /// including in all categories except for category passed
1844  /// as argument.
1846  const ObjCCategoryDecl *Cat,
1847  bool IsClassProperty) const {
1848  return lookupMethod(Sel, !IsClassProperty/*isInstance*/,
1849  false/*shallowCategoryLookup*/,
1850  true /* followsSuper */,
1851  Cat);
1852  }
1853 
1855  if (!hasDefinition())
1856  return getLocation();
1857 
1858  return data().EndLoc;
1859  }
1860 
1861  void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; }
1862 
1863  /// Retrieve the starting location of the superclass.
1865 
1866  /// isImplicitInterfaceDecl - check that this is an implicitly declared
1867  /// ObjCInterfaceDecl node. This is for legacy objective-c \@implementation
1868  /// declaration without an \@interface declaration.
1870  return hasDefinition() ? data().Definition->isImplicit() : isImplicit();
1871  }
1872 
1873  /// ClassImplementsProtocol - Checks that 'lProto' protocol
1874  /// has been implemented in IDecl class, its super class or categories (if
1875  /// lookupCategory is true).
1877  bool lookupCategory,
1878  bool RHSIsQualifiedID = false);
1879 
1881  using redecl_iterator = redeclarable_base::redecl_iterator;
1882 
1889 
1890  /// Retrieves the canonical declaration of this Objective-C class.
1892  const ObjCInterfaceDecl *getCanonicalDecl() const { return getFirstDecl(); }
1893 
1894  // Low-level accessor
1895  const Type *getTypeForDecl() const { return TypeForDecl; }
1896  void setTypeForDecl(const Type *TD) const { TypeForDecl = TD; }
1897 
1898  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1899  static bool classofKind(Kind K) { return K == ObjCInterface; }
1900 
1901 private:
1902  const ObjCInterfaceDecl *findInterfaceWithDesignatedInitializers() const;
1903  bool inheritsDesignatedInitializers() const;
1904 };
1905 
1906 /// ObjCIvarDecl - Represents an ObjC instance variable. In general, ObjC
1907 /// instance variables are identical to C. The only exception is Objective-C
1908 /// supports C++ style access control. For example:
1909 ///
1910 /// \@interface IvarExample : NSObject
1911 /// {
1912 /// id defaultToProtected;
1913 /// \@public:
1914 /// id canBePublic; // same as C++.
1915 /// \@protected:
1916 /// id canBeProtected; // same as C++.
1917 /// \@package:
1918 /// id canBePackage; // framework visibility (not available in C++).
1919 /// }
1920 ///
1921 class ObjCIvarDecl : public FieldDecl {
1922  void anchor() override;
1923 
1924 public:
1927  };
1928 
1929 private:
1932  QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW,
1933  bool synthesized)
1934  : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
1935  /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
1936  DeclAccess(ac), Synthesized(synthesized) {}
1937 
1938 public:
1939  static ObjCIvarDecl *Create(ASTContext &C, ObjCContainerDecl *DC,
1940  SourceLocation StartLoc, SourceLocation IdLoc,
1941  IdentifierInfo *Id, QualType T,
1942  TypeSourceInfo *TInfo,
1943  AccessControl ac, Expr *BW = nullptr,
1944  bool synthesized=false);
1945 
1946  static ObjCIvarDecl *CreateDeserialized(ASTContext &C, unsigned ID);
1947 
1948  /// Return the class interface that this ivar is logically contained
1949  /// in; this is either the interface where the ivar was declared, or the
1950  /// interface the ivar is conceptually a part of in the case of synthesized
1951  /// ivars.
1952  const ObjCInterfaceDecl *getContainingInterface() const;
1953 
1954  ObjCIvarDecl *getNextIvar() { return NextIvar; }
1955  const ObjCIvarDecl *getNextIvar() const { return NextIvar; }
1956  void setNextIvar(ObjCIvarDecl *ivar) { NextIvar = ivar; }
1957 
1958  void setAccessControl(AccessControl ac) { DeclAccess = ac; }
1959 
1960  AccessControl getAccessControl() const { return AccessControl(DeclAccess); }
1961 
1963  return DeclAccess == None ? Protected : AccessControl(DeclAccess);
1964  }
1965 
1966  void setSynthesize(bool synth) { Synthesized = synth; }
1967  bool getSynthesize() const { return Synthesized; }
1968 
1969  /// Retrieve the type of this instance variable when viewed as a member of a
1970  /// specific object type.
1971  QualType getUsageType(QualType objectType) const;
1972 
1973  // Implement isa/cast/dyncast/etc.
1974  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1975  static bool classofKind(Kind K) { return K == ObjCIvar; }
1976 
1977 private:
1978  /// NextIvar - Next Ivar in the list of ivars declared in class; class's
1979  /// extensions and class's implementation
1980  ObjCIvarDecl *NextIvar = nullptr;
1981 
1982  // NOTE: VC++ treats enums as signed, avoid using the AccessControl enum
1983  unsigned DeclAccess : 3;
1984  unsigned Synthesized : 1;
1985 };
1986 
1987 /// Represents a field declaration created by an \@defs(...).
1991  QualType T, Expr *BW)
1992  : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
1993  /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
1994  BW, /*Mutable=*/false, /*HasInit=*/ICIS_NoInit) {}
1995 
1996  void anchor() override;
1997 
1998 public:
2000  SourceLocation StartLoc,
2002  QualType T, Expr *BW);
2003 
2004  static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2005 
2006  // Implement isa/cast/dyncast/etc.
2007  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2008  static bool classofKind(Kind K) { return K == ObjCAtDefsField; }
2009 };
2010 
2011 /// Represents an Objective-C protocol declaration.
2012 ///
2013 /// Objective-C protocols declare a pure abstract type (i.e., no instance
2014 /// variables are permitted). Protocols originally drew inspiration from
2015 /// C++ pure virtual functions (a C++ feature with nice semantics and lousy
2016 /// syntax:-). Here is an example:
2017 ///
2018 /// \code
2019 /// \@protocol NSDraggingInfo <refproto1, refproto2>
2020 /// - (NSWindow *)draggingDestinationWindow;
2021 /// - (NSImage *)draggedImage;
2022 /// \@end
2023 /// \endcode
2024 ///
2025 /// This says that NSDraggingInfo requires two methods and requires everything
2026 /// that the two "referenced protocols" 'refproto1' and 'refproto2' require as
2027 /// well.
2028 ///
2029 /// \code
2030 /// \@interface ImplementsNSDraggingInfo : NSObject <NSDraggingInfo>
2031 /// \@end
2032 /// \endcode
2033 ///
2034 /// ObjC protocols inspired Java interfaces. Unlike Java, ObjC classes and
2035 /// protocols are in distinct namespaces. For example, Cocoa defines both
2036 /// an NSObject protocol and class (which isn't allowed in Java). As a result,
2037 /// protocols are referenced using angle brackets as follows:
2038 ///
2039 /// id <NSDraggingInfo> anyObjectThatImplementsNSDraggingInfo;
2041  public Redeclarable<ObjCProtocolDecl> {
2042  struct DefinitionData {
2043  // The declaration that defines this protocol.
2044  ObjCProtocolDecl *Definition;
2045 
2046  /// Referenced protocols
2047  ObjCProtocolList ReferencedProtocols;
2048  };
2049 
2050  /// Contains a pointer to the data associated with this class,
2051  /// which will be NULL if this class has not yet been defined.
2052  ///
2053  /// The bit indicates when we don't need to check for out-of-date
2054  /// declarations. It will be set unless modules are enabled.
2055  llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
2056 
2058  SourceLocation nameLoc, SourceLocation atStartLoc,
2059  ObjCProtocolDecl *PrevDecl);
2060 
2061  void anchor() override;
2062 
2063  DefinitionData &data() const {
2064  assert(Data.getPointer() && "Objective-C protocol has no definition!");
2065  return *Data.getPointer();
2066  }
2067 
2068  void allocateDefinitionData();
2069 
2071 
2072  ObjCProtocolDecl *getNextRedeclarationImpl() override {
2073  return getNextRedeclaration();
2074  }
2075 
2076  ObjCProtocolDecl *getPreviousDeclImpl() override {
2077  return getPreviousDecl();
2078  }
2079 
2080  ObjCProtocolDecl *getMostRecentDeclImpl() override {
2081  return getMostRecentDecl();
2082  }
2083 
2084 public:
2085  friend class ASTDeclReader;
2086  friend class ASTDeclWriter;
2087  friend class ASTReader;
2088 
2090  IdentifierInfo *Id,
2091  SourceLocation nameLoc,
2092  SourceLocation atStartLoc,
2093  ObjCProtocolDecl *PrevDecl);
2094 
2095  static ObjCProtocolDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2096 
2098  assert(hasDefinition() && "No definition available!");
2099  return data().ReferencedProtocols;
2100  }
2101 
2103  using protocol_range = llvm::iterator_range<protocol_iterator>;
2104 
2107  }
2108 
2110  if (!hasDefinition())
2111  return protocol_iterator();
2112 
2113  return data().ReferencedProtocols.begin();
2114  }
2115 
2117  if (!hasDefinition())
2118  return protocol_iterator();
2119 
2120  return data().ReferencedProtocols.end();
2121  }
2122 
2124  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
2125 
2128  }
2129 
2131  if (!hasDefinition())
2132  return protocol_loc_iterator();
2133 
2134  return data().ReferencedProtocols.loc_begin();
2135  }
2136 
2138  if (!hasDefinition())
2139  return protocol_loc_iterator();
2140 
2141  return data().ReferencedProtocols.loc_end();
2142  }
2143 
2144  unsigned protocol_size() const {
2145  if (!hasDefinition())
2146  return 0;
2147 
2148  return data().ReferencedProtocols.size();
2149  }
2150 
2151  /// setProtocolList - Set the list of protocols that this interface
2152  /// implements.
2153  void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num,
2154  const SourceLocation *Locs, ASTContext &C) {
2155  assert(hasDefinition() && "Protocol is not defined");
2156  data().ReferencedProtocols.set(List, Num, Locs, C);
2157  }
2158 
2159  /// This is true iff the protocol is tagged with the
2160  /// `objc_non_runtime_protocol` attribute.
2161  bool isNonRuntimeProtocol() const;
2162 
2163  /// Get the set of all protocols implied by this protocols inheritance
2164  /// hierarchy.
2166 
2168 
2169  // Lookup a method. First, we search locally. If a method isn't
2170  // found, we search referenced protocols and class categories.
2171  ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance) const;
2172 
2174  return lookupMethod(Sel, true/*isInstance*/);
2175  }
2176 
2178  return lookupMethod(Sel, false/*isInstance*/);
2179  }
2180 
2181  /// Determine whether this protocol has a definition.
2182  bool hasDefinition() const {
2183  // If the name of this protocol is out-of-date, bring it up-to-date, which
2184  // might bring in a definition.
2185  // Note: a null value indicates that we don't have a definition and that
2186  // modules are enabled.
2187  if (!Data.getOpaqueValue())
2189 
2190  return Data.getPointer();
2191  }
2192 
2193  /// Retrieve the definition of this protocol, if any.
2195  return hasDefinition()? Data.getPointer()->Definition : nullptr;
2196  }
2197 
2198  /// Retrieve the definition of this protocol, if any.
2200  return hasDefinition()? Data.getPointer()->Definition : nullptr;
2201  }
2202 
2203  /// Determine whether this particular declaration is also the
2204  /// definition.
2206  return getDefinition() == this;
2207  }
2208 
2209  /// Starts the definition of this Objective-C protocol.
2210  void startDefinition();
2211 
2212  /// Produce a name to be used for protocol's metadata. It comes either via
2213  /// objc_runtime_name attribute or protocol name.
2214  StringRef getObjCRuntimeNameAsString() const;
2215 
2216  SourceRange getSourceRange() const override LLVM_READONLY {
2219 
2220  return SourceRange(getAtStartLoc(), getLocation());
2221  }
2222 
2224  using redecl_iterator = redeclarable_base::redecl_iterator;
2225 
2232 
2233  /// Retrieves the canonical declaration of this Objective-C protocol.
2235  const ObjCProtocolDecl *getCanonicalDecl() const { return getFirstDecl(); }
2236 
2238  PropertyDeclOrder &PO) const override;
2239 
2241  ProtocolPropertySet &PS,
2242  PropertyDeclOrder &PO) const;
2243 
2244  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2245  static bool classofKind(Kind K) { return K == ObjCProtocol; }
2246 };
2247 
2248 /// ObjCCategoryDecl - Represents a category declaration. A category allows
2249 /// you to add methods to an existing class (without subclassing or modifying
2250 /// the original class interface or implementation:-). Categories don't allow
2251 /// you to add instance data. The following example adds "myMethod" to all
2252 /// NSView's within a process:
2253 ///
2254 /// \@interface NSView (MyViewMethods)
2255 /// - myMethod;
2256 /// \@end
2257 ///
2258 /// Categories also allow you to split the implementation of a class across
2259 /// several files (a feature more naturally supported in C++).
2260 ///
2261 /// Categories were originally inspired by dynamic languages such as Common
2262 /// Lisp and Smalltalk. More traditional class-based languages (C++, Java)
2263 /// don't support this level of dynamism, which is both powerful and dangerous.
2265  /// Interface belonging to this category
2266  ObjCInterfaceDecl *ClassInterface;
2267 
2268  /// The type parameters associated with this category, if any.
2269  ObjCTypeParamList *TypeParamList = nullptr;
2270 
2271  /// referenced protocols in this category.
2272  ObjCProtocolList ReferencedProtocols;
2273 
2274  /// Next category belonging to this class.
2275  /// FIXME: this should not be a singly-linked list. Move storage elsewhere.
2276  ObjCCategoryDecl *NextClassCategory = nullptr;
2277 
2278  /// The location of the category name in this declaration.
2279  SourceLocation CategoryNameLoc;
2280 
2281  /// class extension may have private ivars.
2282  SourceLocation IvarLBraceLoc;
2283  SourceLocation IvarRBraceLoc;
2284 
2286  SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc,
2288  ObjCTypeParamList *typeParamList,
2289  SourceLocation IvarLBraceLoc = SourceLocation(),
2290  SourceLocation IvarRBraceLoc = SourceLocation());
2291 
2292  void anchor() override;
2293 
2294 public:
2295  friend class ASTDeclReader;
2296  friend class ASTDeclWriter;
2297 
2299  SourceLocation AtLoc,
2300  SourceLocation ClassNameLoc,
2301  SourceLocation CategoryNameLoc,
2302  IdentifierInfo *Id,
2303  ObjCInterfaceDecl *IDecl,
2304  ObjCTypeParamList *typeParamList,
2305  SourceLocation IvarLBraceLoc=SourceLocation(),
2306  SourceLocation IvarRBraceLoc=SourceLocation());
2307  static ObjCCategoryDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2308 
2309  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
2310  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
2311 
2312  /// Retrieve the type parameter list associated with this category or
2313  /// extension.
2314  ObjCTypeParamList *getTypeParamList() const { return TypeParamList; }
2315 
2316  /// Set the type parameters of this category.
2317  ///
2318  /// This function is used by the AST importer, which must import the type
2319  /// parameters after creating their DeclContext to avoid loops.
2321 
2322 
2325 
2326  /// setProtocolList - Set the list of protocols that this interface
2327  /// implements.
2328  void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num,
2329  const SourceLocation *Locs, ASTContext &C) {
2330  ReferencedProtocols.set(List, Num, Locs, C);
2331  }
2332 
2334  return ReferencedProtocols;
2335  }
2336 
2338  using protocol_range = llvm::iterator_range<protocol_iterator>;
2339 
2342  }
2343 
2345  return ReferencedProtocols.begin();
2346  }
2347 
2348  protocol_iterator protocol_end() const { return ReferencedProtocols.end(); }
2349  unsigned protocol_size() const { return ReferencedProtocols.size(); }
2350 
2352  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
2353 
2356  }
2357 
2359  return ReferencedProtocols.loc_begin();
2360  }
2361 
2363  return ReferencedProtocols.loc_end();
2364  }
2365 
2366  ObjCCategoryDecl *getNextClassCategory() const { return NextClassCategory; }
2367 
2368  /// Retrieve the pointer to the next stored category (or extension),
2369  /// which may be hidden.
2371  return NextClassCategory;
2372  }
2373 
2374  bool IsClassExtension() const { return getIdentifier() == nullptr; }
2375 
2377  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2378 
2379  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
2380 
2382  return ivar_iterator(decls_begin());
2383  }
2384 
2386  return ivar_iterator(decls_end());
2387  }
2388 
2389  unsigned ivar_size() const {
2390  return std::distance(ivar_begin(), ivar_end());
2391  }
2392 
2393  bool ivar_empty() const {
2394  return ivar_begin() == ivar_end();
2395  }
2396 
2397  SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
2398  void setCategoryNameLoc(SourceLocation Loc) { CategoryNameLoc = Loc; }
2399 
2400  void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
2401  SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
2402  void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
2403  SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
2404 
2405  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2406  static bool classofKind(Kind K) { return K == ObjCCategory; }
2407 };
2408 
2410  /// Class interface for this class/category implementation
2411  ObjCInterfaceDecl *ClassInterface;
2412 
2413  void anchor() override;
2414 
2415 protected:
2417  ObjCInterfaceDecl *classInterface,
2418  IdentifierInfo *Id,
2419  SourceLocation nameLoc, SourceLocation atStartLoc)
2420  : ObjCContainerDecl(DK, DC, Id, nameLoc, atStartLoc),
2421  ClassInterface(classInterface) {}
2422 
2423 public:
2424  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
2425  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
2426  void setClassInterface(ObjCInterfaceDecl *IFace);
2427 
2429  // FIXME: Context should be set correctly before we get here.
2430  method->setLexicalDeclContext(this);
2431  addDecl(method);
2432  }
2433 
2435  // FIXME: Context should be set correctly before we get here.
2436  method->setLexicalDeclContext(this);
2437  addDecl(method);
2438  }
2439 
2441 
2443  ObjCPropertyQueryKind queryKind) const;
2445 
2446  // Iterator access to properties.
2448  using propimpl_range =
2449  llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>;
2450 
2453  }
2454 
2456  return propimpl_iterator(decls_begin());
2457  }
2458 
2460  return propimpl_iterator(decls_end());
2461  }
2462 
2463  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2464 
2465  static bool classofKind(Kind K) {
2466  return K >= firstObjCImpl && K <= lastObjCImpl;
2467  }
2468 };
2469 
2470 /// ObjCCategoryImplDecl - An object of this class encapsulates a category
2471 /// \@implementation declaration. If a category class has declaration of a
2472 /// property, its implementation must be specified in the category's
2473 /// \@implementation declaration. Example:
2474 /// \@interface I \@end
2475 /// \@interface I(CATEGORY)
2476 /// \@property int p1, d1;
2477 /// \@end
2478 /// \@implementation I(CATEGORY)
2479 /// \@dynamic p1,d1;
2480 /// \@end
2481 ///
2482 /// ObjCCategoryImplDecl
2484  // Category name location
2485  SourceLocation CategoryNameLoc;
2486 
2488  ObjCInterfaceDecl *classInterface,
2489  SourceLocation nameLoc, SourceLocation atStartLoc,
2490  SourceLocation CategoryNameLoc)
2491  : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id,
2492  nameLoc, atStartLoc),
2493  CategoryNameLoc(CategoryNameLoc) {}
2494 
2495  void anchor() override;
2496 
2497 public:
2498  friend class ASTDeclReader;
2499  friend class ASTDeclWriter;
2500 
2502  IdentifierInfo *Id,
2503  ObjCInterfaceDecl *classInterface,
2504  SourceLocation nameLoc,
2505  SourceLocation atStartLoc,
2506  SourceLocation CategoryNameLoc);
2508 
2510 
2511  SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
2512 
2513  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2514  static bool classofKind(Kind K) { return K == ObjCCategoryImpl;}
2515 };
2516 
2517 raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID);
2518 
2519 /// ObjCImplementationDecl - Represents a class definition - this is where
2520 /// method definitions are specified. For example:
2521 ///
2522 /// @code
2523 /// \@implementation MyClass
2524 /// - (void)myMethod { /* do something */ }
2525 /// \@end
2526 /// @endcode
2527 ///
2528 /// In a non-fragile runtime, instance variables can appear in the class
2529 /// interface, class extensions (nameless categories), and in the implementation
2530 /// itself, as well as being synthesized as backing storage for properties.
2531 ///
2532 /// In a fragile runtime, instance variables are specified in the class
2533 /// interface, \em not in the implementation. Nevertheless (for legacy reasons),
2534 /// we allow instance variables to be specified in the implementation. When
2535 /// specified, they need to be \em identical to the interface.
2537  /// Implementation Class's super class.
2538  ObjCInterfaceDecl *SuperClass;
2539  SourceLocation SuperLoc;
2540 
2541  /// \@implementation may have private ivars.
2542  SourceLocation IvarLBraceLoc;
2543  SourceLocation IvarRBraceLoc;
2544 
2545  /// Support for ivar initialization.
2546  /// The arguments used to initialize the ivars
2547  LazyCXXCtorInitializersPtr IvarInitializers;
2548  unsigned NumIvarInitializers = 0;
2549 
2550  /// Do the ivars of this class require initialization other than
2551  /// zero-initialization?
2552  bool HasNonZeroConstructors : 1;
2553 
2554  /// Do the ivars of this class require non-trivial destruction?
2555  bool HasDestructors : 1;
2556 
2558  ObjCInterfaceDecl *classInterface,
2559  ObjCInterfaceDecl *superDecl,
2560  SourceLocation nameLoc, SourceLocation atStartLoc,
2561  SourceLocation superLoc = SourceLocation(),
2562  SourceLocation IvarLBraceLoc=SourceLocation(),
2563  SourceLocation IvarRBraceLoc=SourceLocation())
2564  : ObjCImplDecl(ObjCImplementation, DC, classInterface,
2565  classInterface ? classInterface->getIdentifier()
2566  : nullptr,
2567  nameLoc, atStartLoc),
2568  SuperClass(superDecl), SuperLoc(superLoc),
2569  IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2570  HasNonZeroConstructors(false), HasDestructors(false) {}
2571 
2572  void anchor() override;
2573 
2574 public:
2575  friend class ASTDeclReader;
2576  friend class ASTDeclWriter;
2577 
2579  ObjCInterfaceDecl *classInterface,
2580  ObjCInterfaceDecl *superDecl,
2581  SourceLocation nameLoc,
2582  SourceLocation atStartLoc,
2583  SourceLocation superLoc = SourceLocation(),
2584  SourceLocation IvarLBraceLoc=SourceLocation(),
2585  SourceLocation IvarRBraceLoc=SourceLocation());
2586 
2588 
2589  /// init_iterator - Iterates through the ivar initializer list.
2591 
2592  /// init_const_iterator - Iterates through the ivar initializer list.
2594 
2595  using init_range = llvm::iterator_range<init_iterator>;
2596  using init_const_range = llvm::iterator_range<init_const_iterator>;
2597 
2599 
2601  return init_const_range(init_begin(), init_end());
2602  }
2603 
2604  /// init_begin() - Retrieve an iterator to the first initializer.
2606  const auto *ConstThis = this;
2607  return const_cast<init_iterator>(ConstThis->init_begin());
2608  }
2609 
2610  /// begin() - Retrieve an iterator to the first initializer.
2612 
2613  /// init_end() - Retrieve an iterator past the last initializer.
2615  return init_begin() + NumIvarInitializers;
2616  }
2617 
2618  /// end() - Retrieve an iterator past the last initializer.
2620  return init_begin() + NumIvarInitializers;
2621  }
2622 
2623  /// getNumArgs - Number of ivars which must be initialized.
2624  unsigned getNumIvarInitializers() const {
2625  return NumIvarInitializers;
2626  }
2627 
2628  void setNumIvarInitializers(unsigned numNumIvarInitializers) {
2629  NumIvarInitializers = numNumIvarInitializers;
2630  }
2631 
2633  CXXCtorInitializer ** initializers,
2634  unsigned numInitializers);
2635 
2636  /// Do any of the ivars of this class (not counting its base classes)
2637  /// require construction other than zero-initialization?
2638  bool hasNonZeroConstructors() const { return HasNonZeroConstructors; }
2639  void setHasNonZeroConstructors(bool val) { HasNonZeroConstructors = val; }
2640 
2641  /// Do any of the ivars of this class (not counting its base classes)
2642  /// require non-trivial destruction?
2643  bool hasDestructors() const { return HasDestructors; }
2644  void setHasDestructors(bool val) { HasDestructors = val; }
2645 
2646  /// getIdentifier - Get the identifier that names the class
2647  /// interface associated with this implementation.
2649  return getClassInterface()->getIdentifier();
2650  }
2651 
2652  /// getName - Get the name of identifier for the class interface associated
2653  /// with this implementation as a StringRef.
2654  //
2655  // FIXME: This is a bad API, we are hiding NamedDecl::getName with a different
2656  // meaning.
2657  StringRef getName() const {
2658  assert(getIdentifier() && "Name is not a simple identifier");
2659  return getIdentifier()->getName();
2660  }
2661 
2662  /// Get the name of the class associated with this interface.
2663  //
2664  // FIXME: Move to StringRef API.
2666 
2667  /// Produce a name to be used for class's metadata. It comes either via
2668  /// class's objc_runtime_name attribute or class name.
2669  StringRef getObjCRuntimeNameAsString() const;
2670 
2671  const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
2672  ObjCInterfaceDecl *getSuperClass() { return SuperClass; }
2673  SourceLocation getSuperClassLoc() const { return SuperLoc; }
2674 
2675  void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }
2676 
2677  void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
2678  SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
2679  void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
2680  SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
2681 
2683  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2684 
2685  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
2686 
2688  return ivar_iterator(decls_begin());
2689  }
2690 
2692  return ivar_iterator(decls_end());
2693  }
2694 
2695  unsigned ivar_size() const {
2696  return std::distance(ivar_begin(), ivar_end());
2697  }
2698 
2699  bool ivar_empty() const {
2700  return ivar_begin() == ivar_end();
2701  }
2702 
2703  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2704  static bool classofKind(Kind K) { return K == ObjCImplementation; }
2705 };
2706 
2707 raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID);
2708 
2709 /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is
2710 /// declared as \@compatibility_alias alias class.
2712  /// Class that this is an alias of.
2713  ObjCInterfaceDecl *AliasedClass;
2714 
2716  ObjCInterfaceDecl* aliasedClass)
2717  : NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2718 
2719  void anchor() override;
2720 
2721 public:
2724  ObjCInterfaceDecl* aliasedClass);
2725 
2727  unsigned ID);
2728 
2729  const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; }
2730  ObjCInterfaceDecl *getClassInterface() { return AliasedClass; }
2731  void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; }
2732 
2733  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2734  static bool classofKind(Kind K) { return K == ObjCCompatibleAlias; }
2735 };
2736 
2737 /// ObjCPropertyImplDecl - Represents implementation declaration of a property
2738 /// in a class or category implementation block. For example:
2739 /// \@synthesize prop1 = ivar1;
2740 ///
2741 class ObjCPropertyImplDecl : public Decl {
2742 public:
2743  enum Kind {
2746  };
2747 
2748 private:
2749  SourceLocation AtLoc; // location of \@synthesize or \@dynamic
2750 
2751  /// For \@synthesize, the location of the ivar, if it was written in
2752  /// the source code.
2753  ///
2754  /// \code
2755  /// \@synthesize int a = b
2756  /// \endcode
2757  SourceLocation IvarLoc;
2758 
2759  /// Property declaration being implemented
2760  ObjCPropertyDecl *PropertyDecl;
2761 
2762  /// Null for \@dynamic. Required for \@synthesize.
2763  ObjCIvarDecl *PropertyIvarDecl;
2764 
2765  /// The getter's definition, which has an empty body if synthesized.
2766  ObjCMethodDecl *GetterMethodDecl = nullptr;
2767  /// The getter's definition, which has an empty body if synthesized.
2768  ObjCMethodDecl *SetterMethodDecl = nullptr;
2769 
2770  /// Null for \@dynamic. Non-null if property must be copy-constructed in
2771  /// getter.
2772  Expr *GetterCXXConstructor = nullptr;
2773 
2774  /// Null for \@dynamic. Non-null if property has assignment operator to call
2775  /// in Setter synthesis.
2776  Expr *SetterCXXAssignment = nullptr;
2777 
2779  ObjCPropertyDecl *property,
2780  Kind PK,
2781  ObjCIvarDecl *ivarDecl,
2782  SourceLocation ivarLoc)
2783  : Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2784  IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2785  assert(PK == Dynamic || PropertyIvarDecl);
2786  }
2787 
2788 public:
2789  friend class ASTDeclReader;
2790 
2792  SourceLocation atLoc, SourceLocation L,
2793  ObjCPropertyDecl *property,
2794  Kind PK,
2795  ObjCIvarDecl *ivarDecl,
2796  SourceLocation ivarLoc);
2797 
2799 
2800  SourceRange getSourceRange() const override LLVM_READONLY;
2801 
2802  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
2803  void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
2804 
2806  return PropertyDecl;
2807  }
2808  void setPropertyDecl(ObjCPropertyDecl *Prop) { PropertyDecl = Prop; }
2809 
2811  return PropertyIvarDecl ? Synthesize : Dynamic;
2812  }
2813 
2815  return PropertyIvarDecl;
2816  }
2817  SourceLocation getPropertyIvarDeclLoc() const { return IvarLoc; }
2818 
2820  SourceLocation IvarLoc) {
2821  PropertyIvarDecl = Ivar;
2822  this->IvarLoc = IvarLoc;
2823  }
2824 
2825  /// For \@synthesize, returns true if an ivar name was explicitly
2826  /// specified.
2827  ///
2828  /// \code
2829  /// \@synthesize int a = b; // true
2830  /// \@synthesize int a; // false
2831  /// \endcode
2832  bool isIvarNameSpecified() const {
2833  return IvarLoc.isValid() && IvarLoc != getLocation();
2834  }
2835 
2836  ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
2837  void setGetterMethodDecl(ObjCMethodDecl *MD) { GetterMethodDecl = MD; }
2838 
2839  ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; }
2840  void setSetterMethodDecl(ObjCMethodDecl *MD) { SetterMethodDecl = MD; }
2841 
2843  return GetterCXXConstructor;
2844  }
2845 
2846  void setGetterCXXConstructor(Expr *getterCXXConstructor) {
2847  GetterCXXConstructor = getterCXXConstructor;
2848  }
2849 
2851  return SetterCXXAssignment;
2852  }
2853 
2854  void setSetterCXXAssignment(Expr *setterCXXAssignment) {
2855  SetterCXXAssignment = setterCXXAssignment;
2856  }
2857 
2858  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2859  static bool classofKind(Decl::Kind K) { return K == ObjCPropertyImpl; }
2860 };
2861 
2862 template<bool (*Filter)(ObjCCategoryDecl *)>
2863 void
2864 ObjCInterfaceDecl::filtered_category_iterator<Filter>::
2865 findAcceptableCategory() {
2866  while (Current && !Filter(Current))
2867  Current = Current->getNextClassCategoryRaw();
2868 }
2869 
2870 template<bool (*Filter)(ObjCCategoryDecl *)>
2871 inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2873  Current = Current->getNextClassCategoryRaw();
2874  findAcceptableCategory();
2875  return *this;
2876 }
2877 
2878 inline bool ObjCInterfaceDecl::isVisibleCategory(ObjCCategoryDecl *Cat) {
2879  return Cat->isUnconditionallyVisible();
2880 }
2881 
2882 inline bool ObjCInterfaceDecl::isVisibleExtension(ObjCCategoryDecl *Cat) {
2883  return Cat->IsClassExtension() && Cat->isUnconditionallyVisible();
2884 }
2885 
2886 inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2887  return Cat->IsClassExtension();
2888 }
2889 
2890 } // namespace clang
2891 
2892 #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:1148
clang::ObjCCategoryDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:2358
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:639
clang::ObjCInterfaceDecl::filtered_category_iterator::difference_type
std::ptrdiff_t difference_type
Definition: DeclObjC.h:1583
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:1711
clang::ObjCImplementationDecl::setSuperClass
void setSuperClass(ObjCInterfaceDecl *superCls)
Definition: DeclObjC.h:2675
clang::ObjCPropertyDecl::isReadOnly
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
Definition: DeclObjC.h:835
clang::ObjCListBase::ObjCListBase
ObjCListBase()=default
clang::ObjCInterfaceDecl::CreateDeserialized
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1507
clang::ObjCPropertyImplDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2814
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:2711
clang::ObjCContainerDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1109
clang::ObjCProtocolDecl::lookupClassMethod
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Definition: DeclObjC.h:2177
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:2294
clang::DeclContext::decls_end
decl_iterator decls_end() const
Definition: DeclBase.h:2117
clang::ObjCMethodDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:542
clang::ObjCMethodDecl::castFromDeclContext
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclObjC.h:548
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:1661
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:938
clang::ObjCProtocolDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2105
clang::ObjCContainerDecl::instmeth_range
llvm::iterator_range< instmeth_iterator > instmeth_range
Definition: DeclObjC.h:1028
clang::Type::isBlockPointerType
bool isBlockPointerType() const
Definition: Type.h:6681
clang::ObjCPropertyImplDecl::setPropertyIvarDecl
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Definition: DeclObjC.h:2819
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:2657
Specifiers.h
clang::ObjCMethodDecl::castToDeclContext
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
Definition: DeclObjC.h:544
clang::ObjCInterfaceDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:1291
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:1574
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:394
clang::DeclContext::specific_decl_iterator
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
Definition: DeclBase.h:2135
clang::ObjCMethodDecl::param_const_range
llvm::iterator_range< param_const_iterator > param_const_range
Definition: DeclObjC.h:355
clang::ObjCPropertyDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:925
clang::ObjCIvarDecl::None
@ None
Definition: DeclObjC.h:1926
clang::ObjCInterfaceDecl::setTypeForDecl
void setTypeForDecl(const Type *TD) const
Definition: DeclObjC.h:1896
clang::ObjCInterfaceDecl::setHasDesignatedInitializers
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
Definition: DeclObjC.cpp:1550
clang::ObjCPropertyDecl::setPropertyAttributesAsWritten
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
Definition: DeclObjC.h:828
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:684
clang::ObjCImplementationDecl::init_end
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Definition: DeclObjC.h:2614
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:212
clang::DeclContext::ObjCContainerDeclBits
ObjCContainerDeclBitfields ObjCContainerDeclBits
Definition: DeclBase.h:1804
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:658
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1347
clang::ObjCIvarDecl::getNextIvar
ObjCIvarDecl * getNextIvar()
Definition: DeclObjC.h:1954
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:2850
clang::ObjCPropertyDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:898
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:2593
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2536
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:1011
clang::ObjCMethodDecl::getSelfType
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
Definition: DeclObjC.cpp:1094
clang::ObjCTypeParamVariance::Invariant
@ Invariant
The parameter is invariant: must match exactly.
clang::ObjCProtocolDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:2109
clang::ObjCContainerDecl::instprop_iterator
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
Definition: DeclObjC.h:976
clang::Redeclarable< ObjCInterfaceDecl >::redecls_begin
redecl_iterator redecls_begin() const
Definition: Redeclarable.h:301
clang::ObjCIvarDecl::Protected
@ Protected
Definition: DeclObjC.h:1926
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:1480
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:2449
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:2605
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:1542
clang::ObjCInterfaceDecl::filtered_category_iterator::operator++
filtered_category_iterator & operator++()
Definition: DeclObjC.h:2872
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:88
clang::ObjCImplementationDecl::setHasNonZeroConstructors
void setHasNonZeroConstructors(bool val)
Definition: DeclObjC.h:2639
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:1557
clang::ObjCInterfaceDecl::setEndOfDefinitionLoc
void setEndOfDefinitionLoc(SourceLocation LE)
Definition: DeclObjC.h:1861
clang::ObjCProtocolDecl::protocol_loc_iterator
ObjCProtocolList::loc_iterator protocol_loc_iterator
Definition: DeclObjC.h:2123
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:249
clang::ObjCInterfaceDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:1436
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:1532
clang::ObjCMethodDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:541
clang::ObjCImplementationDecl::inits
init_const_range inits() const
Definition: DeclObjC.h:2600
clang::ObjCPropertyDecl::setSetterMethodDecl
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
Definition: DeclObjC.h:902
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::ObjCPropertyDecl::isClassProperty
bool isClassProperty() const
Definition: DeclObjC.h:852
clang::ObjCProtocolDecl::Create
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
Definition: DeclObjC.cpp:1891
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:414
clang::Selector::isUnarySelector
bool isUnarySelector() const
Definition: IdentifierTable.h:797
clang::Redeclarable< ObjCInterfaceDecl >::redecls_end
redecl_iterator redecls_end() const
Definition: Redeclarable.h:302
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:2685
clang::ObjCCategoryDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:2344
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:1960
clang::ObjCInterfaceDecl::lookupClassMethod
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
Definition: DeclObjC.h:1828
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2835
clang::ObjCInterfaceDecl::getCategoryMethod
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
Definition: DeclObjC.h:1334
clang::Decl::redecl_range
llvm::iterator_range< redecl_iterator > redecl_range
Definition: DeclBase.h:968
clang::ObjCTypeParamDecl::getVariance
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:622
clang::ObjCPropertyDecl::isInstanceProperty
bool isInstanceProperty() const
Definition: DeclObjC.h:851
clang::ObjCImplementationDecl::setNumIvarInitializers
void setNumIvarInitializers(unsigned numNumIvarInitializers)
Definition: DeclObjC.h:2628
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:1641
clang::ObjCContainerDecl::instmeth_end
instmeth_iterator instmeth_end() const
Definition: DeclObjC.h:1038
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1665
clang::ObjCPropertyDecl::isOptional
bool isOptional() const
Definition: DeclObjC.h:913
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:1030
clang::ObjCProtocolDecl::getCanonicalDecl
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
Definition: DeclObjC.h:2234
clang::ObjCPropertyImplDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:2836
clang::ObjCCategoryDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2309
clang::ObjCMethodDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.cpp:1160
clang::ObjCContainerDecl::instmeth_iterator
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
Definition: DeclObjC.h:1027
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:2648
clang::ObjCPropertyDecl::isDirectProperty
bool isDirectProperty() const
Definition: DeclObjC.cpp:2299
clang::ObjCCategoryDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:2377
clang::ObjCProtocolDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:2130
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:1597
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:2741
llvm::Optional
Definition: LLVM.h:40
clang::ObjCCategoryDecl::IsClassExtension
bool IsClassExtension() const
Definition: DeclObjC.h:2374
clang::ObjCImplementationDecl::setHasDestructors
void setHasDestructors(bool val)
Definition: DeclObjC.h:2644
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:1733
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:1980
clang::ObjCInterfaceDecl::visible_categories_range
llvm::iterator_range< visible_categories_iterator > visible_categories_range
Definition: DeclObjC.h:1627
clang::ObjCPropertyDecl::setPropertyAttributes
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
Definition: DeclObjC.h:816
clang::ObjCContainerDecl::ProtocolPropertySet
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
Definition: DeclObjC.h:1082
clang::ObjCInterfaceDecl::visible_extensions
visible_extensions_range visible_extensions() const
Definition: DeclObjC.h:1699
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:2264
clang::ObjCPropertyImplDecl::getPropertyIvarDeclLoc
SourceLocation getPropertyIvarDeclLoc() const
Definition: DeclObjC.h:2817
clang::ObjCContainerDecl::classprop_iterator
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator
Definition: DeclObjC.h:993
clang::ObjCContainerDecl::PropertyMap
llvm::DenseMap< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
Definition: DeclObjC.h:1081
clang::ObjCCategoryDecl::setIvarLBraceLoc
void setIvarLBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2400
clang::ObjCCompatibleAliasDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2733
clang::ObjCProtocolList::loc_iterator
const SourceLocation * loc_iterator
Definition: DeclObjC.h:110
clang::ObjCPropertyDecl::getPropertyImplementation
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:909
clang::ObjCContainerDecl::classmeth_iterator
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
Definition: DeclObjC.h:1044
clang::DeclContext::ObjCMethodDeclBits
ObjCMethodDeclBitfields ObjCMethodDeclBits
Definition: DeclBase.h:1803
clang::ObjCIvarDecl::Public
@ Public
Definition: DeclObjC.h:1926
clang::ObjCMethodDecl::isThisDeclarationADesignatedInitializer
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
Definition: DeclObjC.cpp:833
clang::ObjCCategoryDecl::getNextClassCategory
ObjCCategoryDecl * getNextClassCategory() const
Definition: DeclObjC.h:2366
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:810
clang::ObjCProtocolDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:2116
clang::ObjCInterfaceDecl::all_declared_ivar_begin
const ObjCIvarDecl * all_declared_ivar_begin() const
Definition: DeclObjC.h:1459
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:2459
clang::ObjCContainerDecl::instprop_range
llvm::iterator_range< instprop_iterator > instprop_range
Definition: DeclObjC.h:977
clang::ObjCContainerDecl::castFromDeclContext
static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclObjC.h:1118
clang::ObjCInterfaceDecl::known_extensions
known_extensions_range known_extensions() const
Definition: DeclObjC.h:1737
clang::ObjCPropertyAttribute::kind_strong
@ kind_strong
Definition: DeclObjCCommon.h:34
clang::ObjCImplDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2424
clang::ObjCTypeParamDecl::getVarianceLoc
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
Definition: DeclObjC.h:632
clang::ObjCCategoryDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:2393
clang::ObjCInterfaceDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:1375
clang::ObjCContainerDecl::classprop_end
classprop_iterator classprop_end() const
Definition: DeclObjC.h:1004
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
clang::ObjCTypeParamDecl::getColonLoc
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
Definition: DeclObjC.h:643
clang::ObjCMethodDecl::createImplicitParams
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
Definition: DeclObjC.cpp:1139
clang::ObjCTypeParamList::getSourceRange
SourceRange getSourceRange() const
Definition: DeclObjC.h:710
clang::ObjCIvarDecl::AccessControl
AccessControl
Definition: DeclObjC.h:1925
Decl.h
clang::ObjCImplementationDecl::setIvarInitializers
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
Definition: DeclObjC.cpp:2226
clang::ObjCTypeParamList::getLAngleLoc
SourceLocation getLAngleLoc() const
Definition: DeclObjC.h:708
clang::ObjCObjectType
Represents a class type in Objective C.
Definition: Type.h:5816
clang::Redeclarable< ObjCInterfaceDecl >::redecl_range
llvm::iterator_range< redecl_iterator > redecl_range
Definition: Redeclarable.h:291
Offset
unsigned Offset
Definition: Format.cpp:2335
clang::ObjCList::end
iterator end() const
Definition: DeclObjC.h:92
clang::ObjCImplementationDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:2687
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:2085
clang::ObjCInterfaceDecl::known_categories_empty
bool known_categories_empty() const
Determine whether the known-categories list is empty.
Definition: DeclObjC.h:1680
clang::ObjCInterfaceDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
Definition: DeclObjC.h:1506
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:1422
clang::ObjCInterfaceDecl::visible_extensions_empty
bool visible_extensions_empty() const
Determine whether the visible-extensions list is empty.
Definition: DeclObjC.h:1716
clang::ObjCMethodDecl::param_const_iterator
const ParmVarDecl *const * param_const_iterator
Definition: DeclObjC.h:352
clang::ObjCMethodDecl::getReturnTypeSourceRange
SourceRange getReturnTypeSourceRange() const
Definition: DeclObjC.cpp:1180
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:531
clang::ObjCInterfaceDecl::getDesignatedInitializers
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
Definition: DeclObjC.cpp:540
clang::ObjCPropertyImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2858
clang::ObjCTypeParamDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:647
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:1608
clang::ObjCInterfaceDecl::lookupNestedProtocol
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
Definition: DeclObjC.cpp:672
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:1996
clang::ObjCPropertyAttribute::kind_copy
@ kind_copy
Definition: DeclObjCCommon.h:29
clang::ObjCImplementationDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2704
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:2839
clang::ObjCProtocolDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2144
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:434
clang::ObjCInterfaceDecl::lookupInstanceMethod
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
Definition: DeclObjC.h:1823
clang::Decl::Kind
Kind
Lists the kind of concrete classes of Decl.
Definition: DeclBase.h:92
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:481
clang::ObjCPropertyImplDecl::setGetterCXXConstructor
void setGetterCXXConstructor(Expr *getterCXXConstructor)
Definition: DeclObjC.h:2846
clang::CompoundStmt
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1398
clang::ObjCInterfaceDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:1452
clang::ObjCPropertyDecl::isAtomic
bool isAtomic() const
isAtomic - Return true if the property is atomic.
Definition: DeclObjC.h:840
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:905
clang::ObjCContainerDecl::prop_iterator
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
Definition: DeclObjC.h:960
clang::ObjCCategoryDecl::ivar_end
ivar_iterator ivar_end() const
Definition: DeclObjC.h:2385
clang::ObjCImplementationDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Definition: DeclObjC.h:2673
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:433
clang::ObjCInterfaceDecl::getImplementation
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1584
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:2216
clang::ObjCInterfaceDecl::getCanonicalDecl
const ObjCInterfaceDecl * getCanonicalDecl() const
Definition: DeclObjC.h:1892
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:1342
DeclBase.h
clang::ObjCCategoryImplDecl::CreateDeserialized
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2113
clang::ObjCIvarDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1974
clang::ObjCInterfaceDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:1339
clang::ObjCCategoryDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:2379
clang::ObjCInterfaceDecl::visible_categories
visible_categories_range visible_categories() const
Definition: DeclObjC.h:1629
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:994
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:1706
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:2308
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:1738
clang::Decl::ObjCDeclQualifier
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Definition: DeclBase.h:201
clang::ObjCTypeParamList::end
const_iterator end() const
Definition: DeclObjC.h:694
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:2643
clang::ObjCPropertyImplDecl::Synthesize
@ Synthesize
Definition: DeclObjC.h:2744
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:1002
clang::ObjCTypeParamList::back
ObjCTypeParamDecl * back() const
Definition: DeclObjC.h:703
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:211
clang::ObjCInterfaceDecl::lookupPrivateMethod
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
Definition: DeclObjC.cpp:741
clang::ObjCListBase
Definition: DeclObjC.h:60
clang::ObjCMethodDecl::setDeclImplementation
void setDeclImplementation(ImplementationControl ic)
Definition: DeclObjC.h:498
clang::ObjCPropertyDecl::getSetterMethodDecl
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:901
clang::ObjCPropertyDecl::Assign
@ Assign
Definition: DeclObjC.h:733
clang::Selector::getNumArgs
unsigned getNumArgs() const
Definition: IdentifierTable.cpp:480
clang::ObjCCompatibleAliasDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2730
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:2153
clang::ObjCProtocolDecl::startDefinition
void startDefinition()
Starts the definition of this Objective-C protocol.
Definition: DeclObjC.cpp:1972
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:1313
clang::ObjCContainerDecl::methods
method_range methods() const
Definition: DeclObjC.h:1013
clang::ObjCMethodDecl::setHasSkippedBody
void setHasSkippedBody(bool Skipped=true)
Definition: DeclObjC.h:483
clang::ObjCProtocolDecl::getCanonicalDecl
const ObjCProtocolDecl * getCanonicalDecl() const
Definition: DeclObjC.h:2235
clang::ObjCInterfaceDecl::all_protocol_iterator
ObjCList< ObjCProtocolDecl >::iterator all_protocol_iterator
Definition: DeclObjC.h:1397
clang::ObjCImplDecl::propimpl_begin
propimpl_iterator propimpl_begin() const
Definition: DeclObjC.h:2455
clang::ObjCMethodDecl::setIsRedeclaration
void setIsRedeclaration(bool RD)
Definition: DeclObjC.h:270
clang::ObjCInterfaceDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:1317
clang::ObjCPropertyDecl::getSetterName
Selector getSetterName() const
Definition: DeclObjC.h:890
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:1825
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:2076
clang::ObjCImplementationDecl::getSuperClass
ObjCInterfaceDecl * getSuperClass()
Definition: DeclObjC.h:2672
clang::ObjCInterfaceDecl::lookupInstanceVariable
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
Definition: DeclObjC.cpp:622
clang::ObjCPropertyQueryKind::OBJC_PR_query_class
@ OBJC_PR_query_class
clang::ObjCCompatibleAliasDecl::setClassInterface
void setClassInterface(ObjCInterfaceDecl *D)
Definition: DeclObjC.h:2731
clang::ObjCPropertyImplDecl::getGetterCXXConstructor
Expr * getGetterCXXConstructor() const
Definition: DeclObjC.h:2842
clang::ObjCImplementationDecl::init_const_range
llvm::iterator_range< init_const_iterator > init_const_range
Definition: DeclObjC.h:2596
clang::ObjCIvarDecl::getNextIvar
const ObjCIvarDecl * getNextIvar() const
Definition: DeclObjC.h:1955
clang::ObjCMethodDecl::CreateDeserialized
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:823
clang::ObjCMethodDecl::isDirectMethod
bool isDirectMethod() const
True if the method is tagged as objc_direct.
Definition: DeclObjC.cpp:828
clang::ObjCTypeParamList::begin
const_iterator begin() const
Definition: DeclObjC.h:690
clang::ObjCContainerDecl::class_properties
classprop_range class_properties() const
Definition: DeclObjC.h:996
clang::ObjCMethodDecl::getSelectorStartLoc
SourceLocation getSelectorStartLoc() const
Definition: DeclObjC.h:291
clang::ObjCCategoryDecl::setImplementation
void setImplementation(ObjCCategoryImplDecl *ImplD)
Definition: DeclObjC.cpp:2081
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:1845
clang::ObjCAtDefsFieldDecl::CreateDeserialized
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1867
clang::ObjCInterfaceDecl::protocol_loc_iterator
ObjCProtocolList::loc_iterator protocol_loc_iterator
Definition: DeclObjC.h:1368
clang::ObjCInterfaceDecl::all_protocol_range
llvm::iterator_range< all_protocol_iterator > all_protocol_range
Definition: DeclObjC.h:1398
clang::ObjCCategoryDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2405
clang::ObjCInterfaceDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:1434
clang::ObjCImplementationDecl::getObjCRuntimeNameAsString
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
Definition: DeclObjC.cpp:1576
clang::ObjCInterfaceDecl::all_referenced_protocol_begin
all_protocol_iterator all_referenced_protocol_begin() const
Definition: DeclObjC.h:1405
clang::ObjCMethodDecl::setLazyBody
void setLazyBody(uint64_t Offset)
Definition: DeclObjC.h:529
clang::ObjCIvarDecl::getSynthesize
bool getSynthesize() const
Definition: DeclObjC.h:1967
clang::ObjCInterfaceDecl::getTypeParamList
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
Definition: DeclObjC.cpp:309
IdentifierTable.h
clang::ObjCImplDecl::addPropertyImplementation
void addPropertyImplementation(ObjCPropertyImplDecl *property)
Definition: DeclObjC.cpp:2129
clang::ObjCInterfaceDecl::getCategoryListRaw
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
Definition: DeclObjC.h:1760
clang::ObjCMethodDecl::setDefined
void setDefined(bool isDefined)
Definition: DeclObjC.h:458
Type.h
clang::ImplicitParamDecl
Definition: Decl.h:1601
clang::ObjCMethodDecl::setAsRedeclaration
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
Definition: DeclObjC.cpp:862
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:1446
clang::ObjCInterfaceDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:1346
clang::Redeclarable< ObjCInterfaceDecl >::redecls
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Definition: Redeclarable.h:295
clang::ObjCContainerDecl::castToDeclContext
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
Definition: DeclObjC.h:1114
clang::ObjCCategoryDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2310
clang::ObjCInterfaceDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:1357
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:532
clang::ObjCMethodDecl::getReturnType
QualType getReturnType() const
Definition: DeclObjC.h:332
clang::ObjCProtocolDecl::lookupProtocolNamed
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
Definition: DeclObjC.cpp:1932
clang::ObjCProtocolDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:2137
clang::ObjCIvarDecl::Private
@ Private
Definition: DeclObjC.h:1926
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:330
clang::ObjCTypeParamVariance
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
Definition: DeclObjC.h:554
clang::ObjCCategoryImplDecl
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2483
clang::ObjCImplDecl::addInstanceMethod
void addInstanceMethod(ObjCMethodDecl *method)
Definition: DeclObjC.h:2428
llvm::DenseSet
Definition: Sema.h:78
clang::ObjCProtocolDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2244
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:820
clang::ObjCMethodDecl::getSelectorLocs
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
Definition: DeclObjC.cpp:887
clang::ObjCInterfaceDecl::setSuperClass
void setSuperClass(TypeSourceInfo *superClass)
Definition: DeclObjC.h:1564
clang::ObjCProtocolDecl::protocol_loc_range
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
Definition: DeclObjC.h:2124
clang::ObjCPropertyAttribute::kind_readonly
@ kind_readonly
Definition: DeclObjCCommon.h:24
clang::ObjCImplementationDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2703
clang::ObjCContainerDecl::setAtStartLoc
void setAtStartLoc(SourceLocation Loc)
Definition: DeclObjC.h:1093
clang::ObjCInterfaceDecl::getTypeParamListAsWritten
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
Definition: DeclObjC.h:1287
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:996
clang::ObjCAtDefsFieldDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2008
clang::ObjCContainerDecl::instmeth_begin
instmeth_iterator instmeth_begin() const
Definition: DeclObjC.h:1034
clang::ObjCInterfaceDecl::getCategoryClassMethod
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
Definition: DeclObjC.cpp:1725
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:2677
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:2352
clang::ObjCImplementationDecl::init_range
llvm::iterator_range< init_iterator > init_range
Definition: DeclObjC.h:2595
clang::ObjCPropertyDecl::getType
QualType getType() const
Definition: DeclObjC.h:801
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:2416
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:2882
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:11770
clang::ObjCMethodDecl::setVariadic
void setVariadic(bool isVar)
Definition: DeclObjC.h:437
clang::ObjCImplementationDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2678
clang::ObjCContainerDecl::properties
prop_range properties() const
Definition: DeclObjC.h:964
clang::ObjCPropertyDecl::setSetterName
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
Definition: DeclObjC.h:893
clang::ObjCMethodDecl::getCanonicalDecl
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclObjC.cpp:961
clang::ObjCTypeParamDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:646
clang::ObjCCategoryImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2513
clang::ObjCCategoryDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:2376
clang::ObjCTypeParamList::begin
iterator begin()
Definition: DeclObjC.h:680
clang::ObjCInterfaceDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:1432
clang::ObjCPropertyDecl::setAtLoc
void setAtLoc(SourceLocation L)
Definition: DeclObjC.h:794
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:563
clang::ObjCContainerDecl::prop_range
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
Definition: DeclObjC.h:962
clang::ObjCImplementationDecl::getSuperClass
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2671
clang::ObjCProtocolDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:2103
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:1808
clang::ObjCContainerDecl::setAtEndRange
void setAtEndRange(SourceRange atEnd)
Definition: DeclObjC.h:1100
ExternalASTSource.h
clang::ObjCProtocolDecl::getObjCRuntimeNameAsString
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
Definition: DeclObjC.cpp:2017
clang::ObjCInterfaceDecl::lookupInheritedClass
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
Definition: DeclObjC.cpp:653
clang::ObjCCategoryDecl
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2264
clang::ObjCMethodDecl::param_end
param_iterator param_end()
Definition: DeclObjC.h:366
clang::ObjCContainerDecl::classprop_begin
classprop_iterator classprop_begin() const
Definition: DeclObjC.h:1000
clang::ObjCPropertyDecl::getSetterKind
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
Definition: DeclObjC.h:870
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:424
clang::ObjCImplementationDecl::CreateDeserialized
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2221
clang::ObjCPropertyDecl::Copy
@ Copy
Definition: DeclObjC.h:733
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:2665
clang::Type::castAs
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7227
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:261
clang::ObjCProtocolDecl::lookupInstanceMethod
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Definition: DeclObjC.h:2173
clang::ObjCImplementationDecl::inits
init_range inits()
Definition: DeclObjC.h:2598
clang::ObjCMethodDecl::param_iterator
ParmVarDecl *const * param_iterator
Definition: DeclObjC.h:353
clang::ObjCInterfaceDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:1456
clang::ObjCInterfaceDecl::redecl_iterator
redeclarable_base::redecl_iterator redecl_iterator
Definition: DeclObjC.h:1881
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:2205
SourceLocation.h
clang::ObjCCategoryImplDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2511
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:1749
clang::ObjCImplDecl::property_impls
propimpl_range property_impls() const
Definition: DeclObjC.h:2451
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::ObjCInterfaceDecl::getCategoryInstanceMethod
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
Definition: DeclObjC.cpp:1715
clang::ObjCContainerDecl::getAtStartLoc
SourceLocation getAtStartLoc() const
Definition: DeclObjC.h:1091
clang::ObjCInterfaceDecl::setCategoryListRaw
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
Definition: DeclObjC.h:1773
clang::ObjCMethodDecl::getOverriddenMethods
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
Definition: DeclObjC.cpp:1309
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:2154
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:2802
clang::ObjCCategoryDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:2381
SelectorLocationsKind.h
clang::ObjCContainerDecl::prop_end
prop_iterator prop_end() const
Definition: DeclObjC.h:970
clang::ObjCImplDecl::propimpl_iterator
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
Definition: DeclObjC.h:2447
clang::ObjCCategoryDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:2354
clang::ObjCInterfaceDecl::all_referenced_protocol_end
all_protocol_iterator all_referenced_protocol_end() const
Definition: DeclObjC.h:1418
clang::ObjCContainerDecl::classmeth_begin
classmeth_iterator classmeth_begin() const
Definition: DeclObjC.h:1051
clang::ObjCContainerDecl::meth_begin
method_iterator meth_begin() const
Definition: DeclObjC.h:1017
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:682
clang::ObjCInterfaceDecl::known_extensions_empty
bool known_extensions_empty() const
Determine whether the known-extensions list is empty.
Definition: DeclObjC.h:1754
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:1659
clang::NamedDecl::getIdentifier
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Definition: Decl.h:270
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:1559
clang::ObjCInterfaceDecl::filtered_category_iterator::iterator_category
std::input_iterator_tag iterator_category
Definition: DeclObjC.h:1584
clang::ObjCImplDecl
Definition: DeclObjC.h:2409
clang::ObjCInterfaceDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:1340
clang::ObjCPropertyDecl::getLParenLoc
SourceLocation getLParenLoc() const
Definition: DeclObjC.h:796
clang::ObjCPropertyDecl::CreateDeserialized
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2287
clang::ObjCCategoryDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2340
clang::ObjCCompatibleAliasDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2729
clang::ObjCInterfaceDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:1371
clang::Redeclarable< ObjCInterfaceDecl >::getNextRedeclaration
ObjCInterfaceDecl * getNextRedeclaration() const
Definition: Redeclarable.h:189
clang::ObjCTypeParamList::front
ObjCTypeParamDecl * front() const
Definition: DeclObjC.h:698
clang::ObjCInterfaceDecl::getSuperClassType
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
Definition: DeclObjC.h:1541
clang::ObjCMethodDecl::isSynthesizedAccessorStub
bool isSynthesizedAccessorStub() const
Definition: DeclObjC.h:449
clang::ObjCPropertyDecl::None
@ None
Definition: DeclObjC.h:734
llvm::ArrayRef
Definition: LLVM.h:34
clang::ObjCImplDecl::addClassMethod
void addClassMethod(ObjCMethodDecl *method)
Definition: DeclObjC.h:2434
clang::ObjCContainerDecl::instprop_begin
instprop_iterator instprop_begin() const
Definition: DeclObjC.h:983
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
clang::ObjCCompatibleAliasDecl::Create
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
Definition: DeclObjC.cpp:2256
clang::ObjCPropertyDecl::SetterKind
SetterKind
Definition: DeclObjC.h:733
clang::ObjCPropertyQueryKind
ObjCPropertyQueryKind
Definition: DeclObjC.h:717
clang::ObjCPropertyDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:921
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:729
clang::ObjCInterfaceDecl::filtered_category_iterator::operator==
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
Definition: DeclObjC.h:1603
clang::ObjCCategoryDecl::setIvarRBraceLoc
void setIvarRBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2402
clang::ObjCIvarDecl::getCanonicalAccessControl
AccessControl getCanonicalAccessControl() const
Definition: DeclObjC.h:1962
clang::ObjCMethodDecl::isInstanceMethod
bool isInstanceMethod() const
Definition: DeclObjC.h:431
clang::ObjCPropertyDecl::setType
void setType(QualType T, TypeSourceInfo *TSI)
Definition: DeclObjC.h:803
clang::ObjCInterfaceDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:1431
clang::ObjCCategoryImplDecl::getCategoryDecl
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2120
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:838
clang::ObjCInterfaceDecl::lookupPrivateClassMethod
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
Definition: DeclObjC.h:1838
clang::ObjCInterfaceDecl::hasDefinition
bool hasDefinition() const
Determine whether this class has been defined.
Definition: DeclObjC.h:1511
clang::ObjCTypeParamList::size
unsigned size() const
Determine the number of type parameters in this list.
Definition: DeclObjC.h:685
clang::ObjCMethodDecl::getSelectorLoc
SourceLocation getSelectorLoc(unsigned Index) const
Definition: DeclObjC.h:297
LLVM.h
clang::ObjCPropertyDecl::getGetterNameLoc
SourceLocation getGetterNameLoc() const
Definition: DeclObjC.h:883
clang::ObjCPropertyDecl::setGetterName
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
Definition: DeclObjC.h:885
clang::ObjCImplementationDecl::setIvarRBraceLoc
void setIvarRBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2679
clang::ObjCPropertyImplDecl::Dynamic
@ Dynamic
Definition: DeclObjC.h:2745
clang::ObjCInterfaceDecl::filtered_category_iterator::filtered_category_iterator
filtered_category_iterator()=default
clang::ObjCPropertyDecl::getQueryKind
ObjCPropertyQueryKind getQueryKind() const
Definition: DeclObjC.h:857
clang::ObjCCategoryDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2401
clang::ObjCImplementationDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:2682
clang::ObjCPropertyDecl::Weak
@ Weak
Definition: DeclObjC.h:733
clang::ObjCInterfaceDecl::getSuperClass
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:339
clang::ObjCAtDefsFieldDecl::Create
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
Definition: DeclObjC.cpp:1861
clang::ObjCContainerDecl::instprop_end
instprop_iterator instprop_end() const
Definition: DeclObjC.h:987
clang::ObjCPropertyImplDecl::setPropertyDecl
void setPropertyDecl(ObjCPropertyDecl *Prop)
Definition: DeclObjC.h:2808
clang::ObjCCategoryDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:2389
clang::ObjCInterfaceDecl::ASTContext
friend class ASTContext
Definition: DeclObjC.h:1150
clang::ObjCImplementationDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2680
clang::ObjCPropertyImplDecl::getPropertyImplementation
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2810
clang::ObjCInterfaceDecl::setImplementation
void setImplementation(ObjCImplementationDecl *ImplD)
Definition: DeclObjC.cpp:1597
clang::DeclContext::filtered_decl_iterator
Iterates over a filtered subrange of declarations stored in a DeclContext.
Definition: DeclBase.h:2211
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:2638
clang::ObjCTypeParamList::TrailingObjects
friend TrailingObjects
Definition: DeclObjC.h:669
clang::ObjCMethodDecl::isOptional
bool isOptional() const
Definition: DeclObjC.h:506
clang::ObjCTypeParamList::getRAngleLoc
SourceLocation getRAngleLoc() const
Definition: DeclObjC.h:709
clang::ObjCMethodDecl::setObjCDeclQualifier
void setObjCDeclQualifier(ObjCDeclQualifier QV)
Definition: DeclObjC.h:253
clang::ObjCAtDefsFieldDecl
Represents a field declaration created by an @defs(...).
Definition: DeclObjC.h:1988
clang::ObjCMethodDecl::None
@ None
Definition: DeclObjC.h:144
clang::ObjCIvarDecl::setNextIvar
void setNextIvar(ObjCIvarDecl *ivar)
Definition: DeclObjC.h:1956
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:67
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:2619
clang::ObjCInterfaceDecl::filtered_category_iterator::filtered_category_iterator
filtered_category_iterator(ObjCCategoryDecl *Current)
Definition: DeclObjC.h:1587
clang::ObjCImplDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2425
clang::ObjCCategoryDecl::CreateDeserialized
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2069
clang::ObjCCategoryDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:2338
clang::ObjCPropertyImplDecl::getPropertyDecl
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2805
clang::ObjCInterfaceDecl::getCanonicalDecl
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
Definition: DeclObjC.h:1891
clang::ObjCPropertyDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:937
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:1694
clang::ObjCPropertyDecl::getPropertyAttributesAsWritten
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
Definition: DeclObjC.h:824
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:370
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::ObjCContainerDecl::classmeth_end
classmeth_iterator classmeth_end() const
Definition: DeclObjC.h:1055
clang::ObjCTypeParamDecl
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:579
clang::ObjCCategoryDecl::getNextClassCategoryRaw
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
Definition: DeclObjC.h:2370
clang::ObjCPropertyDecl::getGetterName
Selector getGetterName() const
Definition: DeclObjC.h:882
clang::ObjCPropertyDecl::getSetterNameLoc
SourceLocation getSetterNameLoc() const
Definition: DeclObjC.h:891
clang::ObjCMethodDecl::getBody
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:858
clang::ObjCInterfaceDecl::visible_categories_empty
bool visible_categories_empty() const
Determine whether the visible-categories list is empty.
Definition: DeclObjC.h:1646
clang::ASTReader
Reads an AST files chain containing the contents of a translation unit.
Definition: ASTReader.h:342
clang::ObjCInterfaceDecl::known_extensions_range
llvm::iterator_range< known_extensions_iterator > known_extensions_range
Definition: DeclObjC.h:1735
clang::ObjCImplementationDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:2695
clang::ObjCMethodDecl::setSynthesizedAccessorStub
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
Definition: DeclObjC.h:453
clang::ObjCProtocolDecl::CreateDeserialized
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1902
clang::ObjCInterfaceDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1898
clang::ObjCPropertyImplDecl::Kind
Kind
Definition: DeclObjC.h:2743
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:2832
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:1670
clang::Decl::isUnconditionallyVisible
bool isUnconditionallyVisible() const
Determine whether this declaration is definitely visible to name lookup, independent of whether the o...
Definition: DeclBase.h:789
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:2166
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:524
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:1675
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:1699
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:2691
clang::ObjCInterfaceDecl::getEndOfDefinitionLoc
SourceLocation getEndOfDefinitionLoc() const
Definition: DeclObjC.h:1854
clang::ObjCImplDecl::setClassInterface
void setClassInterface(ObjCInterfaceDecl *IFace)
Definition: DeclObjC.cpp:2135
clang::ObjCMethodDecl::getCmdDecl
ImplicitParamDecl * getCmdDecl() const
Definition: DeclObjC.h:425
clang::ObjCImplementationDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:2699
clang::ObjCPropertyDecl::setGetterMethodDecl
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
Definition: DeclObjC.h:899
clang::ObjCMethodDecl::findPropertyDecl
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
Definition: DeclObjC.cpp:1327
clang::ObjCContainerDecl::class_methods
classmeth_range class_methods() const
Definition: DeclObjC.h:1047
clang::IdentifierInfo::getName
StringRef getName() const
Return the actual identifier string.
Definition: IdentifierTable.h:175
clang::ObjCInterfaceDecl::known_categories
known_categories_range known_categories() const
Definition: DeclObjC.h:1663
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:657
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:1624
clang::ObjCPropertyDecl::isRetaining
bool isRetaining() const
isRetaining - Return true if the property retains its value.
Definition: DeclObjC.h:845
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:1783
clang
Definition: CalledOnceCheck.h:17
clang::ObjCContainerDecl::getInstanceMethod
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
Definition: DeclObjC.h:1063
clang::ObjCProtocolList::loc_end
loc_iterator loc_end() const
Definition: DeclObjC.h:113
clang::ObjCPropertyDecl::Required
@ Required
Definition: DeclObjC.h:734
clang::ObjCInterfaceDecl::filtered_category_iterator::operator*
reference operator*() const
Definition: DeclObjC.h:1592
clang::ObjCInterfaceDecl::protocol_loc_range
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
Definition: DeclObjC.h:1369
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:720
clang::ObjCPropertyDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: DeclObjC.h:799
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:846
clang::ObjCMethodDecl::setInstanceMethod
void setInstanceMethod(bool isInst)
Definition: DeclObjC.h:432
clang::ObjCCategoryDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2406
clang::ObjCInterfaceDecl::filtered_category_iterator::value_type
ObjCCategoryDecl * value_type
Definition: DeclObjC.h:1580
clang::ObjCListBase::empty
bool empty() const
Definition: DeclObjC.h:72
clang::ObjCInterfaceDecl::getSuperClassTInfo
TypeSourceInfo * getSuperClassTInfo() const
Definition: DeclObjC.h:1549
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:68
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1921
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:1911
clang::ObjCInterfaceDecl::ivar_end
ivar_iterator ivar_end() const
Definition: DeclObjC.h:1444
clang::ObjCContainerDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:1102
clang::ObjCCategoryDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2403
clang::ObjCCategoryDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:2362
clang::ObjCMethodDecl::setReturnTypeSourceInfo
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
Definition: DeclObjC.h:347
clang::ObjCContainerDecl::PropertyDeclOrder
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
Definition: DeclObjC.h:1083
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2040
clang::ObjCPropertyImplDecl::setSetterCXXAssignment
void setSetterCXXAssignment(Expr *setterCXXAssignment)
Definition: DeclObjC.h:2854
clang::ObjCPropertyImplDecl::setSetterMethodDecl
void setSetterMethodDecl(ObjCMethodDecl *MD)
Definition: DeclObjC.h:2840
clang::SourceLocation::isValid
bool isValid() const
Return true if this is a valid SourceLocation object.
Definition: SourceLocation.h:112
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6396
clang::ObjCInterfaceDecl::filtered_category_iterator::operator->
pointer operator->() const
Definition: DeclObjC.h:1593
clang::NamedDecl::getDeclName
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:313
clang::ObjCCompatibleAliasDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2734
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:2126
clang::ObjCPropertyDecl::setLParenLoc
void setLParenLoc(SourceLocation L)
Definition: DeclObjC.h:797
clang::ObjCCategoryDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:2333
clang::ObjCProtocolDecl::redecl_iterator
redeclarable_base::redecl_iterator redecl_iterator
Definition: DeclObjC.h:2224
clang::ObjCImplementationDecl::getNumIvarInitializers
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
Definition: DeclObjC.h:2624
clang::Decl::DeclContext
friend class DeclContext
Definition: DeclBase.h:248
clang::ObjCCategoryDecl::getTypeParamList
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
Definition: DeclObjC.h:2314
clang::ObjCTypeParamList::const_iterator
ObjCTypeParamDecl *const * const_iterator
Definition: DeclObjC.h:688
clang::ObjCCategoryDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:2348
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:237
clang::ObjCPropertyDecl::Retain
@ Retain
Definition: DeclObjC.h:733
clang::ObjCInterfaceDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:1386
clang::ObjCContainerDecl::classmeth_range
llvm::iterator_range< classmeth_iterator > classmeth_range
Definition: DeclObjC.h:1045
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3180
clang::ObjCProtocolDecl::lookupMethod
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
Definition: DeclObjC.cpp:1947
clang::ObjCInterfaceDecl::all_referenced_protocols
all_protocol_range all_referenced_protocols() const
Definition: DeclObjC.h:1400
clang::ObjCInterfaceDecl::setIvarList
void setIvarList(ObjCIvarDecl *ivar)
Definition: DeclObjC.h:1464
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:1627
clang::ObjCMethodDecl::getParamDecl
ParmVarDecl * getParamDecl(unsigned Idx)
Definition: DeclObjC.h:381
clang::ObjCContainerDecl
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:945
clang::ObjCIvarDecl::setAccessControl
void setAccessControl(AccessControl ac)
Definition: DeclObjC.h:1958
clang::ObjCCategoryDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2397
clang::ObjCContainerDecl::instance_properties
instprop_range instance_properties() const
Definition: DeclObjC.h:979
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:1469
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:1899
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:1786
clang::ObjCIvarDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1975
clang::ObjCContainerDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1107
clang::ObjCContainerDecl::prop_begin
prop_iterator prop_begin() const
Definition: DeclObjC.h:966
clang::ObjCMethodDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:376
clang::ObjCIvarDecl::CreateDeserialized
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1819
clang::ObjCProtocolDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2245
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:1088
clang::ObjCPropertyDecl::getAtLoc
SourceLocation getAtLoc() const
Definition: DeclObjC.h:793
clang::ObjCImplDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2465
clang::ObjCInterfaceDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
Definition: DeclObjC.cpp:359
clang::ObjCPropertyImplDecl::setAtLoc
void setAtLoc(SourceLocation Loc)
Definition: DeclObjC.h:2803
clang::ObjCCategoryImplDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2514
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:2043
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:1172
clang::ObjCTypeParamDecl::CreateDeserialized
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
Definition: DeclObjC.cpp:1438
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:1849
clang::ValueDecl::getType
QualType getType() const
Definition: Decl.h:687
true
#define true
Definition: stdbool.h:16
clang::ObjCPropertyDecl::PropertyControl
PropertyControl
Definition: DeclObjC.h:734
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:1915
clang::ObjCTypeParamDecl::getIndex
unsigned getIndex() const
Retrieve the index into its type parameter list.
Definition: DeclObjC.h:635
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:1744
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::ObjCPropertyImplDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.cpp:2327
clang::ASTDeclReader
Definition: ASTReaderDecl.cpp:80
clang::ObjCProtocolDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2102
clang::ObjCContainerDecl::getClassMethod
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
Definition: DeclObjC.h:1068
clang::ObjCInterfaceDecl::getTypeForDecl
const Type * getTypeForDecl() const
Definition: DeclObjC.h:1895
clang::ObjCInterfaceDecl::isImplicitInterfaceDecl
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
Definition: DeclObjC.h:1869
clang::ObjCCategoryDecl::setCategoryNameLoc
void setCategoryNameLoc(SourceLocation Loc)
Definition: DeclObjC.h:2398
DeclObjCCommon.h
clang::ObjCAtDefsFieldDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2007
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:562
clang::TypedefNameDecl::TypedefNameDecl
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
Definition: Decl.h:3195
clang::ObjCMethodDecl::setCmdDecl
void setCmdDecl(ImplicitParamDecl *CD)
Definition: DeclObjC.h:426
clang::CXXCtorInitializer
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2172
clang::ObjCContainerDecl::meth_end
method_iterator meth_end() const
Definition: DeclObjC.h:1021
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:893
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:2097
clang::ObjCContainerDecl::getAtEndRange
SourceRange getAtEndRange() const
Definition: DeclObjC.h:1098
clang::ObjCInterfaceDecl::visible_extensions_range
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
Definition: DeclObjC.h:1697
clang::ObjCPropertyDecl::getPropertyAttributes
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:812
clang::ASTDeclWriter
Definition: ASTWriterDecl.cpp:34
clang::ObjCTypeParamDecl::setVariance
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
Definition: DeclObjC.h:627
clang::ObjCMethodDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Definition: DeclObjC.h:535
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:1636
clang::Decl::getLocation
SourceLocation getLocation() const
Definition: DeclBase.h:430
clang::ObjCPropertyDecl::setPropertyIvarDecl
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
Definition: DeclObjC.h:917
clang::ObjCPropertyImplDecl::CreateDeserialized
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2320
clang::ObjCProtocolDecl::hasDefinition
bool hasDefinition() const
Determine whether this protocol has a definition.
Definition: DeclObjC.h:2182
clang::ObjCPropertyImplDecl::classofKind
static bool classofKind(Decl::Kind K)
Definition: DeclObjC.h:2859
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:612
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:2205
clang::ObjCPropertyDecl::getQueryKind
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
Definition: DeclObjC.h:862
clang::ObjCMethodDecl::getSendResultType
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
Definition: DeclObjC.cpp:1187
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:2199
clang::ObjCPropertyAttribute::kind_retain
@ kind_retain
Definition: DeclObjCCommon.h:28
clang::ObjCCategoryDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2337
clang::ObjCCategoryDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2349
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:1966
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:2275
clang::ObjCImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2463
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:1491
clang::ObjCProtocolDecl::getDefinition
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
Definition: DeclObjC.h:2194
clang::ObjCList::begin
iterator begin() const
Definition: DeclObjC.h:91
clang::ICIS_NoInit
@ ICIS_NoInit
No in-class initializer.
Definition: Specifiers.h:248
clang::ObjCMethodDecl::isVariadic
bool isVariadic() const
Definition: DeclObjC.h:436
clang::ObjCContainerDecl::method_iterator
specific_decl_iterator< ObjCMethodDecl > method_iterator
Definition: DeclObjC.h:1009
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:1468
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:1198
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:1525
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:2328
clang::ObjCPropertyImplDecl::setGetterMethodDecl
void setGetterMethodDecl(ObjCMethodDecl *MD)
Definition: DeclObjC.h:2837
clang::ObjCIvarDecl::Package
@ Package
Definition: DeclObjC.h:1926
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:1568
clang::ObjCMethodDecl::getImplementationControl
ImplementationControl getImplementationControl() const
Definition: DeclObjC.h:502
clang::ObjCCategoryImplDecl::Create
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
Definition: DeclObjC.cpp:2101
clang::ObjCImplementationDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:2683
clang::DeclContext::decls_begin
decl_iterator decls_begin() const
Definition: DeclBase.cpp:1419