clang  3.9.0
IndexDecl.cpp
Go to the documentation of this file.
1 //===- IndexDecl.cpp - Indexing declarations ------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "IndexingContext.h"
12 #include "clang/AST/DeclVisitor.h"
13 
14 using namespace clang;
15 using namespace index;
16 
17 #define TRY_TO(CALL_EXPR) \
18  do { \
19  if (!CALL_EXPR) \
20  return false; \
21  } while (0)
22 
23 namespace {
24 
25 class IndexingDeclVisitor : public ConstDeclVisitor<IndexingDeclVisitor, bool> {
26  IndexingContext &IndexCtx;
27 
28 public:
29  explicit IndexingDeclVisitor(IndexingContext &indexCtx)
30  : IndexCtx(indexCtx) { }
31 
32  bool Handled = true;
33 
34  bool VisitDecl(const Decl *D) {
35  Handled = false;
36  return true;
37  }
38 
39  /// \brief Returns true if the given method has been defined explicitly by the
40  /// user.
41  static bool hasUserDefined(const ObjCMethodDecl *D,
42  const ObjCImplDecl *Container) {
43  const ObjCMethodDecl *MD = Container->getMethod(D->getSelector(),
44  D->isInstanceMethod());
45  return MD && !MD->isImplicit() && MD->isThisDeclarationADefinition();
46  }
47 
48  void handleDeclarator(const DeclaratorDecl *D,
49  const NamedDecl *Parent = nullptr) {
50  if (!Parent) Parent = D;
51 
52  IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), Parent);
53  IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent);
54  if (IndexCtx.shouldIndexFunctionLocalSymbols()) {
55  // Only index parameters in definitions, parameters in declarations are
56  // not useful.
57  if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(D)) {
58  auto *DC = Parm->getDeclContext();
59  if (auto *FD = dyn_cast<FunctionDecl>(DC)) {
60  if (FD->isThisDeclarationADefinition())
61  IndexCtx.handleDecl(Parm);
62  } else if (auto *MD = dyn_cast<ObjCMethodDecl>(DC)) {
63  if (MD->isThisDeclarationADefinition())
64  IndexCtx.handleDecl(Parm);
65  } else {
66  IndexCtx.handleDecl(Parm);
67  }
68  } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
69  if (FD->isThisDeclarationADefinition()) {
70  for (auto PI : FD->parameters()) {
71  IndexCtx.handleDecl(PI);
72  }
73  }
74  }
75  }
76  }
77 
78  bool handleObjCMethod(const ObjCMethodDecl *D) {
79  if (!IndexCtx.handleDecl(D, (unsigned)SymbolRole::Dynamic))
80  return false;
81  IndexCtx.indexTypeSourceInfo(D->getReturnTypeSourceInfo(), D);
82  for (const auto *I : D->parameters())
83  handleDeclarator(I, D);
84 
86  const Stmt *Body = D->getBody();
87  if (Body) {
88  IndexCtx.indexBody(Body, D, D);
89  }
90  }
91  return true;
92  }
93 
94  bool VisitFunctionDecl(const FunctionDecl *D) {
95  if (D->isDeleted())
96  return true;
97 
98  SymbolRoleSet Roles{};
100  if (auto *CXXMD = dyn_cast<CXXMethodDecl>(D)) {
101  if (CXXMD->isVirtual())
102  Roles |= (unsigned)SymbolRole::Dynamic;
103  for (auto I = CXXMD->begin_overridden_methods(),
104  E = CXXMD->end_overridden_methods(); I != E; ++I) {
105  Relations.emplace_back((unsigned)SymbolRole::RelationOverrideOf, *I);
106  }
107  }
108 
109  if (!IndexCtx.handleDecl(D, Roles, Relations))
110  return false;
111  handleDeclarator(D);
112 
113  if (const CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
114  // Constructor initializers.
115  for (const auto *Init : Ctor->inits()) {
116  if (Init->isWritten()) {
117  IndexCtx.indexTypeSourceInfo(Init->getTypeSourceInfo(), D);
118  if (const FieldDecl *Member = Init->getAnyMember())
119  IndexCtx.handleReference(Member, Init->getMemberLocation(), D, D,
121  IndexCtx.indexBody(Init->getInit(), D, D);
122  }
123  }
124  }
125 
126  if (D->isThisDeclarationADefinition()) {
127  const Stmt *Body = D->getBody();
128  if (Body) {
129  IndexCtx.indexBody(Body, D, D);
130  }
131  }
132  return true;
133  }
134 
135  bool VisitVarDecl(const VarDecl *D) {
136  if (!IndexCtx.handleDecl(D))
137  return false;
138  handleDeclarator(D);
139  IndexCtx.indexBody(D->getInit(), D);
140  return true;
141  }
142 
143  bool VisitFieldDecl(const FieldDecl *D) {
144  if (!IndexCtx.handleDecl(D))
145  return false;
146  handleDeclarator(D);
147  if (D->isBitField())
148  IndexCtx.indexBody(D->getBitWidth(), D);
149  else if (D->hasInClassInitializer())
150  IndexCtx.indexBody(D->getInClassInitializer(), D);
151  return true;
152  }
153 
154  bool VisitObjCIvarDecl(const ObjCIvarDecl *D) {
155  if (D->getSynthesize()) {
156  // For synthesized ivars, use the location of the ObjC implementation,
157  // not the location of the property.
158  // Otherwise the header file containing the @interface will have different
159  // indexing contents based on whether the @implementation was present or
160  // not in the translation unit.
161  return IndexCtx.handleDecl(D,
162  cast<Decl>(D->getDeclContext())->getLocation(),
164  }
165  if (!IndexCtx.handleDecl(D))
166  return false;
167  handleDeclarator(D);
168  return true;
169  }
170 
171  bool VisitMSPropertyDecl(const MSPropertyDecl *D) {
172  handleDeclarator(D);
173  return true;
174  }
175 
176  bool VisitEnumConstantDecl(const EnumConstantDecl *D) {
177  if (!IndexCtx.handleDecl(D))
178  return false;
179  IndexCtx.indexBody(D->getInitExpr(), D);
180  return true;
181  }
182 
183  bool VisitTypedefNameDecl(const TypedefNameDecl *D) {
184  if (!IndexCtx.handleDecl(D))
185  return false;
186  IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D);
187  return true;
188  }
189 
190  bool VisitTagDecl(const TagDecl *D) {
191  // Non-free standing tags are handled in indexTypeSourceInfo.
192  if (D->isFreeStanding()) {
193  if (D->isThisDeclarationADefinition()) {
194  IndexCtx.indexTagDecl(D);
195  } else {
196  auto *Parent = dyn_cast<NamedDecl>(D->getDeclContext());
197  return IndexCtx.handleReference(D, D->getLocation(), Parent,
198  D->getLexicalDeclContext(),
199  SymbolRoleSet());
200  }
201  }
202  return true;
203  }
204 
205  bool handleReferencedProtocols(const ObjCProtocolList &ProtList,
206  const ObjCContainerDecl *ContD) {
209  I = ProtList.begin(), E = ProtList.end(); I != E; ++I, ++LI) {
210  SourceLocation Loc = *LI;
211  ObjCProtocolDecl *PD = *I;
212  TRY_TO(IndexCtx.handleReference(PD, Loc, ContD, ContD,
213  SymbolRoleSet(),
215  }
216  return true;
217  }
218 
219  bool VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) {
220  if (D->isThisDeclarationADefinition()) {
221  TRY_TO(IndexCtx.handleDecl(D));
222  if (auto *SuperD = D->getSuperClass()) {
223  TRY_TO(IndexCtx.handleReference(SuperD, D->getSuperClassLoc(), D, D,
224  SymbolRoleSet(),
226  }
227  TRY_TO(handleReferencedProtocols(D->getReferencedProtocols(), D));
228  TRY_TO(IndexCtx.indexDeclContext(D));
229  } else {
230  return IndexCtx.handleReference(D, D->getLocation(), nullptr,
231  D->getDeclContext(), SymbolRoleSet());
232  }
233  return true;
234  }
235 
236  bool VisitObjCProtocolDecl(const ObjCProtocolDecl *D) {
237  if (D->isThisDeclarationADefinition()) {
238  TRY_TO(IndexCtx.handleDecl(D));
239  TRY_TO(handleReferencedProtocols(D->getReferencedProtocols(), D));
240  TRY_TO(IndexCtx.indexDeclContext(D));
241  } else {
242  return IndexCtx.handleReference(D, D->getLocation(), nullptr,
243  D->getDeclContext(), SymbolRoleSet());
244  }
245  return true;
246  }
247 
248  bool VisitObjCImplementationDecl(const ObjCImplementationDecl *D) {
250  if (!Class)
251  return true;
252 
253  if (Class->isImplicitInterfaceDecl())
254  IndexCtx.handleDecl(Class);
255 
256  if (!IndexCtx.handleDecl(D))
257  return false;
258 
259  // Index the ivars first to make sure the synthesized ivars are indexed
260  // before indexing the methods that can reference them.
261  for (const auto *IvarI : D->ivars())
262  IndexCtx.indexDecl(IvarI);
263  for (const auto *I : D->decls()) {
264  if (!isa<ObjCIvarDecl>(I))
265  IndexCtx.indexDecl(I);
266  }
267 
268  return true;
269  }
270 
271  bool VisitObjCCategoryDecl(const ObjCCategoryDecl *D) {
272  if (!IndexCtx.handleDecl(D))
273  return false;
274  IndexCtx.indexDeclContext(D);
275  return true;
276  }
277 
278  bool VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D) {
279  const ObjCCategoryDecl *Cat = D->getCategoryDecl();
280  if (!Cat)
281  return true;
282 
283  if (!IndexCtx.handleDecl(D))
284  return false;
285  IndexCtx.indexDeclContext(D);
286  return true;
287  }
288 
289  bool VisitObjCMethodDecl(const ObjCMethodDecl *D) {
290  // Methods associated with a property, even user-declared ones, are
291  // handled when we handle the property.
292  if (D->isPropertyAccessor())
293  return true;
294 
295  handleObjCMethod(D);
296  return true;
297  }
298 
299  bool VisitObjCPropertyDecl(const ObjCPropertyDecl *D) {
300  if (ObjCMethodDecl *MD = D->getGetterMethodDecl())
301  if (MD->getLexicalDeclContext() == D->getLexicalDeclContext())
302  handleObjCMethod(MD);
303  if (ObjCMethodDecl *MD = D->getSetterMethodDecl())
304  if (MD->getLexicalDeclContext() == D->getLexicalDeclContext())
305  handleObjCMethod(MD);
306  if (!IndexCtx.handleDecl(D))
307  return false;
308  IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D);
309  return true;
310  }
311 
312  bool VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D) {
314  if (!IndexCtx.handleReference(PD, D->getLocation(),
315  /*Parent=*/cast<NamedDecl>(D->getDeclContext()),
316  D->getDeclContext(), SymbolRoleSet(), {},
317  /*RefE=*/nullptr, D))
318  return false;
319 
321  return true;
323 
324  if (ObjCIvarDecl *IvarD = D->getPropertyIvarDecl()) {
325  if (!IvarD->getSynthesize())
326  IndexCtx.handleReference(IvarD, D->getPropertyIvarDeclLoc(), nullptr,
327  D->getDeclContext(), SymbolRoleSet());
328  }
329 
330  auto *ImplD = cast<ObjCImplDecl>(D->getDeclContext());
331  if (ObjCMethodDecl *MD = PD->getGetterMethodDecl()) {
332  if (MD->isPropertyAccessor() &&
333  !hasUserDefined(MD, ImplD))
334  IndexCtx.handleDecl(MD, D->getLocation(), SymbolRoleSet(), {}, ImplD);
335  }
336  if (ObjCMethodDecl *MD = PD->getSetterMethodDecl()) {
337  if (MD->isPropertyAccessor() &&
338  !hasUserDefined(MD, ImplD))
339  IndexCtx.handleDecl(MD, D->getLocation(), SymbolRoleSet(), {}, ImplD);
340  }
341  return true;
342  }
343 
344  bool VisitNamespaceDecl(const NamespaceDecl *D) {
345  if (!IndexCtx.handleDecl(D))
346  return false;
347  IndexCtx.indexDeclContext(D);
348  return true;
349  }
350 
351  bool VisitUsingDecl(const UsingDecl *D) {
352  const DeclContext *DC = D->getDeclContext()->getRedeclContext();
353  const NamedDecl *Parent = dyn_cast<NamedDecl>(DC);
354 
355  IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent,
356  D->getLexicalDeclContext());
357  for (const auto *I : D->shadows())
358  IndexCtx.handleReference(I->getUnderlyingDecl(), D->getLocation(), Parent,
359  D->getLexicalDeclContext(), SymbolRoleSet());
360  return true;
361  }
362 
363  bool VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) {
364  const DeclContext *DC = D->getDeclContext()->getRedeclContext();
365  const NamedDecl *Parent = dyn_cast<NamedDecl>(DC);
366 
367  IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), Parent,
368  D->getLexicalDeclContext());
369  return IndexCtx.handleReference(D->getNominatedNamespaceAsWritten(),
370  D->getLocation(), Parent,
371  D->getLexicalDeclContext(),
372  SymbolRoleSet());
373  }
374 
375  bool VisitClassTemplateSpecializationDecl(const
377  // FIXME: Notify subsequent callbacks if info comes from implicit
378  // instantiation.
380  IndexCtx.indexTagDecl(D);
381  return true;
382  }
383 
384  bool VisitTemplateDecl(const TemplateDecl *D) {
385  // FIXME: Template parameters.
386  return Visit(D->getTemplatedDecl());
387  }
388 
389  bool VisitFriendDecl(const FriendDecl *D) {
390  if (auto ND = D->getFriendDecl()) {
391  // FIXME: Ignore a class template in a dependent context, these are not
392  // linked properly with their redeclarations, ending up with duplicate
393  // USRs.
394  // See comment "Friend templates are visible in fairly strange ways." in
395  // SemaTemplate.cpp which precedes code that prevents the friend template
396  // from becoming visible from the enclosing context.
397  if (isa<ClassTemplateDecl>(ND) && D->getDeclContext()->isDependentContext())
398  return true;
399  return Visit(ND);
400  }
401  if (auto Ty = D->getFriendType()) {
402  IndexCtx.indexTypeSourceInfo(Ty, cast<NamedDecl>(D->getDeclContext()));
403  }
404  return true;
405  }
406 
407  bool VisitImportDecl(const ImportDecl *D) {
408  return IndexCtx.importedModule(D);
409  }
410 };
411 
412 } // anonymous namespace
413 
415  if (D->isImplicit() && shouldIgnoreIfImplicit(D))
416  return true;
417 
418  if (isTemplateImplicitInstantiation(D))
419  return true;
420 
421  IndexingDeclVisitor Visitor(*this);
422  bool ShouldContinue = Visitor.Visit(D);
423  if (!ShouldContinue)
424  return false;
425 
426  if (!Visitor.Handled && isa<DeclContext>(D))
427  return indexDeclContext(cast<DeclContext>(D));
428 
429  return true;
430 }
431 
433  for (const auto *I : DC->decls())
434  if (!indexDecl(I))
435  return false;
436  return true;
437 }
438 
440  if (D->getLocation().isInvalid())
441  return true;
442 
443  if (isa<ObjCMethodDecl>(D))
444  return true; // Wait for the objc container.
445 
446  return indexDecl(D);
447 }
448 
450  for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I)
451  if (!indexTopLevelDecl(*I))
452  return false;
453  return true;
454 }
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
Definition: Decl.h:1561
Represents a relation to another symbol for a symbol occurrence.
Definition: IndexSymbol.h:96
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:2361
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:1453
const Expr * getInitExpr() const
Definition: Decl.h:2498
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
Definition: DeclObjC.h:1435
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
Definition: Decl.h:2481
iterator end()
Definition: DeclGroup.h:108
bool indexTopLevelDecl(const Decl *D)
Definition: IndexDecl.cpp:439
const Expr * getInit() const
Definition: Decl.h:1139
NamespaceDecl - Represent a C++ namespace.
Definition: Decl.h:471
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2187
Expr * getInClassInitializer() const
getInClassInitializer - Get the C++11 in-class initializer for this member, or null if one has not be...
Definition: Decl.h:2416
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
Definition: DeclObjC.cpp:68
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
Definition: DeclFriend.h:40
TRY_TO(TraverseType(T->getPointeeType()))
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Definition: Decl.h:768
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:113
ParmVarDecl - Represents a parameter to a function.
Definition: Decl.h:1377
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Definition: Decl.h:707
TypeSourceInfo * getTypeSourceInfo() const
Definition: DeclObjC.h:779
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:107
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2717
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:1275
Represents a class template specialization, which refers to a class template with a given set of temp...
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
Definition: Decl.h:2293
bool isThisDeclarationADefinition() const
isThisDeclarationADefinition() - Return true if this declaration is a completion definition of the ty...
Definition: Decl.h:2865
Represents a C++ using-declaration.
Definition: DeclCXX.h:3039
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Definition: DeclObjC.h:492
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:901
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
Definition: DeclObjC.cpp:334
NamedDecl * getNominatedNamespaceAsWritten()
Definition: DeclCXX.h:2662
iterator begin()
Definition: DeclGroup.h:102
bool indexDecl(const Decl *D)
Definition: IndexDecl.cpp:414
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:1968
Represents an ObjC class declaration.
Definition: DeclObjC.h:1091
detail::InMemoryDirectory::const_iterator I
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2655
unsigned SymbolRoleSet
Definition: IndexSymbol.h:93
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
Definition: DeclObjC.h:2109
Represents a ValueDecl that came out of a declarator.
Definition: Decl.h:646
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:1909
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2721
Expr * getBitWidth() const
Definition: Decl.h:2375
bool indexDeclContext(const DeclContext *DC)
Definition: IndexDecl.cpp:432
bool indexDeclGroupRef(DeclGroupRef DG)
Definition: IndexDecl.cpp:449
bool isInstanceMethod() const
Definition: DeclObjC.h:414
shadow_range shadows() const
Definition: DeclCXX.h:3136
ivar_range ivars() const
Definition: DeclObjC.h:2601
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:671
TypeSourceInfo * getReturnTypeSourceInfo() const
Definition: DeclObjC.h:344
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:1999
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:371
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
Definition: Decl.cpp:2491
Encodes a location in the source.
TagDecl - Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:2727
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:784
bool getSynthesize() const
Definition: DeclObjC.h:1895
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2171
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2325
bool isPropertyAccessor() const
Definition: DeclObjC.h:421
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:699
loc_iterator loc_begin() const
Definition: DeclObjC.h:85
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:3728
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:2609
const ObjCProtocolList & getReferencedProtocols() const
Definition: DeclObjC.h:2018
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1135
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:330
bool isFreeStanding() const
Definition: Decl.h:2893
SourceLocation getPropertyIvarDeclLoc() const
Definition: DeclObjC.h:2724
bool isThisDeclarationADefinition() const
isThisDeclarationADefinition - Returns whether this specific declaration of the function is also a de...
Definition: Decl.h:1814
Selector getSelector() const
Definition: DeclObjC.h:328
detail::InMemoryDirectory::const_iterator E
iterator begin() const
Definition: DeclObjC.h:65
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2461
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:860
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
Definition: DeclFriend.h:120
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:863
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Definition: DeclCXX.h:3076
A list of Objective-C protocols, along with the source locations at which they were referenced...
Definition: DeclObjC.h:76
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2712
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node...
Definition: DeclObjC.h:1794
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
Definition: DeclTemplate.h:358
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1849
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:314
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Definition: DeclCXX.h:2654
An instance of this class represents the declaration of a property member.
Definition: DeclCXX.h:3394
NamedDecl - This represents a decl with a name.
Definition: Decl.h:213
Represents C++ using-directive.
Definition: DeclCXX.h:2615
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:2644
A simple visitor class that helps create declaration visitors.
Definition: DeclVisitor.h:74
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
Definition: DeclObjC.h:2380
iterator end() const
Definition: DeclObjC.h:66
bool hasInClassInitializer() const
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
Definition: Decl.h:2408