clang  16.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/DenseSet.h"
29 #include "llvm/ADT/MapVector.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<SourceLocation> SelLocs = std::nullopt);
394 
395  // Iterator access to parameter types.
396  struct GetTypeFn {
397  QualType operator()(const ParmVarDecl *PD) const { return PD->getType(); }
398  };
399 
400  using param_type_iterator =
401  llvm::mapped_iterator<param_const_iterator, GetTypeFn>;
402 
404  return llvm::map_iterator(param_begin(), GetTypeFn());
405  }
406 
408  return llvm::map_iterator(param_end(), GetTypeFn());
409  }
410 
411  /// createImplicitParams - Used to lazily create the self and cmd
412  /// implicit parameters. This must be called prior to using getSelfDecl()
413  /// or getCmdDecl(). The call is ignored if the implicit parameters
414  /// have already been created.
415  void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID);
416 
417  /// \return the type for \c self and set \arg selfIsPseudoStrong and
418  /// \arg selfIsConsumed accordingly.
419  QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID,
420  bool &selfIsPseudoStrong, bool &selfIsConsumed) const;
421 
422  ImplicitParamDecl * getSelfDecl() const { return SelfDecl; }
423  void setSelfDecl(ImplicitParamDecl *SD) { SelfDecl = SD; }
424  ImplicitParamDecl * getCmdDecl() const { return CmdDecl; }
425  void setCmdDecl(ImplicitParamDecl *CD) { CmdDecl = CD; }
426 
427  /// Determines the family of this method.
429 
430  bool isInstanceMethod() const { return ObjCMethodDeclBits.IsInstance; }
431  void setInstanceMethod(bool isInst) {
432  ObjCMethodDeclBits.IsInstance = isInst;
433  }
434 
435  bool isVariadic() const { return ObjCMethodDeclBits.IsVariadic; }
436  void setVariadic(bool isVar) { ObjCMethodDeclBits.IsVariadic = isVar; }
437 
438  bool isClassMethod() const { return !isInstanceMethod(); }
439 
440  bool isPropertyAccessor() const {
441  return ObjCMethodDeclBits.IsPropertyAccessor;
442  }
443 
444  void setPropertyAccessor(bool isAccessor) {
445  ObjCMethodDeclBits.IsPropertyAccessor = isAccessor;
446  }
447 
449  return ObjCMethodDeclBits.IsSynthesizedAccessorStub;
450  }
451 
453  ObjCMethodDeclBits.IsSynthesizedAccessorStub = isSynthesizedAccessorStub;
454  }
455 
456  bool isDefined() const { return ObjCMethodDeclBits.IsDefined; }
457  void setDefined(bool isDefined) { ObjCMethodDeclBits.IsDefined = isDefined; }
458 
459  /// Whether this method overrides any other in the class hierarchy.
460  ///
461  /// A method is said to override any method in the class's
462  /// base classes, its protocols, or its categories' protocols, that has
463  /// the same selector and is of the same kind (class or instance).
464  /// A method in an implementation is not considered as overriding the same
465  /// method in the interface or its categories.
466  bool isOverriding() const { return ObjCMethodDeclBits.IsOverriding; }
467  void setOverriding(bool IsOver) { ObjCMethodDeclBits.IsOverriding = IsOver; }
468 
469  /// Return overridden methods for the given \p Method.
470  ///
471  /// An ObjC method is considered to override any method in the class's
472  /// base classes (and base's categories), its protocols, or its categories'
473  /// protocols, that has
474  /// the same selector and is of the same kind (class or instance).
475  /// A method in an implementation is not considered as overriding the same
476  /// method in the interface or its categories.
478  SmallVectorImpl<const ObjCMethodDecl *> &Overridden) const;
479 
480  /// True if the method was a definition but its body was skipped.
481  bool hasSkippedBody() const { return ObjCMethodDeclBits.HasSkippedBody; }
482  void setHasSkippedBody(bool Skipped = true) {
483  ObjCMethodDeclBits.HasSkippedBody = Skipped;
484  }
485 
486  /// True if the method is tagged as objc_direct
487  bool isDirectMethod() const;
488 
489  /// True if the method has a parameter that's destroyed in the callee.
490  bool hasParamDestroyedInCallee() const;
491 
492  /// Returns the property associated with this method's selector.
493  ///
494  /// Note that even if this particular method is not marked as a property
495  /// accessor, it is still possible for it to match a property declared in a
496  /// superclass. Pass \c false if you only want to check the current class.
497  const ObjCPropertyDecl *findPropertyDecl(bool CheckOverrides = true) const;
498 
499  // Related to protocols declared in \@protocol
501  ObjCMethodDeclBits.DeclImplementation = ic;
502  }
503 
505  return ImplementationControl(ObjCMethodDeclBits.DeclImplementation);
506  }
507 
508  bool isOptional() const {
510  }
511 
512  /// Returns true if this specific method declaration is marked with the
513  /// designated initializer attribute.
515 
516  /// Returns true if the method selector resolves to a designated initializer
517  /// in the class's interface.
518  ///
519  /// \param InitMethod if non-null and the function returns true, it receives
520  /// the method declaration that was marked with the designated initializer
521  /// attribute.
523  const ObjCMethodDecl **InitMethod = nullptr) const;
524 
525  /// Determine whether this method has a body.
526  bool hasBody() const override { return Body.isValid(); }
527 
528  /// Retrieve the body of this method, if it has one.
529  Stmt *getBody() const override;
530 
531  void setLazyBody(uint64_t Offset) { Body = Offset; }
532 
534  void setBody(Stmt *B) { Body = B; }
535 
536  /// Returns whether this specific method is a definition.
537  bool isThisDeclarationADefinition() const { return hasBody(); }
538 
539  /// Is this method defined in the NSObject base class?
540  bool definedInNSObject(const ASTContext &) const;
541 
542  // Implement isa/cast/dyncast/etc.
543  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
544  static bool classofKind(Kind K) { return K == ObjCMethod; }
545 
547  return static_cast<DeclContext *>(const_cast<ObjCMethodDecl*>(D));
548  }
549 
551  return static_cast<ObjCMethodDecl *>(const_cast<DeclContext*>(DC));
552  }
553 };
554 
555 /// Describes the variance of a given generic parameter.
556 enum class ObjCTypeParamVariance : uint8_t {
557  /// The parameter is invariant: must match exactly.
558  Invariant,
559 
560  /// The parameter is covariant, e.g., X<T> is a subtype of X<U> when
561  /// the type parameter is covariant and T is a subtype of U.
562  Covariant,
563 
564  /// The parameter is contravariant, e.g., X<T> is a subtype of X<U>
565  /// when the type parameter is covariant and U is a subtype of T.
567 };
568 
569 /// Represents the declaration of an Objective-C type parameter.
570 ///
571 /// \code
572 /// @interface NSDictionary<Key : id<NSCopying>, Value>
573 /// @end
574 /// \endcode
575 ///
576 /// In the example above, both \c Key and \c Value are represented by
577 /// \c ObjCTypeParamDecl. \c Key has an explicit bound of \c id<NSCopying>,
578 /// while \c Value gets an implicit bound of \c id.
579 ///
580 /// Objective-C type parameters are typedef-names in the grammar,
582  /// Index of this type parameter in the type parameter list.
583  unsigned Index : 14;
584 
585  /// The variance of the type parameter.
586  unsigned Variance : 2;
587 
588  /// The location of the variance, if any.
589  SourceLocation VarianceLoc;
590 
591  /// The location of the ':', which will be valid when the bound was
592  /// explicitly specified.
593  SourceLocation ColonLoc;
594 
596  ObjCTypeParamVariance variance, SourceLocation varianceLoc,
597  unsigned index,
599  SourceLocation colonLoc, TypeSourceInfo *boundInfo)
600  : TypedefNameDecl(ObjCTypeParam, ctx, dc, nameLoc, nameLoc, name,
601  boundInfo),
602  Index(index), Variance(static_cast<unsigned>(variance)),
603  VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
604 
605  void anchor() override;
606 
607 public:
608  friend class ASTDeclReader;
609  friend class ASTDeclWriter;
610 
612  ObjCTypeParamVariance variance,
613  SourceLocation varianceLoc,
614  unsigned index,
615  SourceLocation nameLoc,
617  SourceLocation colonLoc,
618  TypeSourceInfo *boundInfo);
619  static ObjCTypeParamDecl *CreateDeserialized(ASTContext &ctx, unsigned ID);
620 
621  SourceRange getSourceRange() const override LLVM_READONLY;
622 
623  /// Determine the variance of this type parameter.
625  return static_cast<ObjCTypeParamVariance>(Variance);
626  }
627 
628  /// Set the variance of this type parameter.
630  Variance = static_cast<unsigned>(variance);
631  }
632 
633  /// Retrieve the location of the variance keyword.
634  SourceLocation getVarianceLoc() const { return VarianceLoc; }
635 
636  /// Retrieve the index into its type parameter list.
637  unsigned getIndex() const { return Index; }
638 
639  /// Whether this type parameter has an explicitly-written type bound, e.g.,
640  /// "T : NSView".
641  bool hasExplicitBound() const { return ColonLoc.isValid(); }
642 
643  /// Retrieve the location of the ':' separating the type parameter name
644  /// from the explicitly-specified bound.
645  SourceLocation getColonLoc() const { return ColonLoc; }
646 
647  // Implement isa/cast/dyncast/etc.
648  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
649  static bool classofKind(Kind K) { return K == ObjCTypeParam; }
650 };
651 
652 /// Stores a list of Objective-C type parameters for a parameterized class
653 /// or a category/extension thereof.
654 ///
655 /// \code
656 /// @interface NSArray<T> // stores the <T>
657 /// @end
658 /// \endcode
659 class ObjCTypeParamList final
660  : private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
661  /// Location of the left and right angle brackets.
662  SourceRange Brackets;
663  /// The number of parameters in the list, which are tail-allocated.
664  unsigned NumParams;
665 
668  SourceLocation rAngleLoc);
669 
670 public:
672 
673  /// Create a new Objective-C type parameter list.
674  static ObjCTypeParamList *create(ASTContext &ctx,
675  SourceLocation lAngleLoc,
677  SourceLocation rAngleLoc);
678 
679  /// Iterate through the type parameters in the list.
681 
682  iterator begin() { return getTrailingObjects<ObjCTypeParamDecl *>(); }
683 
684  iterator end() { return begin() + size(); }
685 
686  /// Determine the number of type parameters in this list.
687  unsigned size() const { return NumParams; }
688 
689  // Iterate through the type parameters in the list.
691 
693  return getTrailingObjects<ObjCTypeParamDecl *>();
694  }
695 
696  const_iterator end() const {
697  return begin() + size();
698  }
699 
701  assert(size() > 0 && "empty Objective-C type parameter list");
702  return *begin();
703  }
704 
706  assert(size() > 0 && "empty Objective-C type parameter list");
707  return *(end() - 1);
708  }
709 
710  SourceLocation getLAngleLoc() const { return Brackets.getBegin(); }
711  SourceLocation getRAngleLoc() const { return Brackets.getEnd(); }
712  SourceRange getSourceRange() const { return Brackets; }
713 
714  /// Gather the default set of type arguments to be substituted for
715  /// these type parameters when dealing with an unspecialized type.
716  void gatherDefaultTypeArgs(SmallVectorImpl<QualType> &typeArgs) const;
717 };
718 
719 enum class ObjCPropertyQueryKind : uint8_t {
720  OBJC_PR_query_unknown = 0x00,
723 };
724 
725 /// Represents one property declaration in an Objective-C interface.
726 ///
727 /// For example:
728 /// \code{.mm}
729 /// \@property (assign, readwrite) int MyProperty;
730 /// \endcode
731 class ObjCPropertyDecl : public NamedDecl {
732  void anchor() override;
733 
734 public:
737 
738 private:
739  // location of \@property
740  SourceLocation AtLoc;
741 
742  // location of '(' starting attribute list or null.
743  SourceLocation LParenLoc;
744 
745  QualType DeclType;
746  TypeSourceInfo *DeclTypeSourceInfo;
747  unsigned PropertyAttributes : NumObjCPropertyAttrsBits;
748  unsigned PropertyAttributesAsWritten : NumObjCPropertyAttrsBits;
749 
750  // \@required/\@optional
751  unsigned PropertyImplementation : 2;
752 
753  // getter name of NULL if no getter
754  Selector GetterName;
755 
756  // setter name of NULL if no setter
757  Selector SetterName;
758 
759  // location of the getter attribute's value
760  SourceLocation GetterNameLoc;
761 
762  // location of the setter attribute's value
763  SourceLocation SetterNameLoc;
764 
765  // Declaration of getter instance method
766  ObjCMethodDecl *GetterMethodDecl = nullptr;
767 
768  // Declaration of setter instance method
769  ObjCMethodDecl *SetterMethodDecl = nullptr;
770 
771  // Synthesize ivar for this property
772  ObjCIvarDecl *PropertyIvarDecl = nullptr;
773 
775  SourceLocation AtLocation, SourceLocation LParenLocation,
776  QualType T, TypeSourceInfo *TSI, PropertyControl propControl)
777  : NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
778  LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
779  PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
780  PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
781  PropertyImplementation(propControl) {}
782 
783 public:
784  static ObjCPropertyDecl *
785  Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id,
786  SourceLocation AtLocation, SourceLocation LParenLocation, QualType T,
787  TypeSourceInfo *TSI, PropertyControl propControl = None);
788 
789  static ObjCPropertyDecl *CreateDeserialized(ASTContext &C, unsigned ID);
790 
791  SourceLocation getAtLoc() const { return AtLoc; }
792  void setAtLoc(SourceLocation L) { AtLoc = L; }
793 
794  SourceLocation getLParenLoc() const { return LParenLoc; }
795  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
796 
797  TypeSourceInfo *getTypeSourceInfo() const { return DeclTypeSourceInfo; }
798 
799  QualType getType() const { return DeclType; }
800 
802  DeclType = T;
803  DeclTypeSourceInfo = TSI;
804  }
805 
806  /// Retrieve the type when this property is used with a specific base object
807  /// type.
808  QualType getUsageType(QualType objectType) const;
809 
811  return ObjCPropertyAttribute::Kind(PropertyAttributes);
812  }
813 
815  PropertyAttributes |= PRVal;
816  }
817 
818  void overwritePropertyAttributes(unsigned PRVal) {
819  PropertyAttributes = PRVal;
820  }
821 
823  return ObjCPropertyAttribute::Kind(PropertyAttributesAsWritten);
824  }
825 
827  PropertyAttributesAsWritten = PRVal;
828  }
829 
830  // Helper methods for accessing attributes.
831 
832  /// isReadOnly - Return true iff the property has a setter.
833  bool isReadOnly() const {
834  return (PropertyAttributes & ObjCPropertyAttribute::kind_readonly);
835  }
836 
837  /// isAtomic - Return true if the property is atomic.
838  bool isAtomic() const {
839  return (PropertyAttributes & ObjCPropertyAttribute::kind_atomic);
840  }
841 
842  /// isRetaining - Return true if the property retains its value.
843  bool isRetaining() const {
844  return (PropertyAttributes & (ObjCPropertyAttribute::kind_retain |
847  }
848 
849  bool isInstanceProperty() const { return !isClassProperty(); }
850  bool isClassProperty() const {
851  return PropertyAttributes & ObjCPropertyAttribute::kind_class;
852  }
853  bool isDirectProperty() const;
854 
858  }
859 
863  }
864 
865  /// getSetterKind - Return the method used for doing assignment in
866  /// the property setter. This is only valid if the property has been
867  /// defined to have a setter.
869  if (PropertyAttributes & ObjCPropertyAttribute::kind_strong)
870  return getType()->isBlockPointerType() ? Copy : Retain;
871  if (PropertyAttributes & ObjCPropertyAttribute::kind_retain)
872  return Retain;
873  if (PropertyAttributes & ObjCPropertyAttribute::kind_copy)
874  return Copy;
875  if (PropertyAttributes & ObjCPropertyAttribute::kind_weak)
876  return Weak;
877  return Assign;
878  }
879 
880  Selector getGetterName() const { return GetterName; }
881  SourceLocation getGetterNameLoc() const { return GetterNameLoc; }
882 
884  GetterName = Sel;
885  GetterNameLoc = Loc;
886  }
887 
888  Selector getSetterName() const { return SetterName; }
889  SourceLocation getSetterNameLoc() const { return SetterNameLoc; }
890 
892  SetterName = Sel;
893  SetterNameLoc = Loc;
894  }
895 
896  ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
897  void setGetterMethodDecl(ObjCMethodDecl *gDecl) { GetterMethodDecl = gDecl; }
898 
899  ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; }
900  void setSetterMethodDecl(ObjCMethodDecl *gDecl) { SetterMethodDecl = gDecl; }
901 
902  // Related to \@optional/\@required declared in \@protocol
904  PropertyImplementation = pc;
905  }
906 
908  return PropertyControl(PropertyImplementation);
909  }
910 
911  bool isOptional() const {
912  return getPropertyImplementation() == PropertyControl::Optional;
913  }
914 
916  PropertyIvarDecl = Ivar;
917  }
918 
920  return PropertyIvarDecl;
921  }
922 
923  SourceRange getSourceRange() const override LLVM_READONLY {
924  return SourceRange(AtLoc, getLocation());
925  }
926 
927  /// Get the default name of the synthesized ivar.
929 
930  /// Lookup a property by name in the specified DeclContext.
932  const IdentifierInfo *propertyID,
933  ObjCPropertyQueryKind queryKind);
934 
935  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
936  static bool classofKind(Kind K) { return K == ObjCProperty; }
937 };
938 
939 /// ObjCContainerDecl - Represents a container for method declarations.
940 /// Current sub-classes are ObjCInterfaceDecl, ObjCCategoryDecl,
941 /// ObjCProtocolDecl, and ObjCImplDecl.
942 ///
943 class ObjCContainerDecl : public NamedDecl, public DeclContext {
944  // This class stores some data in DeclContext::ObjCContainerDeclBits
945  // to save some space. Use the provided accessors to access it.
946 
947  // These two locations in the range mark the end of the method container.
948  // The first points to the '@' token, and the second to the 'end' token.
949  SourceRange AtEnd;
950 
951  void anchor() override;
952 
953 public:
955  SourceLocation nameLoc, SourceLocation atStartLoc);
956 
957  // Iterator access to instance/class properties.
959  using prop_range =
960  llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>;
961 
963 
965  return prop_iterator(decls_begin());
966  }
967 
969  return prop_iterator(decls_end());
970  }
971 
972  using instprop_iterator =
973  filtered_decl_iterator<ObjCPropertyDecl,
975  using instprop_range = llvm::iterator_range<instprop_iterator>;
976 
979  }
980 
982  return instprop_iterator(decls_begin());
983  }
984 
986  return instprop_iterator(decls_end());
987  }
988 
989  using classprop_iterator =
990  filtered_decl_iterator<ObjCPropertyDecl,
992  using classprop_range = llvm::iterator_range<classprop_iterator>;
993 
996  }
997 
1000  }
1001 
1003  return classprop_iterator(decls_end());
1004  }
1005 
1006  // Iterator access to instance/class methods.
1008  using method_range =
1009  llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>;
1010 
1012  return method_range(meth_begin(), meth_end());
1013  }
1014 
1016  return method_iterator(decls_begin());
1017  }
1018 
1020  return method_iterator(decls_end());
1021  }
1022 
1023  using instmeth_iterator =
1024  filtered_decl_iterator<ObjCMethodDecl,
1026  using instmeth_range = llvm::iterator_range<instmeth_iterator>;
1027 
1030  }
1031 
1033  return instmeth_iterator(decls_begin());
1034  }
1035 
1037  return instmeth_iterator(decls_end());
1038  }
1039 
1040  using classmeth_iterator =
1041  filtered_decl_iterator<ObjCMethodDecl,
1043  using classmeth_range = llvm::iterator_range<classmeth_iterator>;
1044 
1047  }
1048 
1050  return classmeth_iterator(decls_begin());
1051  }
1052 
1054  return classmeth_iterator(decls_end());
1055  }
1056 
1057  // Get the local instance/class method declared in this interface.
1058  ObjCMethodDecl *getMethod(Selector Sel, bool isInstance,
1059  bool AllowHidden = false) const;
1060 
1062  bool AllowHidden = false) const {
1063  return getMethod(Sel, true/*isInstance*/, AllowHidden);
1064  }
1065 
1066  ObjCMethodDecl *getClassMethod(Selector Sel, bool AllowHidden = false) const {
1067  return getMethod(Sel, false/*isInstance*/, AllowHidden);
1068  }
1069 
1070  bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const;
1072 
1074  bool IsInstance) const;
1075 
1077  FindPropertyDeclaration(const IdentifierInfo *PropertyId,
1078  ObjCPropertyQueryKind QueryKind) const;
1079 
1080  using PropertyMap =
1081  llvm::MapVector<std::pair<IdentifierInfo *, unsigned /*isClassProperty*/>,
1083  using ProtocolPropertySet = llvm::SmallDenseSet<const ObjCProtocolDecl *, 8>;
1085 
1086  /// This routine collects list of properties to be implemented in the class.
1087  /// This includes, class's and its conforming protocols' properties.
1088  /// Note, the superclass's properties are not included in the list.
1089  virtual void collectPropertiesToImplement(PropertyMap &PM) 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 
1781  void collectPropertiesToImplement(PropertyMap &PM) const override;
1782 
1783  /// isSuperClassOf - Return true if this class is the specified class or is a
1784  /// super class of the specified interface class.
1785  bool isSuperClassOf(const ObjCInterfaceDecl *I) const {
1786  // If RHS is derived from LHS it is OK; else it is not OK.
1787  while (I != nullptr) {
1788  if (declaresSameEntity(this, I))
1789  return true;
1790 
1791  I = I->getSuperClass();
1792  }
1793  return false;
1794  }
1795 
1796  /// isArcWeakrefUnavailable - Checks for a class or one of its super classes
1797  /// to be incompatible with __weak references. Returns true if it is.
1798  bool isArcWeakrefUnavailable() const;
1799 
1800  /// isObjCRequiresPropertyDefs - Checks that a class or one of its super
1801  /// classes must not be auto-synthesized. Returns class decl. if it must not
1802  /// be; 0, otherwise.
1804 
1806  ObjCInterfaceDecl *&ClassDeclared);
1808  ObjCInterfaceDecl *ClassDeclared;
1809  return lookupInstanceVariable(IVarName, ClassDeclared);
1810  }
1811 
1813 
1814  // Lookup a method. First, we search locally. If a method isn't
1815  // found, we search referenced protocols and class categories.
1816  ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance,
1817  bool shallowCategoryLookup = false,
1818  bool followSuper = true,
1819  const ObjCCategoryDecl *C = nullptr) const;
1820 
1821  /// Lookup an instance method for a given selector.
1823  return lookupMethod(Sel, true/*isInstance*/);
1824  }
1825 
1826  /// Lookup a class method for a given selector.
1828  return lookupMethod(Sel, false/*isInstance*/);
1829  }
1830 
1832 
1833  /// Lookup a method in the classes implementation hierarchy.
1835  bool Instance=true) const;
1836 
1838  return lookupPrivateMethod(Sel, false);
1839  }
1840 
1841  /// Lookup a setter or getter in the class hierarchy,
1842  /// including in all categories except for category passed
1843  /// as argument.
1845  const ObjCCategoryDecl *Cat,
1846  bool IsClassProperty) const {
1847  return lookupMethod(Sel, !IsClassProperty/*isInstance*/,
1848  false/*shallowCategoryLookup*/,
1849  true /* followsSuper */,
1850  Cat);
1851  }
1852 
1854  if (!hasDefinition())
1855  return getLocation();
1856 
1857  return data().EndLoc;
1858  }
1859 
1860  void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; }
1861 
1862  /// Retrieve the starting location of the superclass.
1864 
1865  /// isImplicitInterfaceDecl - check that this is an implicitly declared
1866  /// ObjCInterfaceDecl node. This is for legacy objective-c \@implementation
1867  /// declaration without an \@interface declaration.
1869  return hasDefinition() ? data().Definition->isImplicit() : isImplicit();
1870  }
1871 
1872  /// ClassImplementsProtocol - Checks that 'lProto' protocol
1873  /// has been implemented in IDecl class, its super class or categories (if
1874  /// lookupCategory is true).
1876  bool lookupCategory,
1877  bool RHSIsQualifiedID = false);
1878 
1880  using redecl_iterator = redeclarable_base::redecl_iterator;
1881 
1888 
1889  /// Retrieves the canonical declaration of this Objective-C class.
1891  const ObjCInterfaceDecl *getCanonicalDecl() const { return getFirstDecl(); }
1892 
1893  // Low-level accessor
1894  const Type *getTypeForDecl() const { return TypeForDecl; }
1895  void setTypeForDecl(const Type *TD) const { TypeForDecl = TD; }
1896 
1897  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1898  static bool classofKind(Kind K) { return K == ObjCInterface; }
1899 
1900 private:
1901  const ObjCInterfaceDecl *findInterfaceWithDesignatedInitializers() const;
1902  bool inheritsDesignatedInitializers() const;
1903 };
1904 
1905 /// ObjCIvarDecl - Represents an ObjC instance variable. In general, ObjC
1906 /// instance variables are identical to C. The only exception is Objective-C
1907 /// supports C++ style access control. For example:
1908 ///
1909 /// \@interface IvarExample : NSObject
1910 /// {
1911 /// id defaultToProtected;
1912 /// \@public:
1913 /// id canBePublic; // same as C++.
1914 /// \@protected:
1915 /// id canBeProtected; // same as C++.
1916 /// \@package:
1917 /// id canBePackage; // framework visibility (not available in C++).
1918 /// }
1919 ///
1920 class ObjCIvarDecl : public FieldDecl {
1921  void anchor() override;
1922 
1923 public:
1926  };
1927 
1928 private:
1931  QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW,
1932  bool synthesized)
1933  : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
1934  /*Mutable=*/false, /*HasInit=*/ICIS_NoInit),
1935  DeclAccess(ac), Synthesized(synthesized) {}
1936 
1937 public:
1938  static ObjCIvarDecl *Create(ASTContext &C, ObjCContainerDecl *DC,
1939  SourceLocation StartLoc, SourceLocation IdLoc,
1940  IdentifierInfo *Id, QualType T,
1941  TypeSourceInfo *TInfo,
1942  AccessControl ac, Expr *BW = nullptr,
1943  bool synthesized=false);
1944 
1945  static ObjCIvarDecl *CreateDeserialized(ASTContext &C, unsigned ID);
1946 
1947  /// Return the class interface that this ivar is logically contained
1948  /// in; this is either the interface where the ivar was declared, or the
1949  /// interface the ivar is conceptually a part of in the case of synthesized
1950  /// ivars.
1951  ObjCInterfaceDecl *getContainingInterface();
1953  return const_cast<ObjCIvarDecl *>(this)->getContainingInterface();
1954  }
1955 
1956  ObjCIvarDecl *getNextIvar() { return NextIvar; }
1957  const ObjCIvarDecl *getNextIvar() const { return NextIvar; }
1958  void setNextIvar(ObjCIvarDecl *ivar) { NextIvar = ivar; }
1959 
1961  return cast<ObjCIvarDecl>(FieldDecl::getCanonicalDecl());
1962  }
1964  return const_cast<ObjCIvarDecl *>(this)->getCanonicalDecl();
1965  }
1966 
1967  void setAccessControl(AccessControl ac) { DeclAccess = ac; }
1968 
1969  AccessControl getAccessControl() const { return AccessControl(DeclAccess); }
1970 
1972  return DeclAccess == None ? Protected : AccessControl(DeclAccess);
1973  }
1974 
1975  void setSynthesize(bool synth) { Synthesized = synth; }
1976  bool getSynthesize() const { return Synthesized; }
1977 
1978  /// Retrieve the type of this instance variable when viewed as a member of a
1979  /// specific object type.
1980  QualType getUsageType(QualType objectType) const;
1981 
1982  // Implement isa/cast/dyncast/etc.
1983  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
1984  static bool classofKind(Kind K) { return K == ObjCIvar; }
1985 
1986 private:
1987  /// NextIvar - Next Ivar in the list of ivars declared in class; class's
1988  /// extensions and class's implementation
1989  ObjCIvarDecl *NextIvar = nullptr;
1990 
1991  // NOTE: VC++ treats enums as signed, avoid using the AccessControl enum
1992  unsigned DeclAccess : 3;
1993  unsigned Synthesized : 1;
1994 };
1995 
1996 /// Represents a field declaration created by an \@defs(...).
2000  QualType T, Expr *BW)
2001  : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
2002  /*TInfo=*/nullptr, // FIXME: Do ObjCAtDefs have declarators ?
2003  BW, /*Mutable=*/false, /*HasInit=*/ICIS_NoInit) {}
2004 
2005  void anchor() override;
2006 
2007 public:
2009  SourceLocation StartLoc,
2011  QualType T, Expr *BW);
2012 
2013  static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2014 
2015  // Implement isa/cast/dyncast/etc.
2016  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2017  static bool classofKind(Kind K) { return K == ObjCAtDefsField; }
2018 };
2019 
2020 /// Represents an Objective-C protocol declaration.
2021 ///
2022 /// Objective-C protocols declare a pure abstract type (i.e., no instance
2023 /// variables are permitted). Protocols originally drew inspiration from
2024 /// C++ pure virtual functions (a C++ feature with nice semantics and lousy
2025 /// syntax:-). Here is an example:
2026 ///
2027 /// \code
2028 /// \@protocol NSDraggingInfo <refproto1, refproto2>
2029 /// - (NSWindow *)draggingDestinationWindow;
2030 /// - (NSImage *)draggedImage;
2031 /// \@end
2032 /// \endcode
2033 ///
2034 /// This says that NSDraggingInfo requires two methods and requires everything
2035 /// that the two "referenced protocols" 'refproto1' and 'refproto2' require as
2036 /// well.
2037 ///
2038 /// \code
2039 /// \@interface ImplementsNSDraggingInfo : NSObject <NSDraggingInfo>
2040 /// \@end
2041 /// \endcode
2042 ///
2043 /// ObjC protocols inspired Java interfaces. Unlike Java, ObjC classes and
2044 /// protocols are in distinct namespaces. For example, Cocoa defines both
2045 /// an NSObject protocol and class (which isn't allowed in Java). As a result,
2046 /// protocols are referenced using angle brackets as follows:
2047 ///
2048 /// id <NSDraggingInfo> anyObjectThatImplementsNSDraggingInfo;
2050  public Redeclarable<ObjCProtocolDecl> {
2051  struct DefinitionData {
2052  // The declaration that defines this protocol.
2053  ObjCProtocolDecl *Definition;
2054 
2055  /// Referenced protocols
2056  ObjCProtocolList ReferencedProtocols;
2057 
2058  /// Tracks whether a ODR hash has been computed for this protocol.
2059  unsigned HasODRHash : 1;
2060 
2061  /// A hash of parts of the class to help in ODR checking.
2062  unsigned ODRHash = 0;
2063  };
2064 
2065  /// Contains a pointer to the data associated with this class,
2066  /// which will be NULL if this class has not yet been defined.
2067  ///
2068  /// The bit indicates when we don't need to check for out-of-date
2069  /// declarations. It will be set unless modules are enabled.
2070  llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
2071 
2073  SourceLocation nameLoc, SourceLocation atStartLoc,
2074  ObjCProtocolDecl *PrevDecl);
2075 
2076  void anchor() override;
2077 
2078  DefinitionData &data() const {
2079  assert(Data.getPointer() && "Objective-C protocol has no definition!");
2080  return *Data.getPointer();
2081  }
2082 
2083  void allocateDefinitionData();
2084 
2086 
2087  ObjCProtocolDecl *getNextRedeclarationImpl() override {
2088  return getNextRedeclaration();
2089  }
2090 
2091  ObjCProtocolDecl *getPreviousDeclImpl() override {
2092  return getPreviousDecl();
2093  }
2094 
2095  ObjCProtocolDecl *getMostRecentDeclImpl() override {
2096  return getMostRecentDecl();
2097  }
2098 
2099  /// True if a valid hash is stored in ODRHash.
2100  bool hasODRHash() const;
2101  void setHasODRHash(bool HasHash);
2102 
2103 public:
2104  friend class ASTDeclReader;
2105  friend class ASTDeclWriter;
2106  friend class ASTReader;
2107  friend class ODRDiagsEmitter;
2108 
2110  IdentifierInfo *Id,
2111  SourceLocation nameLoc,
2112  SourceLocation atStartLoc,
2113  ObjCProtocolDecl *PrevDecl);
2114 
2115  static ObjCProtocolDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2116 
2118  assert(hasDefinition() && "No definition available!");
2119  return data().ReferencedProtocols;
2120  }
2121 
2123  using protocol_range = llvm::iterator_range<protocol_iterator>;
2124 
2127  }
2128 
2130  if (!hasDefinition())
2131  return protocol_iterator();
2132 
2133  return data().ReferencedProtocols.begin();
2134  }
2135 
2137  if (!hasDefinition())
2138  return protocol_iterator();
2139 
2140  return data().ReferencedProtocols.end();
2141  }
2142 
2144  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
2145 
2148  }
2149 
2151  if (!hasDefinition())
2152  return protocol_loc_iterator();
2153 
2154  return data().ReferencedProtocols.loc_begin();
2155  }
2156 
2158  if (!hasDefinition())
2159  return protocol_loc_iterator();
2160 
2161  return data().ReferencedProtocols.loc_end();
2162  }
2163 
2164  unsigned protocol_size() const {
2165  if (!hasDefinition())
2166  return 0;
2167 
2168  return data().ReferencedProtocols.size();
2169  }
2170 
2171  /// setProtocolList - Set the list of protocols that this interface
2172  /// implements.
2173  void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num,
2174  const SourceLocation *Locs, ASTContext &C) {
2175  assert(hasDefinition() && "Protocol is not defined");
2176  data().ReferencedProtocols.set(List, Num, Locs, C);
2177  }
2178 
2179  /// This is true iff the protocol is tagged with the
2180  /// `objc_non_runtime_protocol` attribute.
2181  bool isNonRuntimeProtocol() const;
2182 
2183  /// Get the set of all protocols implied by this protocols inheritance
2184  /// hierarchy.
2186 
2188 
2189  // Lookup a method. First, we search locally. If a method isn't
2190  // found, we search referenced protocols and class categories.
2191  ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance) const;
2192 
2194  return lookupMethod(Sel, true/*isInstance*/);
2195  }
2196 
2198  return lookupMethod(Sel, false/*isInstance*/);
2199  }
2200 
2201  /// Determine whether this protocol has a definition.
2202  bool hasDefinition() const {
2203  // If the name of this protocol is out-of-date, bring it up-to-date, which
2204  // might bring in a definition.
2205  // Note: a null value indicates that we don't have a definition and that
2206  // modules are enabled.
2207  if (!Data.getOpaqueValue())
2209 
2210  return Data.getPointer();
2211  }
2212 
2213  /// Retrieve the definition of this protocol, if any.
2215  return hasDefinition()? Data.getPointer()->Definition : nullptr;
2216  }
2217 
2218  /// Retrieve the definition of this protocol, if any.
2220  return hasDefinition()? Data.getPointer()->Definition : nullptr;
2221  }
2222 
2223  /// Determine whether this particular declaration is also the
2224  /// definition.
2226  return getDefinition() == this;
2227  }
2228 
2229  /// Starts the definition of this Objective-C protocol.
2230  void startDefinition();
2231 
2232  /// Starts the definition without sharing it with other redeclarations.
2233  /// Such definition shouldn't be used for anything but only to compare if
2234  /// a duplicate is compatible with previous definition or if it is
2235  /// a distinct duplicate.
2237  void mergeDuplicateDefinitionWithCommon(const ObjCProtocolDecl *Definition);
2238 
2239  /// Produce a name to be used for protocol's metadata. It comes either via
2240  /// objc_runtime_name attribute or protocol name.
2241  StringRef getObjCRuntimeNameAsString() const;
2242 
2243  SourceRange getSourceRange() const override LLVM_READONLY {
2246 
2247  return SourceRange(getAtStartLoc(), getLocation());
2248  }
2249 
2251  using redecl_iterator = redeclarable_base::redecl_iterator;
2252 
2259 
2260  /// Retrieves the canonical declaration of this Objective-C protocol.
2262  const ObjCProtocolDecl *getCanonicalDecl() const { return getFirstDecl(); }
2263 
2264  void collectPropertiesToImplement(PropertyMap &PM) const override;
2265 
2267  ProtocolPropertySet &PS,
2268  PropertyDeclOrder &PO) const;
2269 
2270  /// Get precomputed ODRHash or add a new one.
2271  unsigned getODRHash();
2272 
2273  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2274  static bool classofKind(Kind K) { return K == ObjCProtocol; }
2275 };
2276 
2277 /// ObjCCategoryDecl - Represents a category declaration. A category allows
2278 /// you to add methods to an existing class (without subclassing or modifying
2279 /// the original class interface or implementation:-). Categories don't allow
2280 /// you to add instance data. The following example adds "myMethod" to all
2281 /// NSView's within a process:
2282 ///
2283 /// \@interface NSView (MyViewMethods)
2284 /// - myMethod;
2285 /// \@end
2286 ///
2287 /// Categories also allow you to split the implementation of a class across
2288 /// several files (a feature more naturally supported in C++).
2289 ///
2290 /// Categories were originally inspired by dynamic languages such as Common
2291 /// Lisp and Smalltalk. More traditional class-based languages (C++, Java)
2292 /// don't support this level of dynamism, which is both powerful and dangerous.
2294  /// Interface belonging to this category
2295  ObjCInterfaceDecl *ClassInterface;
2296 
2297  /// The type parameters associated with this category, if any.
2298  ObjCTypeParamList *TypeParamList = nullptr;
2299 
2300  /// referenced protocols in this category.
2301  ObjCProtocolList ReferencedProtocols;
2302 
2303  /// Next category belonging to this class.
2304  /// FIXME: this should not be a singly-linked list. Move storage elsewhere.
2305  ObjCCategoryDecl *NextClassCategory = nullptr;
2306 
2307  /// The location of the category name in this declaration.
2308  SourceLocation CategoryNameLoc;
2309 
2310  /// class extension may have private ivars.
2311  SourceLocation IvarLBraceLoc;
2312  SourceLocation IvarRBraceLoc;
2313 
2315  SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc,
2317  ObjCTypeParamList *typeParamList,
2318  SourceLocation IvarLBraceLoc = SourceLocation(),
2319  SourceLocation IvarRBraceLoc = SourceLocation());
2320 
2321  void anchor() override;
2322 
2323 public:
2324  friend class ASTDeclReader;
2325  friend class ASTDeclWriter;
2326 
2328  SourceLocation AtLoc,
2329  SourceLocation ClassNameLoc,
2330  SourceLocation CategoryNameLoc,
2331  IdentifierInfo *Id,
2332  ObjCInterfaceDecl *IDecl,
2333  ObjCTypeParamList *typeParamList,
2334  SourceLocation IvarLBraceLoc=SourceLocation(),
2335  SourceLocation IvarRBraceLoc=SourceLocation());
2336  static ObjCCategoryDecl *CreateDeserialized(ASTContext &C, unsigned ID);
2337 
2338  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
2339  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
2340 
2341  /// Retrieve the type parameter list associated with this category or
2342  /// extension.
2343  ObjCTypeParamList *getTypeParamList() const { return TypeParamList; }
2344 
2345  /// Set the type parameters of this category.
2346  ///
2347  /// This function is used by the AST importer, which must import the type
2348  /// parameters after creating their DeclContext to avoid loops.
2350 
2351 
2354 
2355  /// setProtocolList - Set the list of protocols that this interface
2356  /// implements.
2357  void setProtocolList(ObjCProtocolDecl *const*List, unsigned Num,
2358  const SourceLocation *Locs, ASTContext &C) {
2359  ReferencedProtocols.set(List, Num, Locs, C);
2360  }
2361 
2363  return ReferencedProtocols;
2364  }
2365 
2367  using protocol_range = llvm::iterator_range<protocol_iterator>;
2368 
2371  }
2372 
2374  return ReferencedProtocols.begin();
2375  }
2376 
2377  protocol_iterator protocol_end() const { return ReferencedProtocols.end(); }
2378  unsigned protocol_size() const { return ReferencedProtocols.size(); }
2379 
2381  using protocol_loc_range = llvm::iterator_range<protocol_loc_iterator>;
2382 
2385  }
2386 
2388  return ReferencedProtocols.loc_begin();
2389  }
2390 
2392  return ReferencedProtocols.loc_end();
2393  }
2394 
2395  ObjCCategoryDecl *getNextClassCategory() const { return NextClassCategory; }
2396 
2397  /// Retrieve the pointer to the next stored category (or extension),
2398  /// which may be hidden.
2400  return NextClassCategory;
2401  }
2402 
2403  bool IsClassExtension() const { return getIdentifier() == nullptr; }
2404 
2406  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2407 
2408  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
2409 
2411  return ivar_iterator(decls_begin());
2412  }
2413 
2415  return ivar_iterator(decls_end());
2416  }
2417 
2418  unsigned ivar_size() const {
2419  return std::distance(ivar_begin(), ivar_end());
2420  }
2421 
2422  bool ivar_empty() const {
2423  return ivar_begin() == ivar_end();
2424  }
2425 
2426  SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
2427  void setCategoryNameLoc(SourceLocation Loc) { CategoryNameLoc = Loc; }
2428 
2429  void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
2430  SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
2431  void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
2432  SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
2433 
2434  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2435  static bool classofKind(Kind K) { return K == ObjCCategory; }
2436 };
2437 
2439  /// Class interface for this class/category implementation
2440  ObjCInterfaceDecl *ClassInterface;
2441 
2442  void anchor() override;
2443 
2444 protected:
2446  ObjCInterfaceDecl *classInterface,
2447  IdentifierInfo *Id,
2448  SourceLocation nameLoc, SourceLocation atStartLoc)
2449  : ObjCContainerDecl(DK, DC, Id, nameLoc, atStartLoc),
2450  ClassInterface(classInterface) {}
2451 
2452 public:
2453  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
2454  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
2455  void setClassInterface(ObjCInterfaceDecl *IFace);
2456 
2458  // FIXME: Context should be set correctly before we get here.
2459  method->setLexicalDeclContext(this);
2460  addDecl(method);
2461  }
2462 
2464  // FIXME: Context should be set correctly before we get here.
2465  method->setLexicalDeclContext(this);
2466  addDecl(method);
2467  }
2468 
2470 
2472  ObjCPropertyQueryKind queryKind) const;
2474 
2475  // Iterator access to properties.
2477  using propimpl_range =
2478  llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>;
2479 
2482  }
2483 
2485  return propimpl_iterator(decls_begin());
2486  }
2487 
2489  return propimpl_iterator(decls_end());
2490  }
2491 
2492  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2493 
2494  static bool classofKind(Kind K) {
2495  return K >= firstObjCImpl && K <= lastObjCImpl;
2496  }
2497 };
2498 
2499 /// ObjCCategoryImplDecl - An object of this class encapsulates a category
2500 /// \@implementation declaration. If a category class has declaration of a
2501 /// property, its implementation must be specified in the category's
2502 /// \@implementation declaration. Example:
2503 /// \@interface I \@end
2504 /// \@interface I(CATEGORY)
2505 /// \@property int p1, d1;
2506 /// \@end
2507 /// \@implementation I(CATEGORY)
2508 /// \@dynamic p1,d1;
2509 /// \@end
2510 ///
2511 /// ObjCCategoryImplDecl
2513  // Category name location
2514  SourceLocation CategoryNameLoc;
2515 
2517  ObjCInterfaceDecl *classInterface,
2518  SourceLocation nameLoc, SourceLocation atStartLoc,
2519  SourceLocation CategoryNameLoc)
2520  : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id,
2521  nameLoc, atStartLoc),
2522  CategoryNameLoc(CategoryNameLoc) {}
2523 
2524  void anchor() override;
2525 
2526 public:
2527  friend class ASTDeclReader;
2528  friend class ASTDeclWriter;
2529 
2531  IdentifierInfo *Id,
2532  ObjCInterfaceDecl *classInterface,
2533  SourceLocation nameLoc,
2534  SourceLocation atStartLoc,
2535  SourceLocation CategoryNameLoc);
2537 
2539 
2540  SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
2541 
2542  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2543  static bool classofKind(Kind K) { return K == ObjCCategoryImpl;}
2544 };
2545 
2546 raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID);
2547 
2548 /// ObjCImplementationDecl - Represents a class definition - this is where
2549 /// method definitions are specified. For example:
2550 ///
2551 /// @code
2552 /// \@implementation MyClass
2553 /// - (void)myMethod { /* do something */ }
2554 /// \@end
2555 /// @endcode
2556 ///
2557 /// In a non-fragile runtime, instance variables can appear in the class
2558 /// interface, class extensions (nameless categories), and in the implementation
2559 /// itself, as well as being synthesized as backing storage for properties.
2560 ///
2561 /// In a fragile runtime, instance variables are specified in the class
2562 /// interface, \em not in the implementation. Nevertheless (for legacy reasons),
2563 /// we allow instance variables to be specified in the implementation. When
2564 /// specified, they need to be \em identical to the interface.
2566  /// Implementation Class's super class.
2567  ObjCInterfaceDecl *SuperClass;
2568  SourceLocation SuperLoc;
2569 
2570  /// \@implementation may have private ivars.
2571  SourceLocation IvarLBraceLoc;
2572  SourceLocation IvarRBraceLoc;
2573 
2574  /// Support for ivar initialization.
2575  /// The arguments used to initialize the ivars
2576  LazyCXXCtorInitializersPtr IvarInitializers;
2577  unsigned NumIvarInitializers = 0;
2578 
2579  /// Do the ivars of this class require initialization other than
2580  /// zero-initialization?
2581  bool HasNonZeroConstructors : 1;
2582 
2583  /// Do the ivars of this class require non-trivial destruction?
2584  bool HasDestructors : 1;
2585 
2587  ObjCInterfaceDecl *classInterface,
2588  ObjCInterfaceDecl *superDecl,
2589  SourceLocation nameLoc, SourceLocation atStartLoc,
2590  SourceLocation superLoc = SourceLocation(),
2591  SourceLocation IvarLBraceLoc=SourceLocation(),
2592  SourceLocation IvarRBraceLoc=SourceLocation())
2593  : ObjCImplDecl(ObjCImplementation, DC, classInterface,
2594  classInterface ? classInterface->getIdentifier()
2595  : nullptr,
2596  nameLoc, atStartLoc),
2597  SuperClass(superDecl), SuperLoc(superLoc),
2598  IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2599  HasNonZeroConstructors(false), HasDestructors(false) {}
2600 
2601  void anchor() override;
2602 
2603 public:
2604  friend class ASTDeclReader;
2605  friend class ASTDeclWriter;
2606 
2608  ObjCInterfaceDecl *classInterface,
2609  ObjCInterfaceDecl *superDecl,
2610  SourceLocation nameLoc,
2611  SourceLocation atStartLoc,
2612  SourceLocation superLoc = SourceLocation(),
2613  SourceLocation IvarLBraceLoc=SourceLocation(),
2614  SourceLocation IvarRBraceLoc=SourceLocation());
2615 
2617 
2618  /// init_iterator - Iterates through the ivar initializer list.
2620 
2621  /// init_const_iterator - Iterates through the ivar initializer list.
2623 
2624  using init_range = llvm::iterator_range<init_iterator>;
2625  using init_const_range = llvm::iterator_range<init_const_iterator>;
2626 
2628 
2630  return init_const_range(init_begin(), init_end());
2631  }
2632 
2633  /// init_begin() - Retrieve an iterator to the first initializer.
2635  const auto *ConstThis = this;
2636  return const_cast<init_iterator>(ConstThis->init_begin());
2637  }
2638 
2639  /// begin() - Retrieve an iterator to the first initializer.
2641 
2642  /// init_end() - Retrieve an iterator past the last initializer.
2644  return init_begin() + NumIvarInitializers;
2645  }
2646 
2647  /// end() - Retrieve an iterator past the last initializer.
2649  return init_begin() + NumIvarInitializers;
2650  }
2651 
2652  /// getNumArgs - Number of ivars which must be initialized.
2653  unsigned getNumIvarInitializers() const {
2654  return NumIvarInitializers;
2655  }
2656 
2657  void setNumIvarInitializers(unsigned numNumIvarInitializers) {
2658  NumIvarInitializers = numNumIvarInitializers;
2659  }
2660 
2662  CXXCtorInitializer ** initializers,
2663  unsigned numInitializers);
2664 
2665  /// Do any of the ivars of this class (not counting its base classes)
2666  /// require construction other than zero-initialization?
2667  bool hasNonZeroConstructors() const { return HasNonZeroConstructors; }
2668  void setHasNonZeroConstructors(bool val) { HasNonZeroConstructors = val; }
2669 
2670  /// Do any of the ivars of this class (not counting its base classes)
2671  /// require non-trivial destruction?
2672  bool hasDestructors() const { return HasDestructors; }
2673  void setHasDestructors(bool val) { HasDestructors = val; }
2674 
2675  /// getIdentifier - Get the identifier that names the class
2676  /// interface associated with this implementation.
2678  return getClassInterface()->getIdentifier();
2679  }
2680 
2681  /// getName - Get the name of identifier for the class interface associated
2682  /// with this implementation as a StringRef.
2683  //
2684  // FIXME: This is a bad API, we are hiding NamedDecl::getName with a different
2685  // meaning.
2686  StringRef getName() const {
2687  assert(getIdentifier() && "Name is not a simple identifier");
2688  return getIdentifier()->getName();
2689  }
2690 
2691  /// Get the name of the class associated with this interface.
2692  //
2693  // FIXME: Move to StringRef API.
2695 
2696  /// Produce a name to be used for class's metadata. It comes either via
2697  /// class's objc_runtime_name attribute or class name.
2698  StringRef getObjCRuntimeNameAsString() const;
2699 
2700  const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
2701  ObjCInterfaceDecl *getSuperClass() { return SuperClass; }
2702  SourceLocation getSuperClassLoc() const { return SuperLoc; }
2703 
2704  void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }
2705 
2706  void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
2707  SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
2708  void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
2709  SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
2710 
2712  using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2713 
2714  ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
2715 
2717  return ivar_iterator(decls_begin());
2718  }
2719 
2721  return ivar_iterator(decls_end());
2722  }
2723 
2724  unsigned ivar_size() const {
2725  return std::distance(ivar_begin(), ivar_end());
2726  }
2727 
2728  bool ivar_empty() const {
2729  return ivar_begin() == ivar_end();
2730  }
2731 
2732  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2733  static bool classofKind(Kind K) { return K == ObjCImplementation; }
2734 };
2735 
2736 raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID);
2737 
2738 /// ObjCCompatibleAliasDecl - Represents alias of a class. This alias is
2739 /// declared as \@compatibility_alias alias class.
2741  /// Class that this is an alias of.
2742  ObjCInterfaceDecl *AliasedClass;
2743 
2745  ObjCInterfaceDecl* aliasedClass)
2746  : NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2747 
2748  void anchor() override;
2749 
2750 public:
2753  ObjCInterfaceDecl* aliasedClass);
2754 
2756  unsigned ID);
2757 
2758  const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; }
2759  ObjCInterfaceDecl *getClassInterface() { return AliasedClass; }
2760  void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; }
2761 
2762  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2763  static bool classofKind(Kind K) { return K == ObjCCompatibleAlias; }
2764 };
2765 
2766 /// ObjCPropertyImplDecl - Represents implementation declaration of a property
2767 /// in a class or category implementation block. For example:
2768 /// \@synthesize prop1 = ivar1;
2769 ///
2770 class ObjCPropertyImplDecl : public Decl {
2771 public:
2772  enum Kind {
2775  };
2776 
2777 private:
2778  SourceLocation AtLoc; // location of \@synthesize or \@dynamic
2779 
2780  /// For \@synthesize, the location of the ivar, if it was written in
2781  /// the source code.
2782  ///
2783  /// \code
2784  /// \@synthesize int a = b
2785  /// \endcode
2786  SourceLocation IvarLoc;
2787 
2788  /// Property declaration being implemented
2789  ObjCPropertyDecl *PropertyDecl;
2790 
2791  /// Null for \@dynamic. Required for \@synthesize.
2792  ObjCIvarDecl *PropertyIvarDecl;
2793 
2794  /// The getter's definition, which has an empty body if synthesized.
2795  ObjCMethodDecl *GetterMethodDecl = nullptr;
2796  /// The getter's definition, which has an empty body if synthesized.
2797  ObjCMethodDecl *SetterMethodDecl = nullptr;
2798 
2799  /// Null for \@dynamic. Non-null if property must be copy-constructed in
2800  /// getter.
2801  Expr *GetterCXXConstructor = nullptr;
2802 
2803  /// Null for \@dynamic. Non-null if property has assignment operator to call
2804  /// in Setter synthesis.
2805  Expr *SetterCXXAssignment = nullptr;
2806 
2808  ObjCPropertyDecl *property,
2809  Kind PK,
2810  ObjCIvarDecl *ivarDecl,
2811  SourceLocation ivarLoc)
2812  : Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2813  IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2814  assert(PK == Dynamic || PropertyIvarDecl);
2815  }
2816 
2817 public:
2818  friend class ASTDeclReader;
2819 
2821  SourceLocation atLoc, SourceLocation L,
2822  ObjCPropertyDecl *property,
2823  Kind PK,
2824  ObjCIvarDecl *ivarDecl,
2825  SourceLocation ivarLoc);
2826 
2828 
2829  SourceRange getSourceRange() const override LLVM_READONLY;
2830 
2831  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
2832  void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
2833 
2835  return PropertyDecl;
2836  }
2837  void setPropertyDecl(ObjCPropertyDecl *Prop) { PropertyDecl = Prop; }
2838 
2840  return PropertyIvarDecl ? Synthesize : Dynamic;
2841  }
2842 
2844  return PropertyIvarDecl;
2845  }
2846  SourceLocation getPropertyIvarDeclLoc() const { return IvarLoc; }
2847 
2849  SourceLocation IvarLoc) {
2850  PropertyIvarDecl = Ivar;
2851  this->IvarLoc = IvarLoc;
2852  }
2853 
2854  /// For \@synthesize, returns true if an ivar name was explicitly
2855  /// specified.
2856  ///
2857  /// \code
2858  /// \@synthesize int a = b; // true
2859  /// \@synthesize int a; // false
2860  /// \endcode
2861  bool isIvarNameSpecified() const {
2862  return IvarLoc.isValid() && IvarLoc != getLocation();
2863  }
2864 
2865  ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; }
2866  void setGetterMethodDecl(ObjCMethodDecl *MD) { GetterMethodDecl = MD; }
2867 
2868  ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; }
2869  void setSetterMethodDecl(ObjCMethodDecl *MD) { SetterMethodDecl = MD; }
2870 
2872  return GetterCXXConstructor;
2873  }
2874 
2875  void setGetterCXXConstructor(Expr *getterCXXConstructor) {
2876  GetterCXXConstructor = getterCXXConstructor;
2877  }
2878 
2880  return SetterCXXAssignment;
2881  }
2882 
2883  void setSetterCXXAssignment(Expr *setterCXXAssignment) {
2884  SetterCXXAssignment = setterCXXAssignment;
2885  }
2886 
2887  static bool classof(const Decl *D) { return classofKind(D->getKind()); }
2888  static bool classofKind(Decl::Kind K) { return K == ObjCPropertyImpl; }
2889 };
2890 
2891 template<bool (*Filter)(ObjCCategoryDecl *)>
2892 void
2893 ObjCInterfaceDecl::filtered_category_iterator<Filter>::
2894 findAcceptableCategory() {
2895  while (Current && !Filter(Current))
2896  Current = Current->getNextClassCategoryRaw();
2897 }
2898 
2899 template<bool (*Filter)(ObjCCategoryDecl *)>
2900 inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2902  Current = Current->getNextClassCategoryRaw();
2903  findAcceptableCategory();
2904  return *this;
2905 }
2906 
2907 inline bool ObjCInterfaceDecl::isVisibleCategory(ObjCCategoryDecl *Cat) {
2908  return !Cat->isInvalidDecl() && Cat->isUnconditionallyVisible();
2909 }
2910 
2911 inline bool ObjCInterfaceDecl::isVisibleExtension(ObjCCategoryDecl *Cat) {
2912  return !Cat->isInvalidDecl() && Cat->IsClassExtension() &&
2913  Cat->isUnconditionallyVisible();
2914 }
2915 
2916 inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2917  return !Cat->isInvalidDecl() && Cat->IsClassExtension();
2918 }
2919 
2920 } // namespace clang
2921 
2922 #endif // LLVM_CLANG_AST_DECLOBJC_H
clang::Decl::setLexicalDeclContext
void setLexicalDeclContext(DeclContext *DC)
Definition: DeclBase.cpp:340
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:2387
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:641
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:2704
clang::ObjCPropertyDecl::isReadOnly
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
Definition: DeclObjC.h:833
clang::ObjCListBase::ObjCListBase
ObjCListBase()=default
clang::ObjCInterfaceDecl::CreateDeserialized
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1521
clang::ObjCPropertyImplDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2843
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:2740
clang::ObjCContainerDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1109
clang::ObjCProtocolDecl::lookupClassMethod
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Definition: DeclObjC.h:2197
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:2350
clang::DeclContext::decls_end
decl_iterator decls_end() const
Definition: DeclBase.h:2180
clang::ObjCMethodDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:544
clang::ObjCMethodDecl::castFromDeclContext
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
Definition: DeclObjC.h:550
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:936
clang::ObjCProtocolDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2125
clang::ObjCContainerDecl::instmeth_range
llvm::iterator_range< instmeth_iterator > instmeth_range
Definition: DeclObjC.h:1026
clang::Type::isBlockPointerType
bool isBlockPointerType() const
Definition: Type.h:6891
clang::ObjCPropertyImplDecl::setPropertyIvarDecl
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Definition: DeclObjC.h:2848
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:2686
Specifiers.h
clang::ObjCMethodDecl::castToDeclContext
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
Definition: DeclObjC.h:546
clang::ObjCInterfaceDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:1291
clang::ObjCProtocolDecl::getODRHash
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
Definition: DeclObjC.cpp:2053
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::DeclContext::specific_decl_iterator
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
Definition: DeclBase.h:2198
clang::ObjCMethodDecl::param_const_range
llvm::iterator_range< param_const_iterator > param_const_range
Definition: DeclObjC.h:355
clang::ObjCContainerDecl::getProperty
ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const
Definition: DeclObjC.cpp:236
clang::ObjCPropertyDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:923
clang::ObjCIvarDecl::None
@ None
Definition: DeclObjC.h:1925
clang::ObjCInterfaceDecl::setTypeForDecl
void setTypeForDecl(const Type *TD) const
Definition: DeclObjC.h:1895
clang::ObjCInterfaceDecl::setHasDesignatedInitializers
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
Definition: DeclObjC.cpp:1564
clang::ObjCPropertyDecl::setPropertyAttributesAsWritten
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
Definition: DeclObjC.h:826
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:690
clang::ObjCImplementationDecl::init_end
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Definition: DeclObjC.h:2643
clang::ObjCMethodDecl::setPropertyAccessor
void setPropertyAccessor(bool isAccessor)
Definition: DeclObjC.h:444
clang::SourceRange
A trivial tuple used to represent a source range.
Definition: SourceLocation.h:210
clang::DeclContext::ObjCContainerDeclBits
ObjCContainerDeclBitfields ObjCContainerDeclBits
Definition: DeclBase.h:1863
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:697
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1389
clang::ObjCIvarDecl::getNextIvar
ObjCIvarDecl * getNextIvar()
Definition: DeclObjC.h:1956
clang::Redeclarable
Provides common interface for the Decls that can be redeclared.
Definition: Redeclarable.h:84
clang::ObjCPropertyImplDecl::getSetterCXXAssignment
Expr * getSetterCXXAssignment() const
Definition: DeclObjC.h:2879
clang::ObjCPropertyDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:896
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:2622
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2565
clang::ObjCMethodDecl::param_type_end
param_type_iterator param_type_end() const
Definition: DeclObjC.h:407
clang::ObjCContainerDecl::method_range
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
Definition: DeclObjC.h:1009
clang::ObjCIvarDecl::getCanonicalDecl
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
Definition: DeclObjC.h:1960
clang::ObjCMethodDecl::getSelfType
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
Definition: DeclObjC.cpp:1108
clang::ObjCTypeParamVariance::Invariant
@ Invariant
The parameter is invariant: must match exactly.
clang::ObjCProtocolDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:2129
clang::ObjCContainerDecl::instprop_iterator
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
Definition: DeclObjC.h:974
clang::Redeclarable< ObjCInterfaceDecl >::redecls_begin
redecl_iterator redecls_begin() const
Definition: Redeclarable.h:302
clang::ObjCIvarDecl::Protected
@ Protected
Definition: DeclObjC.h:1925
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:1494
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:2478
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:2634
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:1556
clang::ObjCInterfaceDecl::filtered_category_iterator::operator++
filtered_category_iterator & operator++()
Definition: DeclObjC.h:2901
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::ObjCImplementationDecl::setHasNonZeroConstructors
void setHasNonZeroConstructors(bool val)
Definition: DeclObjC.h:2668
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:1571
clang::ObjCInterfaceDecl::setEndOfDefinitionLoc
void setEndOfDefinitionLoc(SourceLocation LE)
Definition: DeclObjC.h:1860
clang::ObjCProtocolDecl::protocol_loc_iterator
ObjCProtocolList::loc_iterator protocol_loc_iterator
Definition: DeclObjC.h:2143
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:247
clang::ObjCInterfaceDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h: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:543
clang::ObjCImplementationDecl::inits
init_const_range inits() const
Definition: DeclObjC.h:2629
clang::ObjCPropertyDecl::setSetterMethodDecl
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
Definition: DeclObjC.h:900
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:737
clang::ObjCPropertyDecl::isClassProperty
bool isClassProperty() const
Definition: DeclObjC.h:850
clang::ObjCProtocolDecl::Create
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
Definition: DeclObjC.cpp:1910
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:424
clang::Selector::isUnarySelector
bool isUnarySelector() const
Definition: IdentifierTable.h:836
clang::Redeclarable< ObjCInterfaceDecl >::redecls_end
redecl_iterator redecls_end() const
Definition: Redeclarable.h:303
clang::ObjCMethodDecl::getParamDecl
const ParmVarDecl * getParamDecl(unsigned Idx) const
Definition: DeclObjC.h:385
AttributeLangSupport::C
@ C
Definition: SemaDeclAttr.cpp:56
clang::ObjCImplementationDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:2714
clang::ObjCCategoryDecl::protocol_begin
protocol_iterator protocol_begin() const
Definition: DeclObjC.h:2373
clang::SelLoc_NonStandard
@ SelLoc_NonStandard
Non-standard.
Definition: SelectorLocationsKind.h:29
clang::tooling::Filter
llvm::cl::opt< std::string > Filter
clang::ObjCIvarDecl::getAccessControl
AccessControl getAccessControl() const
Definition: DeclObjC.h:1969
clang::ObjCInterfaceDecl::lookupClassMethod
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
Definition: DeclObjC.h:1827
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2930
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:1010
clang::ObjCTypeParamDecl::getVariance
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:624
clang::ObjCPropertyDecl::isInstanceProperty
bool isInstanceProperty() const
Definition: DeclObjC.h:849
clang::ObjCImplementationDecl::setNumIvarInitializers
void setNumIvarInitializers(unsigned numNumIvarInitializers)
Definition: DeclObjC.h:2657
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:1036
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1712
clang::ObjCPropertyDecl::isOptional
bool isOptional() const
Definition: DeclObjC.h:911
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:1028
clang::ObjCProtocolDecl::getCanonicalDecl
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
Definition: DeclObjC.h:2261
clang::ObjCPropertyImplDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:2865
clang::ObjCCategoryDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2338
clang::ObjCMethodDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.cpp:1174
clang::ObjCContainerDecl::instmeth_iterator
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
Definition: DeclObjC.h:1025
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:2677
clang::ObjCPropertyDecl::isDirectProperty
bool isDirectProperty() const
Definition: DeclObjC.cpp:2355
clang::ObjCCategoryDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:2406
clang::ObjCProtocolDecl::protocol_loc_begin
protocol_loc_iterator protocol_loc_begin() const
Definition: DeclObjC.h:2150
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
clang::ObjCPropertyImplDecl
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2770
llvm::Optional
Definition: LLVM.h:40
clang::ObjCCategoryDecl::IsClassExtension
bool IsClassExtension() const
Definition: DeclObjC.h:2403
clang::ObjCImplementationDecl::setHasDestructors
void setHasDestructors(bool val)
Definition: DeclObjC.h:2673
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:125
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:814
clang::ObjCContainerDecl::ProtocolPropertySet
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
Definition: DeclObjC.h:1083
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:2320
clang::ObjCPropertyImplDecl::getPropertyIvarDeclLoc
SourceLocation getPropertyIvarDeclLoc() const
Definition: DeclObjC.h:2846
clang::ObjCContainerDecl::classprop_iterator
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator
Definition: DeclObjC.h:991
clang::ObjCCategoryDecl::setIvarLBraceLoc
void setIvarLBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2429
clang::ObjCCompatibleAliasDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2762
clang::ObjCProtocolList::loc_iterator
const SourceLocation * loc_iterator
Definition: DeclObjC.h:110
clang::ObjCPropertyDecl::getPropertyImplementation
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:907
clang::ObjCContainerDecl::classmeth_iterator
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
Definition: DeclObjC.h:1042
clang::DeclContext::ObjCMethodDeclBits
ObjCMethodDeclBitfields ObjCMethodDeclBits
Definition: DeclBase.h:1862
clang::ObjCIvarDecl::Public
@ Public
Definition: DeclObjC.h:1925
clang::ObjCMethodDecl::isThisDeclarationADesignatedInitializer
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
Definition: DeclObjC.cpp:839
clang::ObjCCategoryDecl::getNextClassCategory
ObjCCategoryDecl * getNextClassCategory() const
Definition: DeclObjC.h:2395
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:816
clang::ObjCProtocolDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:2136
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:466
clang::ObjCMethodDecl::getNumSelectorLocs
unsigned getNumSelectorLocs() const
Definition: DeclObjC.h:309
clang::ObjCImplDecl::propimpl_end
propimpl_iterator propimpl_end() const
Definition: DeclObjC.h:2488
clang::ObjCContainerDecl::instprop_range
llvm::iterator_range< instprop_iterator > instprop_range
Definition: DeclObjC.h:975
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:2453
clang::ObjCTypeParamDecl::getVarianceLoc
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
Definition: DeclObjC.h:634
clang::ObjCCategoryDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:2422
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:1002
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1565
clang::ObjCTypeParamDecl::getColonLoc
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
Definition: DeclObjC.h:645
clang::ObjCMethodDecl::createImplicitParams
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
Definition: DeclObjC.cpp:1153
clang::ObjCTypeParamList::getSourceRange
SourceRange getSourceRange() const
Definition: DeclObjC.h:712
clang::ObjCIvarDecl::AccessControl
AccessControl
Definition: DeclObjC.h:1924
Decl.h
clang::ObjCImplementationDecl::setIvarInitializers
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
Definition: DeclObjC.cpp:2282
clang::ObjCTypeParamList::getLAngleLoc
SourceLocation getLAngleLoc() const
Definition: DeclObjC.h:710
clang::ObjCObjectType
Represents a class type in Objective C.
Definition: Type.h:6014
clang::Redeclarable< ObjCInterfaceDecl >::redecl_range
llvm::iterator_range< redecl_iterator > redecl_range
Definition: Redeclarable.h:292
Offset
unsigned Offset
Definition: Format.cpp:2717
clang::ObjCIvarDecl::getContainingInterface
ObjCInterfaceDecl * getContainingInterface()
Return the class interface that this ivar is logically contained in; this is either the interface whe...
Definition: DeclObjC.cpp:1844
clang::ObjCList::end
iterator end() const
Definition: DeclObjC.h:92
clang::ObjCImplementationDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:2716
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:2141
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:1436
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:1194
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:533
clang::ObjCInterfaceDecl::getDesignatedInitializers
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
Definition: DeclObjC.cpp:550
clang::ObjCPropertyImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2887
clang::ObjCTypeParamDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:649
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:678
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:2025
clang::ObjCPropertyAttribute::kind_copy
@ kind_copy
Definition: DeclObjCCommon.h:29
clang::ObjCImplementationDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2733
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:2868
clang::ObjCProtocolDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2164
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:444
clang::ObjCMethodDecl::setMethodParams
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=std::nullopt)
Sets the method's parameters and selector source locations.
Definition: DeclObjC.cpp:907
clang::ObjCInterfaceDecl::lookupInstanceMethod
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
Definition: DeclObjC.h:1822
clang::Decl::Kind
Kind
Lists the kind of concrete classes of Decl.
Definition: DeclBase.h:86
clang::ObjCMethodDecl::setSelfDecl
void setSelfDecl(ImplicitParamDecl *SD)
Definition: DeclObjC.h:423
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:490
clang::ObjCPropertyImplDecl::setGetterCXXConstructor
void setGetterCXXConstructor(Expr *getterCXXConstructor)
Definition: DeclObjC.h:2875
clang::CompoundStmt
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1410
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:838
clang::ObjCProtocolDecl::collectPropertiesToImplement
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
Definition: DeclObjC.cpp:2011
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:903
clang::ObjCContainerDecl::prop_iterator
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
Definition: DeclObjC.h:958
clang::ObjCCategoryDecl::ivar_end
ivar_iterator ivar_end() const
Definition: DeclObjC.h:2414
clang::ObjCImplementationDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Definition: DeclObjC.h:2702
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:435
clang::ObjCInterfaceDecl::getImplementation
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1598
clang::ObjCMethodDecl::isDefined
bool isDefined() const
Definition: DeclObjC.h:456
clang::ObjCProtocolDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.h:2243
clang::ObjCInterfaceDecl::getCanonicalDecl
const ObjCInterfaceDecl * getCanonicalDecl() const
Definition: DeclObjC.h:1891
Id
int Id
Definition: ASTDiff.cpp:189
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:2169
clang::ObjCIvarDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1983
clang::ObjCInterfaceDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:1339
hlsl::uint64_t
unsigned long uint64_t
Definition: hlsl_basic_types.h:25
clang::ObjCCategoryDecl::ivars
ivar_range ivars() const
Definition: DeclObjC.h:2408
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:46
clang::interp::LE
bool LE(InterpState &S, CodePtr OpPC)
Definition: Interp.h:504
clang::ObjCContainerDecl::classprop_range
llvm::iterator_range< classprop_iterator > classprop_range
Definition: DeclObjC.h:992
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:2364
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:1757
clang::Decl::ObjCDeclQualifier
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Definition: DeclBase.h:195
clang::ObjCTypeParamList::end
const_iterator end() const
Definition: DeclObjC.h:696
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:2672
clang::ObjCIvarDecl::getCanonicalDecl
const ObjCIvarDecl * getCanonicalDecl() const
Definition: DeclObjC.h:1963
clang::ObjCPropertyImplDecl::Synthesize
@ Synthesize
Definition: DeclObjC.h:2773
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:1016
clang::ObjCTypeParamList::back
ObjCTypeParamDecl * back() const
Definition: DeclObjC.h:705
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:182
clang::ObjCInterfaceDecl::lookupPrivateMethod
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
Definition: DeclObjC.cpp:747
clang::ObjCListBase
Definition: DeclObjC.h:60
clang::ObjCMethodDecl::setDeclImplementation
void setDeclImplementation(ImplementationControl ic)
Definition: DeclObjC.h:500
clang::ObjCPropertyDecl::getSetterMethodDecl
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:899
clang::ObjCPropertyDecl::Assign
@ Assign
Definition: DeclObjC.h:735
clang::Selector::getNumArgs
unsigned getNumArgs() const
Definition: IdentifierTable.cpp:563
clang::ObjCCompatibleAliasDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2759
clang::ObjCContainerDecl::collectPropertiesToImplement
virtual void collectPropertiesToImplement(PropertyMap &PM) const
This routine collects list of properties to be implemented in the class.
Definition: DeclObjC.h:1089
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:2173
clang::ObjCProtocolDecl::startDefinition
void startDefinition()
Starts the definition of this Objective-C protocol.
Definition: DeclObjC.cpp:1992
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:1011
clang::ObjCMethodDecl::setHasSkippedBody
void setHasSkippedBody(bool Skipped=true)
Definition: DeclObjC.h:482
clang::ObjCProtocolDecl::getCanonicalDecl
const ObjCProtocolDecl * getCanonicalDecl() const
Definition: DeclObjC.h:2262
clang::Decl::isInvalidDecl
bool isInvalidDecl() const
Definition: DeclBase.h:571
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:2484
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:888
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:2132
clang::ObjCImplementationDecl::getSuperClass
ObjCInterfaceDecl * getSuperClass()
Definition: DeclObjC.h:2701
clang::ObjCInterfaceDecl::lookupInstanceVariable
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
Definition: DeclObjC.cpp:628
clang::ObjCPropertyQueryKind::OBJC_PR_query_class
@ OBJC_PR_query_class
clang::ObjCCompatibleAliasDecl::setClassInterface
void setClassInterface(ObjCInterfaceDecl *D)
Definition: DeclObjC.h:2760
clang::ObjCPropertyImplDecl::getGetterCXXConstructor
Expr * getGetterCXXConstructor() const
Definition: DeclObjC.h:2871
clang::ObjCImplementationDecl::init_const_range
llvm::iterator_range< init_const_iterator > init_const_range
Definition: DeclObjC.h:2625
clang::ObjCIvarDecl::getNextIvar
const ObjCIvarDecl * getNextIvar() const
Definition: DeclObjC.h:1957
clang::ObjCMethodDecl::CreateDeserialized
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:829
clang::ObjCMethodDecl::isDirectMethod
bool isDirectMethod() const
True if the method is tagged as objc_direct.
Definition: DeclObjC.cpp:834
clang::ObjCTypeParamList::begin
const_iterator begin() const
Definition: DeclObjC.h:692
clang::ObjCContainerDecl::class_properties
classprop_range class_properties() const
Definition: DeclObjC.h:994
clang::ObjCMethodDecl::getSelectorStartLoc
SourceLocation getSelectorStartLoc() const
Definition: DeclObjC.h:291
clang::ObjCCategoryDecl::setImplementation
void setImplementation(ObjCCategoryImplDecl *ImplD)
Definition: DeclObjC.cpp:2137
clang::ObjCMethodDecl::getSelfDecl
ImplicitParamDecl * getSelfDecl() const
Definition: DeclObjC.h:422
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:1844
clang::ObjCAtDefsFieldDecl::CreateDeserialized
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1886
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:2434
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:1590
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:531
clang::ObjCIvarDecl::getSynthesize
bool getSynthesize() const
Definition: DeclObjC.h:1976
clang::ObjCInterfaceDecl::getTypeParamList
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
Definition: DeclObjC.cpp:322
IdentifierTable.h
clang::ObjCImplDecl::addPropertyImplementation
void addPropertyImplementation(ObjCPropertyImplDecl *property)
Definition: DeclObjC.cpp:2185
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:457
Type.h
clang::ImplicitParamDecl
Definition: Decl.h:1645
clang::ObjCMethodDecl::setAsRedeclaration
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
Definition: DeclObjC.cpp:876
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:1460
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:296
clang::ObjCContainerDecl::castToDeclContext
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
Definition: DeclObjC.h:1114
clang::ObjCCategoryDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2339
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:481
clang::ObjCMethodDecl::setBody
void setBody(Stmt *B)
Definition: DeclObjC.h:534
clang::ObjCIvarDecl::getContainingInterface
const ObjCInterfaceDecl * getContainingInterface() const
Definition: DeclObjC.h:1952
clang::ObjCMethodDecl::getReturnType
QualType getReturnType() const
Definition: DeclObjC.h:332
clang::ObjCProtocolDecl::lookupProtocolNamed
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
Definition: DeclObjC.cpp:1951
clang::ObjCProtocolDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:2157
clang::ObjCIvarDecl::Private
@ Private
Definition: DeclObjC.h:1925
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:343
clang::ObjCTypeParamVariance
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
Definition: DeclObjC.h:556
clang::ObjCCategoryImplDecl
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2512
clang::ObjCImplDecl::addInstanceMethod
void addInstanceMethod(ObjCMethodDecl *method)
Definition: DeclObjC.h:2457
llvm::DenseSet
Definition: Sema.h:77
clang::ObjCProtocolDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2273
clang::ObjCContainerDecl::ObjCContainerDecl
ObjCContainerDecl(Kind DK, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
Definition: DeclObjC.cpp:69
clang::ObjCPropertyDecl::overwritePropertyAttributes
void overwritePropertyAttributes(unsigned PRVal)
Definition: DeclObjC.h:818
clang::ObjCMethodDecl::getSelectorLocs
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
Definition: DeclObjC.cpp:901
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:2144
clang::ObjCPropertyAttribute::kind_readonly
@ kind_readonly
Definition: DeclObjCCommon.h:24
clang::ObjCImplementationDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2732
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:81
clang::ObjCMethodDecl::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: DeclObjC.cpp:1010
clang::ObjCAtDefsFieldDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2017
clang::ObjCContainerDecl::instmeth_begin
instmeth_iterator instmeth_begin() const
Definition: DeclObjC.h:1032
clang::ObjCInterfaceDecl::getCategoryClassMethod
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
Definition: DeclObjC.cpp:1744
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:2706
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:2381
clang::ObjCImplementationDecl::init_range
llvm::iterator_range< init_iterator > init_range
Definition: DeclObjC.h:2624
clang::ObjCPropertyDecl::getType
QualType getType() const
Definition: DeclObjC.h:799
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:2445
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:2977
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:13391
clang::ObjCMethodDecl::setVariadic
void setVariadic(bool isVar)
Definition: DeclObjC.h:436
clang::ObjCImplementationDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2707
clang::ObjCContainerDecl::properties
prop_range properties() const
Definition: DeclObjC.h:962
clang::ObjCPropertyDecl::setSetterName
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
Definition: DeclObjC.h:891
clang::ObjCMethodDecl::getCanonicalDecl
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclObjC.cpp:975
clang::ObjCTypeParamDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:648
clang::ObjCCategoryImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2542
clang::ObjCCategoryDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:2405
clang::ObjCTypeParamList::begin
iterator begin()
Definition: DeclObjC.h:682
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:792
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:576
clang::ObjCContainerDecl::prop_range
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
Definition: DeclObjC.h:960
clang::ObjCImplementationDecl::getSuperClass
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2700
clang::ObjCProtocolDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:2123
clang::LazyOffsetPtr::isValid
bool isValid() const
Whether this pointer is non-NULL.
Definition: ExternalASTSource.h:364
clang::ODRHash
Definition: ODRHash.h:41
clang::ObjCInterfaceDecl::lookupInstanceVariable
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
Definition: DeclObjC.h:1807
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:2046
clang::ObjCInterfaceDecl::lookupInheritedClass
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
Definition: DeclObjC.cpp:659
clang::ObjCCategoryDecl
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2293
clang::ObjCMethodDecl::param_end
param_iterator param_end()
Definition: DeclObjC.h:366
clang::ObjCContainerDecl::classprop_begin
classprop_iterator classprop_begin() const
Definition: DeclObjC.h:998
clang::ObjCPropertyDecl::getSetterKind
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
Definition: DeclObjC.h:868
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:434
clang::ObjCImplementationDecl::CreateDeserialized
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2277
clang::ObjCPropertyDecl::Copy
@ Copy
Definition: DeclObjC.h:735
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:2694
clang::Type::castAs
const T * castAs() const
Member-template castAs<specific type>.
Definition: Type.h:7453
clang::ObjCListBase::size
unsigned size() const
Definition: DeclObjC.h:71
clang::ObjCMethodDecl::getObjCDeclQualifier
ObjCDeclQualifier getObjCDeclQualifier() const
Definition: DeclObjC.h:249
clang::ObjCProtocolDecl::mergeDuplicateDefinitionWithCommon
void mergeDuplicateDefinitionWithCommon(const ObjCProtocolDecl *Definition)
Definition: DeclObjC.cpp:2006
clang::NamedDecl::NamedDecl
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
Definition: Decl.h:259
clang::ObjCProtocolDecl::lookupInstanceMethod
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Definition: DeclObjC.h:2193
clang::ObjCImplementationDecl::inits
init_range inits()
Definition: DeclObjC.h:2627
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:1880
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:2261
SourceLocation.h
clang::ObjCCategoryImplDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2540
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:2480
P
StringRef P
Definition: ASTMatchersInternal.cpp:564
clang::ObjCInterfaceDecl::getCategoryInstanceMethod
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
Definition: DeclObjC.cpp:1734
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:1323
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:2210
clang::ObjCPropertyDecl::getDefaultSynthIvarName
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
Definition: DeclObjC.cpp:227
clang::ObjCPropertyQueryKind::OBJC_PR_query_unknown
@ OBJC_PR_query_unknown
clang::ObjCPropertyImplDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: DeclObjC.h:2831
clang::ObjCCategoryDecl::ivar_begin
ivar_iterator ivar_begin() const
Definition: DeclObjC.h:2410
SelectorLocationsKind.h
clang::ObjCContainerDecl::prop_end
prop_iterator prop_end() const
Definition: DeclObjC.h:968
clang::ObjCImplDecl::propimpl_iterator
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
Definition: DeclObjC.h:2476
clang::ObjCCategoryDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:2383
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:1049
clang::ObjCContainerDecl::meth_begin
method_iterator meth_begin() const
Definition: DeclObjC.h:1015
false
#define false
Definition: stdbool.h:22
clang::ObjCMethodDecl::GetTypeFn
Definition: DeclObjC.h:396
clang::ObjCPropertyAttribute::kind_noattr
@ kind_noattr
Definition: DeclObjCCommon.h:23
clang::ObjCTypeParamList::end
iterator end()
Definition: DeclObjC.h:684
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:268
clang::ObjCMethodDecl::setRelatedResultType
void setRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
Definition: DeclObjC.h:264
clang::DeclContext::addDecl
void addDecl(Decl *D)
Add the declaration D into this context.
Definition: DeclBase.cpp:1607
clang::ObjCInterfaceDecl::filtered_category_iterator::iterator_category
std::input_iterator_tag iterator_category
Definition: DeclObjC.h:1584
clang::ObjCImplDecl
Definition: DeclObjC.h:2438
clang::ObjCInterfaceDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:1340
clang::ObjCPropertyDecl::getLParenLoc
SourceLocation getLParenLoc() const
Definition: DeclObjC.h:794
clang::ObjCPropertyDecl::CreateDeserialized
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2343
clang::ObjCCategoryDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2369
clang::ObjCCompatibleAliasDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2758
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:700
clang::ObjCInterfaceDecl::getSuperClassType
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
Definition: DeclObjC.h:1541
clang::ObjCMethodDecl::isSynthesizedAccessorStub
bool isSynthesizedAccessorStub() const
Definition: DeclObjC.h:448
clang::ObjCPropertyDecl::None
@ None
Definition: DeclObjC.h:736
llvm::ArrayRef
Definition: LLVM.h:34
clang::ObjCImplDecl::addClassMethod
void addClassMethod(ObjCMethodDecl *method)
Definition: DeclObjC.h:2463
clang::ObjCContainerDecl::instprop_begin
instprop_iterator instprop_begin() const
Definition: DeclObjC.h:981
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::ObjCCompatibleAliasDecl::Create
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
Definition: DeclObjC.cpp:2312
clang::ObjCPropertyDecl::SetterKind
SetterKind
Definition: DeclObjC.h:735
clang::ObjCPropertyQueryKind
ObjCPropertyQueryKind
Definition: DeclObjC.h:719
clang::ObjCPropertyDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:919
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:731
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:2431
clang::ObjCIvarDecl::getCanonicalAccessControl
AccessControl getCanonicalAccessControl() const
Definition: DeclObjC.h:1971
clang::ObjCMethodDecl::isInstanceMethod
bool isInstanceMethod() const
Definition: DeclObjC.h:430
clang::ObjCPropertyDecl::setType
void setType(QualType T, TypeSourceInfo *TSI)
Definition: DeclObjC.h:801
clang::ObjCInterfaceDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:1431
clang::ObjCCategoryImplDecl::getCategoryDecl
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2176
clang::ObjCContainerDecl::getMethod
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
Definition: DeclObjC.cpp:93
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:844
clang::ObjCInterfaceDecl::lookupPrivateClassMethod
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
Definition: DeclObjC.h:1837
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:687
clang::ObjCMethodDecl::getSelectorLoc
SourceLocation getSelectorLoc(unsigned Index) const
Definition: DeclObjC.h:297
LLVM.h
clang::ObjCPropertyDecl::getGetterNameLoc
SourceLocation getGetterNameLoc() const
Definition: DeclObjC.h:881
clang::ObjCPropertyDecl::setGetterName
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
Definition: DeclObjC.h:883
clang::ObjCImplementationDecl::setIvarRBraceLoc
void setIvarRBraceLoc(SourceLocation Loc)
Definition: DeclObjC.h:2708
clang::ObjCPropertyImplDecl::Dynamic
@ Dynamic
Definition: DeclObjC.h:2774
clang::ObjCInterfaceDecl::filtered_category_iterator::filtered_category_iterator
filtered_category_iterator()=default
clang::ObjCPropertyDecl::getQueryKind
ObjCPropertyQueryKind getQueryKind() const
Definition: DeclObjC.h:855
clang::ObjCCategoryDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2430
clang::ObjCImplementationDecl::ivar_iterator
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Definition: DeclObjC.h:2711
clang::ObjCPropertyDecl::Weak
@ Weak
Definition: DeclObjC.h:735
clang::ObjCInterfaceDecl::getSuperClass
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:352
clang::ObjCAtDefsFieldDecl::Create
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
Definition: DeclObjC.cpp:1880
clang::ObjCContainerDecl::instprop_end
instprop_iterator instprop_end() const
Definition: DeclObjC.h:985
clang::ObjCPropertyImplDecl::setPropertyDecl
void setPropertyDecl(ObjCPropertyDecl *Prop)
Definition: DeclObjC.h:2837
clang::ObjCCategoryDecl::ivar_size
unsigned ivar_size() const
Definition: DeclObjC.h:2418
clang::ObjCInterfaceDecl::ASTContext
friend class ASTContext
Definition: DeclObjC.h:1150
clang::ObjCImplementationDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2709
clang::ObjCPropertyImplDecl::getPropertyImplementation
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2839
clang::ObjCInterfaceDecl::setImplementation
void setImplementation(ObjCImplementationDecl *ImplD)
Definition: DeclObjC.cpp:1611
clang::DeclContext::filtered_decl_iterator
Iterates over a filtered subrange of declarations stored in a DeclContext.
Definition: DeclBase.h:2274
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:2667
clang::ObjCTypeParamList::TrailingObjects
friend TrailingObjects
Definition: DeclObjC.h:671
clang::ObjCMethodDecl::isOptional
bool isOptional() const
Definition: DeclObjC.h:508
clang::ObjCTypeParamList::getRAngleLoc
SourceLocation getRAngleLoc() const
Definition: DeclObjC.h:711
clang::ObjCMethodDecl::setObjCDeclQualifier
void setObjCDeclQualifier(ObjCDeclQualifier QV)
Definition: DeclObjC.h:253
clang::ObjCAtDefsFieldDecl
Represents a field declaration created by an @defs(...).
Definition: DeclObjC.h:1997
clang::ObjCMethodDecl::None
@ None
Definition: DeclObjC.h:144
clang::ObjCIvarDecl::setNextIvar
void setNextIvar(ObjCIvarDecl *ivar)
Definition: DeclObjC.h:1958
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:85
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:2648
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:2454
clang::ObjCCategoryDecl::CreateDeserialized
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2125
clang::ObjCCategoryDecl::protocol_range
llvm::iterator_range< protocol_iterator > protocol_range
Definition: DeclObjC.h:2367
clang::ObjCPropertyImplDecl::getPropertyDecl
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2834
clang::ObjCInterfaceDecl::getCanonicalDecl
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
Definition: DeclObjC.h:1890
clang::ObjCPropertyDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:935
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:822
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:383
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::ObjCContainerDecl::classmeth_end
classmeth_iterator classmeth_end() const
Definition: DeclObjC.h:1053
clang::ObjCTypeParamDecl
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:581
clang::ObjCCategoryDecl::getNextClassCategoryRaw
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
Definition: DeclObjC.h:2399
clang::ObjCPropertyDecl::getGetterName
Selector getGetterName() const
Definition: DeclObjC.h:880
clang::ObjCPropertyDecl::getSetterNameLoc
SourceLocation getSetterNameLoc() const
Definition: DeclObjC.h:889
clang::ObjCMethodDecl::getBody
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:872
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:359
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:2724
clang::ObjCMethodDecl::setSynthesizedAccessorStub
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
Definition: DeclObjC.h:452
clang::ObjCProtocolDecl::CreateDeserialized
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1921
clang::ObjCInterfaceDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:1897
clang::ObjCPropertyImplDecl::Kind
Kind
Definition: DeclObjC.h:2772
clang::ObjCMethodDecl::setOverriding
void setOverriding(bool IsOver)
Definition: DeclObjC.h:467
clang::ObjCPropertyImplDecl::isIvarNameSpecified
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
Definition: DeclObjC.h:2861
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:824
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:2222
clang::ObjCMethodDecl::param_type_begin
param_type_iterator param_type_begin() const
Definition: DeclObjC.h:403
clang::ObjCMethodDecl::hasBody
bool hasBody() const override
Determine whether this method has a body.
Definition: DeclObjC.h:526
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:1718
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:2720
clang::ObjCInterfaceDecl::getEndOfDefinitionLoc
SourceLocation getEndOfDefinitionLoc() const
Definition: DeclObjC.h:1853
clang::ObjCImplDecl::setClassInterface
void setClassInterface(ObjCInterfaceDecl *IFace)
Definition: DeclObjC.cpp:2191
clang::ObjCMethodDecl::getCmdDecl
ImplicitParamDecl * getCmdDecl() const
Definition: DeclObjC.h:424
clang::ObjCImplementationDecl::ivar_empty
bool ivar_empty() const
Definition: DeclObjC.h:2728
clang::ObjCPropertyDecl::setGetterMethodDecl
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
Definition: DeclObjC.h:897
clang::ObjCMethodDecl::findPropertyDecl
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
Definition: DeclObjC.cpp:1341
clang::ObjCContainerDecl::class_methods
classmeth_range class_methods() const
Definition: DeclObjC.h:1045
clang::IdentifierInfo::getName
StringRef getName() const
Return the actual identifier string.
Definition: IdentifierTable.h:196
clang::ObjCInterfaceDecl::known_categories
known_categories_range known_categories() const
Definition: DeclObjC.h:1663
clang::Builtin::ID
ID
Definition: Builtins.h:52
clang::ObjCTypeParamList
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Definition: DeclObjC.h:659
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:843
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:1802
clang
Definition: CalledOnceCheck.h:17
clang::ObjCContainerDecl::getInstanceMethod
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
Definition: DeclObjC.h:1061
clang::ObjCProtocolList::loc_end
loc_iterator loc_end() const
Definition: DeclObjC.h:113
clang::ObjCPropertyDecl::Required
@ Required
Definition: DeclObjC.h:736
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:759
clang::ObjCPropertyDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: DeclObjC.h:797
clang::ObjCMethodDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: DeclObjC.h:285
distance
float __ovld __cnfn distance(float, float)
Returns the distance between p0 and p1.
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:852
clang::ObjCMethodDecl::setInstanceMethod
void setInstanceMethod(bool isInst)
Definition: DeclObjC.h:431
clang::ObjCCategoryDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2435
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:71
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1920
ptrdiff_t
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
Definition: opencl-c-base.h:126
clang::ObjCProtocolDecl::isNonRuntimeProtocol
bool isNonRuntimeProtocol() const
This is true iff the protocol is tagged with the objc_non_runtime_protocol attribute.
Definition: DeclObjC.cpp:1930
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:2432
clang::ObjCCategoryDecl::protocol_loc_end
protocol_loc_iterator protocol_loc_end() const
Definition: DeclObjC.h:2391
clang::ObjCMethodDecl::setReturnTypeSourceInfo
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
Definition: DeclObjC.h:347
clang::ObjCContainerDecl::PropertyDeclOrder
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
Definition: DeclObjC.h:1084
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2049
clang::ObjCPropertyImplDecl::setSetterCXXAssignment
void setSetterCXXAssignment(Expr *setterCXXAssignment)
Definition: DeclObjC.h:2883
clang::ObjCPropertyImplDecl::setSetterMethodDecl
void setSetterMethodDecl(ObjCMethodDecl *MD)
Definition: DeclObjC.h:2869
clang::SourceLocation::isValid
bool isValid() const
Return true if this is a valid SourceLocation object.
Definition: SourceLocation.h:110
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6593
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:2763
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:2146
clang::ObjCPropertyDecl::setLParenLoc
void setLParenLoc(SourceLocation L)
Definition: DeclObjC.h:795
clang::ObjCCategoryDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:2362
clang::ObjCProtocolDecl::redecl_iterator
redeclarable_base::redecl_iterator redecl_iterator
Definition: DeclObjC.h:2251
clang::ObjCImplementationDecl::getNumIvarInitializers
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
Definition: DeclObjC.h:2653
clang::Decl::DeclContext
friend class DeclContext
Definition: DeclBase.h:249
clang::ObjCCategoryDecl::getTypeParamList
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
Definition: DeclObjC.h:2343
clang::ObjCTypeParamList::const_iterator
ObjCTypeParamDecl *const * const_iterator
Definition: DeclObjC.h:690
clang::ObjCCategoryDecl::protocol_end
protocol_iterator protocol_end() const
Definition: DeclObjC.h:2377
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:250
clang::ObjCMethodDecl::hasParamDestroyedInCallee
bool hasParamDestroyedInCallee() const
True if the method has a parameter that's destroyed in the callee.
Definition: DeclObjC.cpp:864
clang::ObjCPropertyDecl::Retain
@ Retain
Definition: DeclObjC.h:735
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:1043
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3275
clang::ObjCProtocolDecl::lookupMethod
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
Definition: DeclObjC.cpp:1966
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:1641
clang::ObjCMethodDecl::getParamDecl
ParmVarDecl * getParamDecl(unsigned Idx)
Definition: DeclObjC.h:381
clang::ObjCContainerDecl
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:943
clang::ObjCIvarDecl::setAccessControl
void setAccessControl(AccessControl ac)
Definition: DeclObjC.h:1967
clang::ObjCCategoryDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2426
clang::ObjCContainerDecl::instance_properties
instprop_range instance_properties() const
Definition: DeclObjC.h:977
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:1483
clang::ObjCMethodDecl::GetTypeFn::operator()
QualType operator()(const ParmVarDecl *PD) const
Definition: DeclObjC.h:397
clang::ObjCInterfaceDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1898
clang::ObjCMethodDecl::isPropertyAccessor
bool isPropertyAccessor() const
Definition: DeclObjC.h:440
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:1785
clang::ObjCIvarDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1984
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:964
clang::ObjCMethodDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:376
clang::ObjCIvarDecl::CreateDeserialized
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:1838
clang::ObjCProtocolDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2274
clang::ObjCMethodDecl::isRedeclaration
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
Definition: DeclObjC.h:269
clang::ObjCPropertyDecl::getAtLoc
SourceLocation getAtLoc() const
Definition: DeclObjC.h:791
clang::ObjCImplDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2494
clang::ObjCInterfaceDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
Definition: DeclObjC.cpp:372
clang::ObjCPropertyImplDecl::setAtLoc
void setAtLoc(SourceLocation Loc)
Definition: DeclObjC.h:2832
clang::ObjCCategoryImplDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2543
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:2099
llvm::SmallVectorImpl
Definition: Randstruct.h:18
clang::ObjCMethodDecl::getCategory
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
Definition: DeclObjC.cpp:1186
clang::ObjCTypeParamDecl::CreateDeserialized
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
Definition: DeclObjC.cpp:1452
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:1868
clang::ValueDecl::getType
QualType getType() const
Definition: Decl.h:712
true
#define true
Definition: stdbool.h:21
clang::ObjCPropertyDecl::PropertyControl
PropertyControl
Definition: DeclObjC.h:736
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:1934
clang::ObjCTypeParamDecl::getIndex
unsigned getIndex() const
Retrieve the index into its type parameter list.
Definition: DeclObjC.h:637
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::FieldDecl::getCanonicalDecl
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
Definition: Decl.h:3133
clang::ObjCPropertyImplDecl::getSourceRange
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Definition: DeclObjC.cpp:2383
clang::ASTDeclReader
Definition: ASTReaderDecl.cpp:81
clang::ObjCProtocolDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2122
clang::ObjCContainerDecl::getClassMethod
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
Definition: DeclObjC.h:1066
clang::ObjCInterfaceDecl::getTypeForDecl
const Type * getTypeForDecl() const
Definition: DeclObjC.h:1894
clang::ObjCInterfaceDecl::isImplicitInterfaceDecl
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
Definition: DeclObjC.h:1868
clang::ObjCCategoryDecl::setCategoryNameLoc
void setCategoryNameLoc(SourceLocation Loc)
Definition: DeclObjC.h:2427
DeclObjCCommon.h
clang::ObjCAtDefsFieldDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2016
clang::ObjCInterfaceDecl::isDesignatedInitializer
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface.
Definition: DeclObjC.cpp:572
clang::TypedefNameDecl::TypedefNameDecl
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
Definition: Decl.h:3290
clang::ObjCMethodDecl::setCmdDecl
void setCmdDecl(ImplicitParamDecl *CD)
Definition: DeclObjC.h:425
clang::CXXCtorInitializer
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2207
clang::ObjCContainerDecl::meth_end
method_iterator meth_end() const
Definition: DeclObjC.h:1019
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:438
clang::ObjCProtocolDecl::getReferencedProtocols
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:2117
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:810
clang::ASTDeclWriter
Definition: ASTWriterDecl.cpp:34
clang::ObjCTypeParamDecl::setVariance
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
Definition: DeclObjC.h:629
clang::ObjCMethodDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Definition: DeclObjC.h:537
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:432
clang::ObjCPropertyDecl::setPropertyIvarDecl
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
Definition: DeclObjC.h:915
clang::ObjCPropertyImplDecl::CreateDeserialized
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Definition: DeclObjC.cpp:2376
clang::ObjCProtocolDecl::hasDefinition
bool hasDefinition() const
Determine whether this protocol has a definition.
Definition: DeclObjC.h:2202
clang::ObjCPropertyImplDecl::classofKind
static bool classofKind(Decl::Kind K)
Definition: DeclObjC.h:2888
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:618
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:2225
clang::ObjCPropertyDecl::getQueryKind
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
Definition: DeclObjC.h:860
clang::ObjCMethodDecl::getSendResultType
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
Definition: DeclObjC.cpp:1201
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:179
clang::ObjCProtocolDecl::getDefinition
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
Definition: DeclObjC.h:2219
clang::ObjCPropertyAttribute::kind_retain
@ kind_retain
Definition: DeclObjCCommon.h:28
clang::ObjCCategoryDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2366
clang::ODRDiagsEmitter
Definition: ODRDiagsEmitter.h:20
clang::ObjCCategoryDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2378
clang::ObjCProtocolList::set
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Definition: DeclObjC.cpp:55
clang::ObjCIvarDecl::setSynthesize
void setSynthesize(bool synth)
Definition: DeclObjC.h:1975
clang::ObjCPropertyDecl::Create
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
Definition: DeclObjC.cpp:2331
clang::ObjCImplDecl::classof
static bool classof(const Decl *D)
Definition: DeclObjC.h:2492
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:1505
clang::ObjCProtocolDecl::getDefinition
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
Definition: DeclObjC.h:2214
clang::ObjCInterfaceDecl::collectPropertiesToImplement
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
Definition: DeclObjC.cpp:407
clang::ObjCList::begin
iterator begin() const
Definition: DeclObjC.h:91
clang::ICIS_NoInit
@ ICIS_NoInit
No in-class initializer.
Definition: Specifiers.h:260
clang::ObjCMethodDecl::isVariadic
bool isVariadic() const
Definition: DeclObjC.h:435
clang::ObjCContainerDecl::method_iterator
specific_decl_iterator< ObjCMethodDecl > method_iterator
Definition: DeclObjC.h:1007
clang::ObjCMethodDecl::param_type_iterator
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
Definition: DeclObjC.h:401
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::ObjCProtocolDecl::startDuplicateDefinitionForComparison
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
Definition: DeclObjC.cpp:2000
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:1240
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:2357
clang::ObjCPropertyImplDecl::setGetterMethodDecl
void setGetterMethodDecl(ObjCMethodDecl *MD)
Definition: DeclObjC.h:2866
clang::ObjCContainerDecl::PropertyMap
llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
Definition: DeclObjC.h:1082
clang::ObjCIvarDecl::Package
@ Package
Definition: DeclObjC.h:1925
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:1582
clang::ObjCMethodDecl::getImplementationControl
ImplementationControl getImplementationControl() const
Definition: DeclObjC.h:504
clang::ObjCCategoryImplDecl::Create
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
Definition: DeclObjC.cpp:2157
clang::ObjCImplementationDecl::ivar_range
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
Definition: DeclObjC.h:2712
clang::DeclContext::decls_begin
decl_iterator decls_begin() const
Definition: DeclBase.cpp:1463