clang  16.0.0git
ODRHash.cpp
Go to the documentation of this file.
1 //===-- ODRHash.cpp - Hashing to diagnose ODR failures ----------*- 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 /// \file
10 /// This file implements the ODRHash class, which calculates a hash based
11 /// on AST nodes, which is stable across different runs.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #include "clang/AST/ODRHash.h"
16 
17 #include "clang/AST/DeclVisitor.h"
19 #include "clang/AST/StmtVisitor.h"
20 #include "clang/AST/TypeVisitor.h"
21 
22 using namespace clang;
23 
24 void ODRHash::AddStmt(const Stmt *S) {
25  assert(S && "Expecting non-null pointer.");
26  S->ProcessODRHash(ID, *this);
27 }
28 
30  assert(II && "Expecting non-null pointer.");
31  ID.AddString(II->getName());
32 }
33 
34 void ODRHash::AddDeclarationName(DeclarationName Name, bool TreatAsDecl) {
35  if (TreatAsDecl)
36  // Matches the NamedDecl check in AddDecl
37  AddBoolean(true);
38 
39  AddDeclarationNameImpl(Name);
40 
41  if (TreatAsDecl)
42  // Matches the ClassTemplateSpecializationDecl check in AddDecl
43  AddBoolean(false);
44 }
45 
46 void ODRHash::AddDeclarationNameImpl(DeclarationName Name) {
47  // Index all DeclarationName and use index numbers to refer to them.
48  auto Result = DeclNameMap.insert(std::make_pair(Name, DeclNameMap.size()));
49  ID.AddInteger(Result.first->second);
50  if (!Result.second) {
51  // If found in map, the DeclarationName has previously been processed.
52  return;
53  }
54 
55  // First time processing each DeclarationName, also process its details.
56  AddBoolean(Name.isEmpty());
57  if (Name.isEmpty())
58  return;
59 
60  auto Kind = Name.getNameKind();
61  ID.AddInteger(Kind);
62  switch (Kind) {
64  AddIdentifierInfo(Name.getAsIdentifierInfo());
65  break;
69  Selector S = Name.getObjCSelector();
70  AddBoolean(S.isNull());
71  AddBoolean(S.isKeywordSelector());
72  AddBoolean(S.isUnarySelector());
73  unsigned NumArgs = S.getNumArgs();
74  ID.AddInteger(NumArgs);
75  // Compare all selector slots. For selectors with arguments it means all arg
76  // slots. And if there are no arguments, compare the first-and-only slot.
77  unsigned SlotsToCheck = NumArgs > 0 ? NumArgs : 1;
78  for (unsigned i = 0; i < SlotsToCheck; ++i) {
79  const IdentifierInfo *II = S.getIdentifierInfoForSlot(i);
80  AddBoolean(II);
81  if (II) {
83  }
84  }
85  break;
86  }
89  AddQualType(Name.getCXXNameType());
90  break;
92  ID.AddInteger(Name.getCXXOverloadedOperator());
93  break;
95  AddIdentifierInfo(Name.getCXXLiteralIdentifier());
96  break;
98  AddQualType(Name.getCXXNameType());
99  break;
101  break;
103  auto *Template = Name.getCXXDeductionGuideTemplate();
104  AddBoolean(Template);
105  if (Template) {
106  AddDecl(Template);
107  }
108  }
109  }
110 }
111 
113  assert(NNS && "Expecting non-null pointer.");
114  const auto *Prefix = NNS->getPrefix();
115  AddBoolean(Prefix);
116  if (Prefix) {
117  AddNestedNameSpecifier(Prefix);
118  }
119  auto Kind = NNS->getKind();
120  ID.AddInteger(Kind);
121  switch (Kind) {
124  break;
126  AddDecl(NNS->getAsNamespace());
127  break;
130  break;
133  AddType(NNS->getAsType());
134  break;
137  break;
138  }
139 }
140 
142  auto Kind = Name.getKind();
143  ID.AddInteger(Kind);
144 
145  switch (Kind) {
147  AddDecl(Name.getAsTemplateDecl());
148  break;
149  // TODO: Support these cases.
157  break;
158  }
159 }
160 
162  const auto Kind = TA.getKind();
163  ID.AddInteger(Kind);
164 
165  switch (Kind) {
167  llvm_unreachable("Expected valid TemplateArgument");
169  AddQualType(TA.getAsType());
170  break;
172  AddDecl(TA.getAsDecl());
173  break;
176  break;
179  AddTemplateName(TA.getAsTemplateOrTemplatePattern());
180  break;
182  AddStmt(TA.getAsExpr());
183  break;
185  ID.AddInteger(TA.pack_size());
186  for (auto SubTA : TA.pack_elements()) {
187  AddTemplateArgument(SubTA);
188  }
189  break;
190  }
191 }
192 
194  assert(TPL && "Expecting non-null pointer.");
195 
196  ID.AddInteger(TPL->size());
197  for (auto *ND : TPL->asArray()) {
198  AddSubDecl(ND);
199  }
200 }
201 
203  DeclNameMap.clear();
204  Bools.clear();
205  ID.clear();
206 }
207 
209  // Append the bools to the end of the data segment backwards. This allows
210  // for the bools data to be compressed 32 times smaller compared to using
211  // ID.AddBoolean
212  const unsigned unsigned_bits = sizeof(unsigned) * CHAR_BIT;
213  const unsigned size = Bools.size();
214  const unsigned remainder = size % unsigned_bits;
215  const unsigned loops = size / unsigned_bits;
216  auto I = Bools.rbegin();
217  unsigned value = 0;
218  for (unsigned i = 0; i < remainder; ++i) {
219  value <<= 1;
220  value |= *I;
221  ++I;
222  }
223  ID.AddInteger(value);
224 
225  for (unsigned i = 0; i < loops; ++i) {
226  value = 0;
227  for (unsigned j = 0; j < unsigned_bits; ++j) {
228  value <<= 1;
229  value |= *I;
230  ++I;
231  }
232  ID.AddInteger(value);
233  }
234 
235  assert(I == Bools.rend());
236  Bools.clear();
237  return ID.ComputeHash();
238 }
239 
240 namespace {
241 // Process a Decl pointer. Add* methods call back into ODRHash while Visit*
242 // methods process the relevant parts of the Decl.
243 class ODRDeclVisitor : public ConstDeclVisitor<ODRDeclVisitor> {
244  typedef ConstDeclVisitor<ODRDeclVisitor> Inherited;
245  llvm::FoldingSetNodeID &ID;
246  ODRHash &Hash;
247 
248 public:
249  ODRDeclVisitor(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
250  : ID(ID), Hash(Hash) {}
251 
252  void AddStmt(const Stmt *S) {
253  Hash.AddBoolean(S);
254  if (S) {
255  Hash.AddStmt(S);
256  }
257  }
258 
259  void AddIdentifierInfo(const IdentifierInfo *II) {
260  Hash.AddBoolean(II);
261  if (II) {
262  Hash.AddIdentifierInfo(II);
263  }
264  }
265 
266  void AddQualType(QualType T) {
267  Hash.AddQualType(T);
268  }
269 
270  void AddDecl(const Decl *D) {
271  Hash.AddBoolean(D);
272  if (D) {
273  Hash.AddDecl(D);
274  }
275  }
276 
277  void AddTemplateArgument(TemplateArgument TA) {
278  Hash.AddTemplateArgument(TA);
279  }
280 
281  void Visit(const Decl *D) {
282  ID.AddInteger(D->getKind());
283  Inherited::Visit(D);
284  }
285 
286  void VisitNamedDecl(const NamedDecl *D) {
287  Hash.AddDeclarationName(D->getDeclName());
288  Inherited::VisitNamedDecl(D);
289  }
290 
291  void VisitValueDecl(const ValueDecl *D) {
292  if (!isa<FunctionDecl>(D)) {
293  AddQualType(D->getType());
294  }
295  Inherited::VisitValueDecl(D);
296  }
297 
298  void VisitVarDecl(const VarDecl *D) {
299  Hash.AddBoolean(D->isStaticLocal());
300  Hash.AddBoolean(D->isConstexpr());
301  const bool HasInit = D->hasInit();
302  Hash.AddBoolean(HasInit);
303  if (HasInit) {
304  AddStmt(D->getInit());
305  }
306  Inherited::VisitVarDecl(D);
307  }
308 
309  void VisitParmVarDecl(const ParmVarDecl *D) {
310  // TODO: Handle default arguments.
311  Inherited::VisitParmVarDecl(D);
312  }
313 
314  void VisitAccessSpecDecl(const AccessSpecDecl *D) {
315  ID.AddInteger(D->getAccess());
316  Inherited::VisitAccessSpecDecl(D);
317  }
318 
319  void VisitStaticAssertDecl(const StaticAssertDecl *D) {
320  AddStmt(D->getAssertExpr());
321  AddStmt(D->getMessage());
322 
323  Inherited::VisitStaticAssertDecl(D);
324  }
325 
326  void VisitFieldDecl(const FieldDecl *D) {
327  const bool IsBitfield = D->isBitField();
328  Hash.AddBoolean(IsBitfield);
329 
330  if (IsBitfield) {
331  AddStmt(D->getBitWidth());
332  }
333 
334  Hash.AddBoolean(D->isMutable());
335  AddStmt(D->getInClassInitializer());
336 
337  Inherited::VisitFieldDecl(D);
338  }
339 
340  void VisitObjCPropertyDecl(const ObjCPropertyDecl *D) {
341  ID.AddInteger(D->getPropertyAttributes());
342  ID.AddInteger(D->getPropertyImplementation());
343  AddQualType(D->getType());
344  AddDecl(D);
345 
346  Inherited::VisitObjCPropertyDecl(D);
347  }
348 
349  void VisitFunctionDecl(const FunctionDecl *D) {
350  // Handled by the ODRHash for FunctionDecl
351  ID.AddInteger(D->getODRHash());
352 
353  Inherited::VisitFunctionDecl(D);
354  }
355 
356  void VisitCXXMethodDecl(const CXXMethodDecl *D) {
357  // Handled by the ODRHash for FunctionDecl
358 
359  Inherited::VisitCXXMethodDecl(D);
360  }
361 
362  void VisitObjCMethodDecl(const ObjCMethodDecl *Method) {
363  ID.AddInteger(Method->getDeclKind());
364  Hash.AddBoolean(Method->isInstanceMethod()); // false if class method
365  Hash.AddBoolean(Method->isPropertyAccessor());
366  Hash.AddBoolean(Method->isVariadic());
367  Hash.AddBoolean(Method->isSynthesizedAccessorStub());
368  Hash.AddBoolean(Method->isDefined());
369  Hash.AddBoolean(Method->isOverriding());
370  Hash.AddBoolean(Method->isDirectMethod());
372  Hash.AddBoolean(Method->hasSkippedBody());
373 
374  ID.AddInteger(Method->getImplementationControl());
375  ID.AddInteger(Method->getMethodFamily());
376  ImplicitParamDecl *Cmd = Method->getCmdDecl();
377  Hash.AddBoolean(Cmd);
378  if (Cmd)
379  ID.AddInteger(Cmd->getParameterKind());
380 
381  ImplicitParamDecl *Self = Method->getSelfDecl();
382  Hash.AddBoolean(Self);
383  if (Self)
384  ID.AddInteger(Self->getParameterKind());
385 
386  AddDecl(Method);
387 
388  AddQualType(Method->getReturnType());
389  ID.AddInteger(Method->param_size());
390  for (auto Param : Method->parameters())
391  Hash.AddSubDecl(Param);
392 
393  if (Method->hasBody()) {
394  const bool IsDefinition = Method->isThisDeclarationADefinition();
395  Hash.AddBoolean(IsDefinition);
396  if (IsDefinition) {
397  Stmt *Body = Method->getBody();
398  Hash.AddBoolean(Body);
399  if (Body)
400  AddStmt(Body);
401 
402  // Filter out sub-Decls which will not be processed in order to get an
403  // accurate count of Decl's.
405  for (Decl *SubDecl : Method->decls())
406  if (ODRHash::isSubDeclToBeProcessed(SubDecl, Method))
407  Decls.push_back(SubDecl);
408 
409  ID.AddInteger(Decls.size());
410  for (auto SubDecl : Decls)
411  Hash.AddSubDecl(SubDecl);
412  }
413  } else {
414  Hash.AddBoolean(false);
415  }
416 
417  Inherited::VisitObjCMethodDecl(Method);
418  }
419 
420  void VisitTypedefNameDecl(const TypedefNameDecl *D) {
421  AddQualType(D->getUnderlyingType());
422 
423  Inherited::VisitTypedefNameDecl(D);
424  }
425 
426  void VisitTypedefDecl(const TypedefDecl *D) {
427  Inherited::VisitTypedefDecl(D);
428  }
429 
430  void VisitTypeAliasDecl(const TypeAliasDecl *D) {
431  Inherited::VisitTypeAliasDecl(D);
432  }
433 
434  void VisitFriendDecl(const FriendDecl *D) {
435  TypeSourceInfo *TSI = D->getFriendType();
436  Hash.AddBoolean(TSI);
437  if (TSI) {
438  AddQualType(TSI->getType());
439  } else {
440  AddDecl(D->getFriendDecl());
441  }
442  }
443 
444  void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) {
445  // Only care about default arguments as part of the definition.
446  const bool hasDefaultArgument =
448  Hash.AddBoolean(hasDefaultArgument);
449  if (hasDefaultArgument) {
450  AddTemplateArgument(D->getDefaultArgument());
451  }
452  Hash.AddBoolean(D->isParameterPack());
453 
454  const TypeConstraint *TC = D->getTypeConstraint();
455  Hash.AddBoolean(TC != nullptr);
456  if (TC)
457  AddStmt(TC->getImmediatelyDeclaredConstraint());
458 
459  Inherited::VisitTemplateTypeParmDecl(D);
460  }
461 
462  void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) {
463  // Only care about default arguments as part of the definition.
464  const bool hasDefaultArgument =
466  Hash.AddBoolean(hasDefaultArgument);
467  if (hasDefaultArgument) {
468  AddStmt(D->getDefaultArgument());
469  }
470  Hash.AddBoolean(D->isParameterPack());
471 
472  Inherited::VisitNonTypeTemplateParmDecl(D);
473  }
474 
475  void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D) {
476  // Only care about default arguments as part of the definition.
477  const bool hasDefaultArgument =
479  Hash.AddBoolean(hasDefaultArgument);
480  if (hasDefaultArgument) {
481  AddTemplateArgument(D->getDefaultArgument().getArgument());
482  }
483  Hash.AddBoolean(D->isParameterPack());
484 
485  Inherited::VisitTemplateTemplateParmDecl(D);
486  }
487 
488  void VisitTemplateDecl(const TemplateDecl *D) {
490 
491  Inherited::VisitTemplateDecl(D);
492  }
493 
494  void VisitRedeclarableTemplateDecl(const RedeclarableTemplateDecl *D) {
496  Inherited::VisitRedeclarableTemplateDecl(D);
497  }
498 
499  void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
500  AddDecl(D->getTemplatedDecl());
501  ID.AddInteger(D->getTemplatedDecl()->getODRHash());
502  Inherited::VisitFunctionTemplateDecl(D);
503  }
504 
505  void VisitEnumConstantDecl(const EnumConstantDecl *D) {
506  AddStmt(D->getInitExpr());
507  Inherited::VisitEnumConstantDecl(D);
508  }
509 };
510 } // namespace
511 
512 // Only allow a small portion of Decl's to be processed. Remove this once
513 // all Decl's can be handled.
515  if (D->isImplicit()) return false;
516  if (D->getDeclContext() != Parent) return false;
517 
518  switch (D->getKind()) {
519  default:
520  return false;
521  case Decl::AccessSpec:
522  case Decl::CXXConstructor:
523  case Decl::CXXDestructor:
524  case Decl::CXXMethod:
525  case Decl::EnumConstant: // Only found in EnumDecl's.
526  case Decl::Field:
527  case Decl::Friend:
528  case Decl::FunctionTemplate:
529  case Decl::StaticAssert:
530  case Decl::TypeAlias:
531  case Decl::Typedef:
532  case Decl::Var:
533  case Decl::ObjCMethod:
534  case Decl::ObjCProperty:
535  return true;
536  }
537 }
538 
539 void ODRHash::AddSubDecl(const Decl *D) {
540  assert(D && "Expecting non-null pointer.");
541 
542  ODRDeclVisitor(ID, *this).Visit(D);
543 }
544 
546  assert(Record && Record->hasDefinition() &&
547  "Expected non-null record to be a definition.");
548 
549  const DeclContext *DC = Record;
550  while (DC) {
551  if (isa<ClassTemplateSpecializationDecl>(DC)) {
552  return;
553  }
554  DC = DC->getParent();
555  }
556 
557  AddDecl(Record);
558 
559  // Filter out sub-Decls which will not be processed in order to get an
560  // accurate count of Decl's.
562  for (Decl *SubDecl : Record->decls()) {
563  if (isSubDeclToBeProcessed(SubDecl, Record)) {
564  Decls.push_back(SubDecl);
565  if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {
566  // Compute/Preload ODRHash into FunctionDecl.
567  Function->getODRHash();
568  }
569  }
570  }
571 
572  ID.AddInteger(Decls.size());
573  for (auto SubDecl : Decls) {
574  AddSubDecl(SubDecl);
575  }
576 
577  const ClassTemplateDecl *TD = Record->getDescribedClassTemplate();
578  AddBoolean(TD);
579  if (TD) {
581  }
582 
583  ID.AddInteger(Record->getNumBases());
584  auto Bases = Record->bases();
585  for (auto Base : Bases) {
586  AddQualType(Base.getType());
587  ID.AddInteger(Base.isVirtual());
588  ID.AddInteger(Base.getAccessSpecifierAsWritten());
589  }
590 }
591 
593  bool SkipBody) {
594  assert(Function && "Expecting non-null pointer.");
595 
596  // Skip functions that are specializations or in specialization context.
597  const DeclContext *DC = Function;
598  while (DC) {
599  if (isa<ClassTemplateSpecializationDecl>(DC)) return;
600  if (auto *F = dyn_cast<FunctionDecl>(DC)) {
601  if (F->isFunctionTemplateSpecialization()) {
602  if (!isa<CXXMethodDecl>(DC)) return;
603  if (DC->getLexicalParent()->isFileContext()) return;
604  // Inline method specializations are the only supported
605  // specialization for now.
606  }
607  }
608  DC = DC->getParent();
609  }
610 
611  ID.AddInteger(Function->getDeclKind());
612 
613  const auto *SpecializationArgs = Function->getTemplateSpecializationArgs();
614  AddBoolean(SpecializationArgs);
615  if (SpecializationArgs) {
616  ID.AddInteger(SpecializationArgs->size());
617  for (const TemplateArgument &TA : SpecializationArgs->asArray()) {
619  }
620  }
621 
622  if (const auto *Method = dyn_cast<CXXMethodDecl>(Function)) {
623  AddBoolean(Method->isConst());
624  AddBoolean(Method->isVolatile());
625  }
626 
627  ID.AddInteger(Function->getStorageClass());
628  AddBoolean(Function->isInlineSpecified());
629  AddBoolean(Function->isVirtualAsWritten());
630  AddBoolean(Function->isPure());
631  AddBoolean(Function->isDeletedAsWritten());
632  AddBoolean(Function->isExplicitlyDefaulted());
633 
634  AddDecl(Function);
635 
636  AddQualType(Function->getReturnType());
637 
638  ID.AddInteger(Function->param_size());
639  for (auto *Param : Function->parameters())
640  AddSubDecl(Param);
641 
642  if (SkipBody) {
643  AddBoolean(false);
644  return;
645  }
646 
647  const bool HasBody = Function->isThisDeclarationADefinition() &&
648  !Function->isDefaulted() && !Function->isDeleted() &&
649  !Function->isLateTemplateParsed();
650  AddBoolean(HasBody);
651  if (!HasBody) {
652  return;
653  }
654 
655  auto *Body = Function->getBody();
656  AddBoolean(Body);
657  if (Body)
658  AddStmt(Body);
659 
660  // Filter out sub-Decls which will not be processed in order to get an
661  // accurate count of Decl's.
663  for (Decl *SubDecl : Function->decls()) {
664  if (isSubDeclToBeProcessed(SubDecl, Function)) {
665  Decls.push_back(SubDecl);
666  }
667  }
668 
669  ID.AddInteger(Decls.size());
670  for (auto SubDecl : Decls) {
671  AddSubDecl(SubDecl);
672  }
673 }
674 
675 void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
676  assert(Enum);
677  AddDeclarationName(Enum->getDeclName());
678 
679  AddBoolean(Enum->isScoped());
680  if (Enum->isScoped())
681  AddBoolean(Enum->isScopedUsingClassTag());
682 
683  if (Enum->getIntegerTypeSourceInfo())
684  AddQualType(Enum->getIntegerType());
685 
686  // Filter out sub-Decls which will not be processed in order to get an
687  // accurate count of Decl's.
689  for (Decl *SubDecl : Enum->decls()) {
690  if (isSubDeclToBeProcessed(SubDecl, Enum)) {
691  assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");
692  Decls.push_back(SubDecl);
693  }
694  }
695 
696  ID.AddInteger(Decls.size());
697  for (auto SubDecl : Decls) {
698  AddSubDecl(SubDecl);
699  }
700 
701 }
702 
704  AddDecl(P);
705 
706  // Hash referenced protocols.
707  ID.AddInteger(P->getReferencedProtocols().size());
708  for (const ObjCProtocolDecl *RefP : P->protocols()) {
709  // Hash the name only as a referenced protocol can be a forward declaration.
710  AddDeclarationName(RefP->getDeclName());
711  }
712 
713  // Filter out sub-Decls which will not be processed in order to get an
714  // accurate count of Decl's.
716  for (Decl *SubDecl : P->decls()) {
717  if (isSubDeclToBeProcessed(SubDecl, P)) {
718  Decls.push_back(SubDecl);
719  }
720  }
721 
722  ID.AddInteger(Decls.size());
723  for (auto *SubDecl : Decls) {
724  AddSubDecl(SubDecl);
725  }
726 }
727 
728 void ODRHash::AddDecl(const Decl *D) {
729  assert(D && "Expecting non-null pointer.");
730  D = D->getCanonicalDecl();
731 
732  const NamedDecl *ND = dyn_cast<NamedDecl>(D);
733  AddBoolean(ND);
734  if (!ND) {
735  ID.AddInteger(D->getKind());
736  return;
737  }
738 
740 
741  const auto *Specialization =
742  dyn_cast<ClassTemplateSpecializationDecl>(D);
744  if (Specialization) {
745  const TemplateArgumentList &List = Specialization->getTemplateArgs();
746  ID.AddInteger(List.size());
747  for (const TemplateArgument &TA : List.asArray())
749  }
750 }
751 
752 namespace {
753 // Process a Type pointer. Add* methods call back into ODRHash while Visit*
754 // methods process the relevant parts of the Type.
755 class ODRTypeVisitor : public TypeVisitor<ODRTypeVisitor> {
756  typedef TypeVisitor<ODRTypeVisitor> Inherited;
757  llvm::FoldingSetNodeID &ID;
758  ODRHash &Hash;
759 
760 public:
761  ODRTypeVisitor(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
762  : ID(ID), Hash(Hash) {}
763 
764  void AddStmt(Stmt *S) {
765  Hash.AddBoolean(S);
766  if (S) {
767  Hash.AddStmt(S);
768  }
769  }
770 
771  void AddDecl(const Decl *D) {
772  Hash.AddBoolean(D);
773  if (D) {
774  Hash.AddDecl(D);
775  }
776  }
777 
778  void AddQualType(QualType T) {
779  Hash.AddQualType(T);
780  }
781 
782  void AddType(const Type *T) {
783  Hash.AddBoolean(T);
784  if (T) {
785  Hash.AddType(T);
786  }
787  }
788 
789  void AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
790  Hash.AddBoolean(NNS);
791  if (NNS) {
792  Hash.AddNestedNameSpecifier(NNS);
793  }
794  }
795 
796  void AddIdentifierInfo(const IdentifierInfo *II) {
797  Hash.AddBoolean(II);
798  if (II) {
799  Hash.AddIdentifierInfo(II);
800  }
801  }
802 
803  void VisitQualifiers(Qualifiers Quals) {
804  ID.AddInteger(Quals.getAsOpaqueValue());
805  }
806 
807  // Return the RecordType if the typedef only strips away a keyword.
808  // Otherwise, return the original type.
809  static const Type *RemoveTypedef(const Type *T) {
810  const auto *TypedefT = dyn_cast<TypedefType>(T);
811  if (!TypedefT) {
812  return T;
813  }
814 
815  const TypedefNameDecl *D = TypedefT->getDecl();
816  QualType UnderlyingType = D->getUnderlyingType();
817 
818  if (UnderlyingType.hasLocalQualifiers()) {
819  return T;
820  }
821 
822  const auto *ElaboratedT = dyn_cast<ElaboratedType>(UnderlyingType);
823  if (!ElaboratedT) {
824  return T;
825  }
826 
827  if (ElaboratedT->getQualifier() != nullptr) {
828  return T;
829  }
830 
831  QualType NamedType = ElaboratedT->getNamedType();
832  if (NamedType.hasLocalQualifiers()) {
833  return T;
834  }
835 
836  const auto *RecordT = dyn_cast<RecordType>(NamedType);
837  if (!RecordT) {
838  return T;
839  }
840 
841  const IdentifierInfo *TypedefII = TypedefT->getDecl()->getIdentifier();
842  const IdentifierInfo *RecordII = RecordT->getDecl()->getIdentifier();
843  if (!TypedefII || !RecordII ||
844  TypedefII->getName() != RecordII->getName()) {
845  return T;
846  }
847 
848  return RecordT;
849  }
850 
851  void Visit(const Type *T) {
852  T = RemoveTypedef(T);
853  ID.AddInteger(T->getTypeClass());
854  Inherited::Visit(T);
855  }
856 
857  void VisitType(const Type *T) {}
858 
859  void VisitAdjustedType(const AdjustedType *T) {
860  QualType Original = T->getOriginalType();
861  QualType Adjusted = T->getAdjustedType();
862 
863  // The original type and pointee type can be the same, as in the case of
864  // function pointers decaying to themselves. Set a bool and only process
865  // the type once, to prevent doubling the work.
866  SplitQualType split = Adjusted.split();
867  if (auto Pointer = dyn_cast<PointerType>(split.Ty)) {
868  if (Pointer->getPointeeType() == Original) {
869  Hash.AddBoolean(true);
870  ID.AddInteger(split.Quals.getAsOpaqueValue());
871  AddQualType(Original);
872  VisitType(T);
873  return;
874  }
875  }
876 
877  // The original type and pointee type are different, such as in the case
878  // of a array decaying to an element pointer. Set a bool to false and
879  // process both types.
880  Hash.AddBoolean(false);
881  AddQualType(Original);
882  AddQualType(Adjusted);
883 
884  VisitType(T);
885  }
886 
887  void VisitDecayedType(const DecayedType *T) {
888  // getDecayedType and getPointeeType are derived from getAdjustedType
889  // and don't need to be separately processed.
890  VisitAdjustedType(T);
891  }
892 
893  void VisitArrayType(const ArrayType *T) {
894  AddQualType(T->getElementType());
895  ID.AddInteger(T->getSizeModifier());
896  VisitQualifiers(T->getIndexTypeQualifiers());
897  VisitType(T);
898  }
899  void VisitConstantArrayType(const ConstantArrayType *T) {
900  T->getSize().Profile(ID);
901  VisitArrayType(T);
902  }
903 
904  void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
905  AddStmt(T->getSizeExpr());
906  VisitArrayType(T);
907  }
908 
909  void VisitIncompleteArrayType(const IncompleteArrayType *T) {
910  VisitArrayType(T);
911  }
912 
913  void VisitVariableArrayType(const VariableArrayType *T) {
914  AddStmt(T->getSizeExpr());
915  VisitArrayType(T);
916  }
917 
918  void VisitAttributedType(const AttributedType *T) {
919  ID.AddInteger(T->getAttrKind());
920  AddQualType(T->getModifiedType());
921  AddQualType(T->getEquivalentType());
922 
923  VisitType(T);
924  }
925 
926  void VisitBlockPointerType(const BlockPointerType *T) {
927  AddQualType(T->getPointeeType());
928  VisitType(T);
929  }
930 
931  void VisitBuiltinType(const BuiltinType *T) {
932  ID.AddInteger(T->getKind());
933  VisitType(T);
934  }
935 
936  void VisitComplexType(const ComplexType *T) {
937  AddQualType(T->getElementType());
938  VisitType(T);
939  }
940 
941  void VisitDecltypeType(const DecltypeType *T) {
942  AddStmt(T->getUnderlyingExpr());
943  AddQualType(T->getUnderlyingType());
944  VisitType(T);
945  }
946 
947  void VisitDependentDecltypeType(const DependentDecltypeType *T) {
948  VisitDecltypeType(T);
949  }
950 
951  void VisitDeducedType(const DeducedType *T) {
952  AddQualType(T->getDeducedType());
953  VisitType(T);
954  }
955 
956  void VisitAutoType(const AutoType *T) {
957  ID.AddInteger((unsigned)T->getKeyword());
958  ID.AddInteger(T->isConstrained());
959  if (T->isConstrained()) {
960  AddDecl(T->getTypeConstraintConcept());
961  ID.AddInteger(T->getTypeConstraintArguments().size());
962  for (const auto &TA : T->getTypeConstraintArguments())
963  Hash.AddTemplateArgument(TA);
964  }
965  VisitDeducedType(T);
966  }
967 
968  void VisitDeducedTemplateSpecializationType(
970  Hash.AddTemplateName(T->getTemplateName());
971  VisitDeducedType(T);
972  }
973 
974  void VisitDependentAddressSpaceType(const DependentAddressSpaceType *T) {
975  AddQualType(T->getPointeeType());
976  AddStmt(T->getAddrSpaceExpr());
977  VisitType(T);
978  }
979 
980  void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T) {
981  AddQualType(T->getElementType());
982  AddStmt(T->getSizeExpr());
983  VisitType(T);
984  }
985 
986  void VisitFunctionType(const FunctionType *T) {
987  AddQualType(T->getReturnType());
988  T->getExtInfo().Profile(ID);
989  Hash.AddBoolean(T->isConst());
990  Hash.AddBoolean(T->isVolatile());
991  Hash.AddBoolean(T->isRestrict());
992  VisitType(T);
993  }
994 
995  void VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
996  VisitFunctionType(T);
997  }
998 
999  void VisitFunctionProtoType(const FunctionProtoType *T) {
1000  ID.AddInteger(T->getNumParams());
1001  for (auto ParamType : T->getParamTypes())
1002  AddQualType(ParamType);
1003 
1004  VisitFunctionType(T);
1005  }
1006 
1007  void VisitInjectedClassNameType(const InjectedClassNameType *T) {
1008  AddDecl(T->getDecl());
1009  VisitType(T);
1010  }
1011 
1012  void VisitMemberPointerType(const MemberPointerType *T) {
1013  AddQualType(T->getPointeeType());
1014  AddType(T->getClass());
1015  VisitType(T);
1016  }
1017 
1018  void VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
1019  AddQualType(T->getPointeeType());
1020  VisitType(T);
1021  }
1022 
1023  void VisitObjCObjectType(const ObjCObjectType *T) {
1024  AddDecl(T->getInterface());
1025 
1026  auto TypeArgs = T->getTypeArgsAsWritten();
1027  ID.AddInteger(TypeArgs.size());
1028  for (auto Arg : TypeArgs) {
1029  AddQualType(Arg);
1030  }
1031 
1032  auto Protocols = T->getProtocols();
1033  ID.AddInteger(Protocols.size());
1034  for (auto *Protocol : Protocols) {
1035  AddDecl(Protocol);
1036  }
1037 
1038  Hash.AddBoolean(T->isKindOfType());
1039 
1040  VisitType(T);
1041  }
1042 
1043  void VisitObjCInterfaceType(const ObjCInterfaceType *T) {
1044  // This type is handled by the parent type ObjCObjectType.
1045  VisitObjCObjectType(T);
1046  }
1047 
1048  void VisitObjCTypeParamType(const ObjCTypeParamType *T) {
1049  AddDecl(T->getDecl());
1050  auto Protocols = T->getProtocols();
1051  ID.AddInteger(Protocols.size());
1052  for (auto *Protocol : Protocols) {
1053  AddDecl(Protocol);
1054  }
1055 
1056  VisitType(T);
1057  }
1058 
1059  void VisitPackExpansionType(const PackExpansionType *T) {
1060  AddQualType(T->getPattern());
1061  VisitType(T);
1062  }
1063 
1064  void VisitParenType(const ParenType *T) {
1065  AddQualType(T->getInnerType());
1066  VisitType(T);
1067  }
1068 
1069  void VisitPipeType(const PipeType *T) {
1070  AddQualType(T->getElementType());
1071  Hash.AddBoolean(T->isReadOnly());
1072  VisitType(T);
1073  }
1074 
1075  void VisitPointerType(const PointerType *T) {
1076  AddQualType(T->getPointeeType());
1077  VisitType(T);
1078  }
1079 
1080  void VisitReferenceType(const ReferenceType *T) {
1081  AddQualType(T->getPointeeTypeAsWritten());
1082  VisitType(T);
1083  }
1084 
1085  void VisitLValueReferenceType(const LValueReferenceType *T) {
1086  VisitReferenceType(T);
1087  }
1088 
1089  void VisitRValueReferenceType(const RValueReferenceType *T) {
1090  VisitReferenceType(T);
1091  }
1092 
1093  void
1094  VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T) {
1095  AddDecl(T->getAssociatedDecl());
1097  VisitType(T);
1098  }
1099 
1100  void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
1101  AddDecl(T->getAssociatedDecl());
1102  AddQualType(T->getReplacementType());
1103  VisitType(T);
1104  }
1105 
1106  void VisitTagType(const TagType *T) {
1107  AddDecl(T->getDecl());
1108  VisitType(T);
1109  }
1110 
1111  void VisitRecordType(const RecordType *T) { VisitTagType(T); }
1112  void VisitEnumType(const EnumType *T) { VisitTagType(T); }
1113 
1114  void VisitTemplateSpecializationType(const TemplateSpecializationType *T) {
1115  ID.AddInteger(T->template_arguments().size());
1116  for (const auto &TA : T->template_arguments()) {
1117  Hash.AddTemplateArgument(TA);
1118  }
1119  Hash.AddTemplateName(T->getTemplateName());
1120  VisitType(T);
1121  }
1122 
1123  void VisitTemplateTypeParmType(const TemplateTypeParmType *T) {
1124  ID.AddInteger(T->getDepth());
1125  ID.AddInteger(T->getIndex());
1126  Hash.AddBoolean(T->isParameterPack());
1127  AddDecl(T->getDecl());
1128  }
1129 
1130  void VisitTypedefType(const TypedefType *T) {
1131  AddDecl(T->getDecl());
1132  QualType UnderlyingType = T->getDecl()->getUnderlyingType();
1133  VisitQualifiers(UnderlyingType.getQualifiers());
1134  while (true) {
1135  if (const TypedefType *Underlying =
1136  dyn_cast<TypedefType>(UnderlyingType.getTypePtr())) {
1137  UnderlyingType = Underlying->getDecl()->getUnderlyingType();
1138  continue;
1139  }
1140  if (const ElaboratedType *Underlying =
1141  dyn_cast<ElaboratedType>(UnderlyingType.getTypePtr())) {
1142  UnderlyingType = Underlying->getNamedType();
1143  continue;
1144  }
1145 
1146  break;
1147  }
1148  AddType(UnderlyingType.getTypePtr());
1149  VisitType(T);
1150  }
1151 
1152  void VisitTypeOfExprType(const TypeOfExprType *T) {
1153  AddStmt(T->getUnderlyingExpr());
1154  Hash.AddBoolean(T->isSugared());
1155  if (T->isSugared())
1156  AddQualType(T->desugar());
1157 
1158  VisitType(T);
1159  }
1160  void VisitTypeOfType(const TypeOfType *T) {
1161  AddQualType(T->getUnmodifiedType());
1162  VisitType(T);
1163  }
1164 
1165  void VisitTypeWithKeyword(const TypeWithKeyword *T) {
1166  ID.AddInteger(T->getKeyword());
1167  VisitType(T);
1168  };
1169 
1170  void VisitDependentNameType(const DependentNameType *T) {
1171  AddNestedNameSpecifier(T->getQualifier());
1172  AddIdentifierInfo(T->getIdentifier());
1173  VisitTypeWithKeyword(T);
1174  }
1175 
1176  void VisitDependentTemplateSpecializationType(
1178  AddIdentifierInfo(T->getIdentifier());
1179  AddNestedNameSpecifier(T->getQualifier());
1180  ID.AddInteger(T->template_arguments().size());
1181  for (const auto &TA : T->template_arguments()) {
1182  Hash.AddTemplateArgument(TA);
1183  }
1184  VisitTypeWithKeyword(T);
1185  }
1186 
1187  void VisitElaboratedType(const ElaboratedType *T) {
1188  AddNestedNameSpecifier(T->getQualifier());
1189  AddQualType(T->getNamedType());
1190  VisitTypeWithKeyword(T);
1191  }
1192 
1193  void VisitUnaryTransformType(const UnaryTransformType *T) {
1194  AddQualType(T->getUnderlyingType());
1195  AddQualType(T->getBaseType());
1196  VisitType(T);
1197  }
1198 
1199  void VisitUnresolvedUsingType(const UnresolvedUsingType *T) {
1200  AddDecl(T->getDecl());
1201  VisitType(T);
1202  }
1203 
1204  void VisitVectorType(const VectorType *T) {
1205  AddQualType(T->getElementType());
1206  ID.AddInteger(T->getNumElements());
1207  ID.AddInteger(T->getVectorKind());
1208  VisitType(T);
1209  }
1210 
1211  void VisitExtVectorType(const ExtVectorType * T) {
1212  VisitVectorType(T);
1213  }
1214 };
1215 } // namespace
1216 
1217 void ODRHash::AddType(const Type *T) {
1218  assert(T && "Expecting non-null pointer.");
1219  ODRTypeVisitor(ID, *this).Visit(T);
1220 }
1221 
1223  AddBoolean(T.isNull());
1224  if (T.isNull())
1225  return;
1226  SplitQualType split = T.split();
1227  ID.AddInteger(split.Quals.getAsOpaqueValue());
1228  AddType(split.Ty);
1229 }
1230 
1232  Bools.push_back(Value);
1233 }
clang::BuiltinType
This class is used for builtin types like 'int'.
Definition: Type.h:2620
clang::DependentTemplateSpecializationType::getIdentifier
const IdentifierInfo * getIdentifier() const
Definition: Type.h:5782
clang::AccessSpecDecl
Represents an access specifier followed by colon ':'.
Definition: DeclCXX.h:86
clang::PipeType::isReadOnly
bool isReadOnly() const
Definition: Type.h:6500
clang::DeducedTemplateSpecializationType
Represents a C++17 deduced template specialization type.
Definition: Type.h:5293
clang::ParenType::getInnerType
QualType getInnerType() const
Definition: Type.h:2752
clang::NestedNameSpecifier::Identifier
@ Identifier
An identifier, stored as an IdentifierInfo*.
Definition: NestedNameSpecifier.h:81
clang::NestedNameSpecifier::Super
@ Super
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
Definition: NestedNameSpecifier.h:101
clang::DeclContext::decls
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:2178
clang::ODRHash::AddDecl
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:728
clang::DependentSizedExtVectorType::getSizeExpr
Expr * getSizeExpr() const
Definition: Type.h:3333
clang::TypeSourceInfo::getType
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6604
clang::TemplateTemplateParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1745
clang::TemplateTypeParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Definition: DeclTemplate.h:1292
clang::AttributedType
An attributed type is a type to which a type attribute has been applied.
Definition: Type.h:4871
clang::DeclarationName::Identifier
@ Identifier
Definition: DeclarationName.h:209
clang::TemplateTypeParmType::getDecl
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:5047
clang::DeclarationName::CXXLiteralOperatorName
@ CXXLiteralOperatorName
Definition: DeclarationName.h:219
clang::SubstTemplateTypeParmPackType::getArgumentPack
TemplateArgument getArgumentPack() const
Definition: Type.cpp:3698
clang::FunctionType::isVolatile
bool isVolatile() const
Definition: Type.h:3959
clang::AutoType::isConstrained
bool isConstrained() const
Definition: Type.h:5265
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::AutoType::getTypeConstraintConcept
ConceptDecl * getTypeConstraintConcept() const
Definition: Type.h:5261
clang::TemplateTypeParmDecl::getDefaultArgument
QualType getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1278
clang::PipeType::getElementType
QualType getElementType() const
Definition: Type.h:6481
clang::ConstantArrayType
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:3058
clang::TemplateArgument::Null
@ Null
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:67
clang::ODRHash::AddBoolean
void AddBoolean(bool value)
Definition: ODRHash.cpp:1231
clang::DependentSizedArrayType::getSizeExpr
Expr * getSizeExpr() const
Definition: Type.h:3238
clang::DependentNameType::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:5730
clang::ConstantArrayType::getSize
const llvm::APInt & getSize() const
Definition: Type.h:3081
clang::DeclarationName::CXXConstructorName
@ CXXConstructorName
Definition: DeclarationName.h:212
llvm::SmallVector
Definition: LLVM.h:38
clang::NestedNameSpecifier::NamespaceAlias
@ NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
Definition: NestedNameSpecifier.h:87
clang::ImplicitParamDecl::getParameterKind
ImplicitParamKind getParameterKind() const
Returns the implicit parameter kind.
Definition: Decl.h:1702
clang::QualType::getQualifiers
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
Definition: Type.h:6662
clang::ODRHash::AddDeclarationName
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
Definition: ODRHash.cpp:34
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:247
clang::DependentAddressSpaceType::getAddrSpaceExpr
Expr * getAddrSpaceExpr() const
Definition: Type.h:3289
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:737
clang::NonTypeTemplateParmDecl
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Definition: DeclTemplate.h:1410
clang::TypeConstraint::getImmediatelyDeclaredConstraint
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
Definition: ASTConcept.h:187
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition: NestedNameSpecifier.h:50
CHAR_BIT
#define CHAR_BIT
Definition: limits.h:63
clang::DecltypeType::getUnderlyingExpr
Expr * getUnderlyingExpr() const
Definition: Type.h:4700
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2930
clang::ODRHash::clear
void clear()
Definition: ODRHash.cpp:202
clang::Qualifiers
The collection of all-type qualifiers we support.
Definition: Type.h:147
clang::FieldDecl::getInClassInitializer
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set.
Definition: Decl.h:3077
clang::PipeType
PipeType - OpenCL20.
Definition: Type.h:6470
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1712
clang::ObjCObjectPointerType::getPointeeType
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
Definition: Type.h:6282
clang::TemplateArgument::Declaration
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
Definition: TemplateBase.h:74
clang::EnumConstantDecl::getInitExpr
const Expr * getInitExpr() const
Definition: Decl.h:3164
clang::TemplateSubstitutionKind::Specialization
@ Specialization
We are substituting template parameters for template arguments in order to form a template specializa...
clang::DeclarationName::CXXDeductionGuideName
@ CXXDeductionGuideName
Definition: DeclarationName.h:216
clang::TemplateSpecializationType
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5354
clang::ODRHash::AddTemplateParameterList
void AddTemplateParameterList(const TemplateParameterList *TPL)
Definition: ODRHash.cpp:193
clang::FunctionType::getExtInfo
ExtInfo getExtInfo() const
Definition: Type.h:3952
clang::ComplexType::getElementType
QualType getElementType() const
Definition: Type.h:2726
clang::ObjCTypeParamType::getDecl
ObjCTypeParamDecl * getDecl() const
Definition: Type.h:5983
TypeVisitor.h
clang::SubstTemplateTypeParmType::getAssociatedDecl
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: Type.h:5105
clang::TagType
Definition: Type.h:4792
clang::NonTypeTemplateParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1489
clang::Qualifiers::getAsOpaqueValue
unsigned getAsOpaqueValue() const
Definition: Type.h:260
clang::ReferenceType::getPointeeTypeAsWritten
QualType getPointeeTypeAsWritten() const
Definition: Type.h:2896
clang::AutoType::getTypeConstraintArguments
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
Definition: Type.h:5256
clang::RedeclarableTemplateDecl
Declaration of a redeclarable template.
Definition: DeclTemplate.h:763
clang::ObjCPropertyDecl::getPropertyImplementation
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:908
clang::DeclContext::getLexicalParent
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
Definition: DeclBase.h:1939
clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3675
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::FunctionNoProtoType
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
Definition: Type.h:3978
clang::ObjCObjectType::getInterface
ObjCInterfaceDecl * getInterface() const
Gets the interface declaration for this object type, if the base type really is an interface.
Definition: Type.h:6249
clang::ObjCMethodDecl::isOverriding
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
Definition: DeclObjC.h:467
clang::DeclarationName
The name of a declaration.
Definition: DeclarationName.h:144
clang::TemplateArgument::Expression
@ Expression
The template argument is an expression, and we've not resolved it to one of the other forms yet,...
Definition: TemplateBase.h:96
clang::EnumDecl
Represents an enum.
Definition: Decl.h:3705
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1565
clang::TemplateTypeParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1275
clang::TypedefType
Definition: Type.h:4535
clang::ObjCObjectType
Represents a class type in Objective C.
Definition: Type.h:6014
clang::TemplateArgument::Integral
@ Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:82
clang::CXXRecordDecl::getDescribedClassTemplate
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
Definition: DeclCXX.cpp:1839
clang::TemplateArgument::NullPtr
@ NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:78
clang::FunctionDecl::getODRHash
unsigned getODRHash()
Returns ODRHash of the function.
Definition: Decl.cpp:4249
clang::FunctionTemplateDecl
Declaration of a template function.
Definition: DeclTemplate.h:1006
clang::ODRHash::isSubDeclToBeProcessed
static bool isSubDeclToBeProcessed(const Decl *D, const DeclContext *Parent)
Definition: ODRHash.cpp:514
clang::VarDecl::hasInit
bool hasInit() const
Definition: Decl.cpp:2324
clang::PackExpansionType::getPattern
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
Definition: Type.h:5851
clang::NonTypeTemplateParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Definition: DeclTemplate.h:1499
clang::NestedNameSpecifier::Namespace
@ Namespace
A namespace, stored as a NamespaceDecl*.
Definition: NestedNameSpecifier.h:84
clang::ElaboratedType
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
Definition: Type.h:5628
clang::RecordType
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4816
clang::NestedNameSpecifier::getAsIdentifier
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
Definition: NestedNameSpecifier.h:176
clang::PackExpansionType
Represents a pack expansion of types.
Definition: Type.h:5830
clang::ODRHash::AddQualType
void AddQualType(QualType T)
Definition: ODRHash.cpp:1222
clang::Decl::getAccess
AccessSpecifier getAccess() const
Definition: DeclBase.h:491
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:435
clang::ObjCMethodDecl::isDefined
bool isDefined() const
Definition: DeclObjC.h:457
clang::TemplateTypeParmType::getIndex
unsigned getIndex() const
Definition: Type.h:5044
clang::VarDecl::isStaticLocal
bool isStaticLocal() const
Returns true if a variable with function scope is a static local variable.
Definition: Decl.h:1155
clang::DeclContext::getDeclKind
Decl::Kind getDeclKind() const
Definition: DeclBase.h:1916
clang::DeclarationName::CXXDestructorName
@ CXXDestructorName
Definition: DeclarationName.h:213
clang::VectorType
Represents a GCC generic vector type.
Definition: Type.h:3358
clang::FieldDecl::getBitWidth
Expr * getBitWidth() const
Definition: Decl.h:3019
clang::ObjCMethodDecl::getMethodFamily
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
Definition: DeclObjC.cpp:1016
clang::ODRHash::AddFunctionDecl
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
Definition: ODRHash.cpp:592
clang::FriendDecl::getFriendDecl
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
Definition: DeclFriend.h:138
clang::ArrayType
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3012
NestedNameSpecifier.h
clang::MemberPointerType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:2976
clang::TypeOfType
Represents typeof(type), a C2x feature and GCC extension, or `typeof_unqual(type),...
Definition: Type.h:4654
clang::CXXRecordDecl::getNumBases
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition: DeclCXX.h:591
clang::AutoType::getKeyword
AutoTypeKeyword getKeyword() const
Definition: Type.h:5277
clang::TemplateArgument
Represents a template argument.
Definition: TemplateBase.h:61
clang::DeclarationName::CXXOperatorName
@ CXXOperatorName
Definition: DeclarationName.h:215
clang::StaticAssertDecl::getMessage
StringLiteral * getMessage()
Definition: DeclCXX.h:3985
clang::SubstTemplateTypeParmType::getReplacementType
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
Definition: Type.h:5096
clang::ObjCMethodDecl::isDirectMethod
bool isDirectMethod() const
True if the method is tagged as objc_direct.
Definition: DeclObjC.cpp:834
clang::ODRHash::AddTemplateName
void AddTemplateName(TemplateName Name)
Definition: ODRHash.cpp:141
clang::ObjCMethodDecl::getSelfDecl
ImplicitParamDecl * getSelfDecl() const
Definition: DeclObjC.h:423
clang::Decl::getCanonicalDecl
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:943
clang::TypedefNameDecl::getUnderlyingType
QualType getUnderlyingType() const
Definition: Decl.h:3330
clang::TypeOfExprType::desugar
QualType desugar() const
Remove a single level of sugar.
Definition: Type.cpp:3467
clang::AutoType
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5246
clang::VariableArrayType::getSizeExpr
Expr * getSizeExpr() const
Definition: Type.h:3181
clang::ImplicitParamDecl
Definition: Decl.h:1645
clang::ODRHash::AddIdentifierInfo
void AddIdentifierInfo(const IdentifierInfo *II)
Definition: ODRHash.cpp:29
clang::ODRHash::AddTemplateArgument
void AddTemplateArgument(TemplateArgument TA)
Definition: ODRHash.cpp:161
clang::FriendDecl
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:53
clang::TemplateTemplateParmDecl
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Definition: DeclTemplate.h:1627
clang::ObjCMethodDecl::hasSkippedBody
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
Definition: DeclObjC.h:482
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:906
clang::TemplateArgumentLoc::getArgument
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:506
clang::ObjCMethodDecl::getReturnType
QualType getReturnType() const
Definition: DeclObjC.h:332
clang::FunctionProtoType::getParamTypes
ArrayRef< QualType > getParamTypes() const
Definition: Type.h:4234
clang::UnresolvedUsingType
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:4472
clang::TemplateName::Template
@ Template
A single template declaration.
Definition: TemplateName.h:218
clang::TemplateParameterList
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:70
clang::NestedNameSpecifier::Global
@ Global
The global specifier '::'. There is no stored value.
Definition: NestedNameSpecifier.h:97
clang::SplitQualType::Ty
const Type * Ty
The locally-unqualified type.
Definition: Type.h:672
clang::TemplateName::SubstTemplateTemplateParmPack
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
Definition: TemplateName.h:242
clang::CXXRecordDecl::bases
base_class_range bases()
Definition: DeclCXX.h:597
clang::DependentAddressSpaceType
Represents an extended address space qualifier where the input address space value is dependent.
Definition: Type.h:3276
clang::SubstTemplateTypeParmType
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5081
clang::DependentAddressSpaceType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:3290
clang::EnumConstantDecl
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3145
clang::DeclarationName::CXXUsingDirective
@ CXXUsingDirective
Definition: DeclarationName.h:222
clang::MemberPointerType::getClass
const Type * getClass() const
Definition: Type.h:2990
clang::TypeVisitor
An operation on a type.
Definition: TypeVisitor.h:64
Base
clang::SubstTemplateTypeParmPackType
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5154
clang::ObjCPropertyDecl::getType
QualType getType() const
Definition: DeclObjC.h:800
clang::ElaboratedType::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:5666
clang::DependentTemplateSpecializationType::template_arguments
ArrayRef< TemplateArgument > template_arguments() const
Definition: Type.h:5784
clang::BlockPointerType
Pointer to a block type.
Definition: Type.h:2849
clang::TemplateTypeParmDecl
Declaration of a template type parameter.
Definition: DeclTemplate.h:1205
clang::Type::getTypeClass
TypeClass getTypeClass() const
Definition: Type.h:1984
clang::NestedNameSpecifier::TypeSpecWithTemplate
@ TypeSpecWithTemplate
A type that was preceded by the 'template' keyword, stored as a Type*.
Definition: NestedNameSpecifier.h:94
clang::UnaryTransformType::getBaseType
QualType getBaseType() const
Definition: Type.h:4760
clang::AdjustedType
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
Definition: Type.h:2798
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:576
clang::FieldDecl::isMutable
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3005
clang::QualType::split
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6643
Cmd
CompileCommand Cmd
Definition: InterpolatingCompilationDatabase.cpp:129
clang::TagType::getDecl
TagDecl * getDecl() const
Definition: Type.cpp:3537
clang::IncompleteArrayType
Represents a C array with an unspecified size.
Definition: Type.h:3118
clang::VectorType::getVectorKind
VectorKind getVectorKind() const
Definition: Type.h:3405
clang::ODRHash
Definition: ODRHash.h:41
clang::TemplateDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:427
clang::FunctionType::isRestrict
bool isRestrict() const
Definition: Type.h:3960
clang::UnaryTransformType
A unary type transform, which is a type constructed from another.
Definition: Type.h:4733
clang::TemplateTypeParmType
Definition: Type.h:5002
clang::DeducedType::getDeducedType
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it has not been deduced.
Definition: Type.h:5233
clang::DeclarationName::CXXConversionFunctionName
@ CXXConversionFunctionName
Definition: DeclarationName.h:214
clang::ArrayType::getIndexTypeQualifiers
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:3039
clang::DecltypeType::getUnderlyingType
QualType getUnderlyingType() const
Definition: Type.h:4701
clang::TemplateArgument::TemplateExpansion
@ TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:90
clang::ArrayType::getSizeModifier
ArraySizeModifier getSizeModifier() const
Definition: Type.h:3035
remainder
#define remainder(__x, __y)
Definition: tgmath.h:1090
clang::StaticAssertDecl::getAssertExpr
Expr * getAssertExpr()
Definition: DeclCXX.h:3982
clang::ObjCObjectPointerType
Represents a pointer to an Objective C object.
Definition: Type.h:6270
clang::TemplateTemplateParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Definition: DeclTemplate.h:1758
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
clang::NestedNameSpecifier::getAsNamespaceAlias
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
Definition: NestedNameSpecifier.cpp:177
clang::AdjustedType::getAdjustedType
QualType getAdjustedType() const
Definition: Type.h:2812
clang::RISCV::TA
@ TA
Definition: RISCVVIntrinsicUtils.h:98
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::DependentSizedArrayType
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3216
clang::VariableArrayType
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3162
clang::FieldDecl::isBitField
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:3008
clang::NestedNameSpecifier::getAsNamespace
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
Definition: NestedNameSpecifier.cpp:169
clang::TemplateName::QualifiedTemplate
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
Definition: TemplateName.h:229
clang::NonTypeTemplateParmDecl::getDefaultArgument
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1492
clang::TemplateTypeParmDecl::getTypeConstraint
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
Definition: DeclTemplate.h:1372
clang::StaticAssertDecl
Represents a C++11 static_assert declaration.
Definition: DeclCXX.h:3959
clang::TypedefType::getDecl
TypedefNameDecl * getDecl() const
Definition: Type.h:4546
clang::ElaboratedType::getNamedType
QualType getNamedType() const
Retrieve the type named by the qualified-id.
Definition: Type.h:5669
clang::ClassTemplateDecl
Declaration of a class template.
Definition: DeclTemplate.h:2273
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:701
clang::ComplexType
Complex values, per C99 6.2.5p11.
Definition: Type.h:2716
clang::ConstDeclVisitor
A simple visitor class that helps create declaration visitors.
Definition: DeclVisitor.h:73
clang::TemplateName
Represents a C++ template name within the type system.
Definition: TemplateName.h:201
clang::DecltypeType
Represents the type decltype(expr) (C++11).
Definition: Type.h:4690
clang::ODRHash::AddType
void AddType(const Type *T)
Definition: ODRHash.cpp:1217
clang::ObjCObjectType::isKindOfType
bool isKindOfType() const
Whether this ia a "__kindof" type (semantically).
Definition: Type.cpp:788
clang::FunctionProtoType
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4016
clang::TypeOfExprType::getUnderlyingExpr
Expr * getUnderlyingExpr() const
Definition: Type.h:4612
clang::DeclContext::getParent
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1923
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:408
clang::BlockPointerType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:2861
clang::ObjCMethodDecl::isSynthesizedAccessorStub
bool isSynthesizedAccessorStub() const
Definition: DeclObjC.h:449
clang::QualType::isNull
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:802
DeclVisitor.h
Value
Value
Definition: UninitializedValues.cpp:103
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::ODRHash::AddNestedNameSpecifier
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
Definition: ODRHash.cpp:112
clang::ObjCPropertyDecl
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:732
clang::ObjCMethodDecl::isInstanceMethod
bool isInstanceMethod() const
Definition: DeclObjC.h:431
clang::DeclarationName::ObjCZeroArgSelector
@ ObjCZeroArgSelector
Definition: DeclarationName.h:210
clang::DependentSizedExtVectorType::getElementType
QualType getElementType() const
Definition: Type.h:3334
StmtVisitor.h
clang::DeclarationName::ObjCOneArgSelector
@ ObjCOneArgSelector
Definition: DeclarationName.h:211
clang::FunctionProtoType::getNumParams
unsigned getNumParams() const
Definition: Type.h:4227
clang::ODRHash::AddCXXRecordDecl
void AddCXXRecordDecl(const CXXRecordDecl *Record)
Definition: ODRHash.cpp:545
clang::InjectedClassNameType
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5481
clang::TemplateArgumentList
A template argument list.
Definition: DeclTemplate.h:238
clang::TemplateSpecializationType::template_arguments
ArrayRef< TemplateArgument > template_arguments() const
Definition: Type.h:5424
clang::DeclContext::isFileContext
bool isFileContext() const
Definition: DeclBase.h:1993
clang::FunctionType::ExtInfo::Profile
void Profile(llvm::FoldingSetNodeID &ID) const
Definition: Type.h:3905
clang::TemplateParameterList::size
unsigned size() const
Definition: DeclTemplate.h:130
clang::VarDecl::getInit
const Expr * getInit() const
Definition: Decl.h:1315
clang::SplitQualType
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:670
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:85
clang::TemplateParameterList::asArray
ArrayRef< NamedDecl * > asArray()
Definition: DeclTemplate.h:132
clang::TypedefDecl
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3377
clang::TypeOfExprType
Represents a typeof (or typeof) expression (a C2x feature and GCC extension) or a typeof_unqual expre...
Definition: Type.h:4603
clang::TypeWithKeyword
A helper class for Type nodes having an ElaboratedTypeKeyword.
Definition: Type.h:5580
ODRHash.h
clang::TemplateTypeParmDecl::isParameterPack
bool isParameterPack() const
Returns whether this is a parameter pack.
Definition: DeclTemplate.cpp:699
clang::MemberPointerType
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:2960
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::DependentTemplateSpecializationType
Represents a template specialization type whose template cannot be resolved, e.g.
Definition: Type.h:5763
clang::BuiltinType::getKind
Kind getKind() const
Definition: Type.h:2655
clang::TemplateName::SubstTemplateTemplateParm
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
Definition: TemplateName.h:237
clang::ObjCMethodDecl::getBody
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:872
clang::FunctionTemplateDecl::getTemplatedDecl
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Definition: DeclTemplate.h:1052
clang::RValueReferenceType
An rvalue reference type, per C++11 [dcl.ref].
Definition: Type.h:2942
clang::UnresolvedUsingType::getDecl
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4483
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::PointerType
PointerType - C99 6.7.5.1 - Pointer Declarators.
Definition: Type.h:2769
clang::ODRHash::AddStmt
void AddStmt(const Stmt *S)
Definition: ODRHash.cpp:24
clang::ObjCMethodDecl::hasBody
bool hasBody() const override
Determine whether this method has a body.
Definition: DeclObjC.h:527
clang::ObjCMethodDecl::getCmdDecl
ImplicitParamDecl * getCmdDecl() const
Definition: DeclObjC.h:425
clang::ObjCProtocolQualifiers::getProtocols
ArrayRef< ObjCProtocolDecl * > getProtocols() const
Retrieve all of the protocol qualifiers.
Definition: Type.h:5932
clang::IdentifierInfo::getName
StringRef getName() const
Return the actual identifier string.
Definition: IdentifierTable.h:196
clang::Builtin::ID
ID
Definition: Builtins.h:52
clang::TemplateTemplateParmDecl::getDefaultArgument
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1748
clang::TemplateArgument::Type
@ Type
The template argument is a type.
Definition: TemplateBase.h:70
clang::AttributedType::getEquivalentType
QualType getEquivalentType() const
Definition: Type.h:4894
clang::TemplateTypeParmType::getDepth
unsigned getDepth() const
Definition: Type.h:5043
clang
Definition: CalledOnceCheck.h:17
clang::VectorType::getElementType
QualType getElementType() const
Definition: Type.h:3399
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:759
clang::NestedNameSpecifier::getAsType
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
Definition: NestedNameSpecifier.h:196
clang::TemplateArgument::Template
@ Template
The template argument is a template name that was provided for a template template parameter.
Definition: TemplateBase.h:86
clang::NonTypeTemplateParmDecl::isParameterPack
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
Definition: DeclTemplate.h:1524
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:71
clang::ODRHash::AddObjCProtocolDecl
void AddObjCProtocolDecl(const ObjCProtocolDecl *P)
Definition: ODRHash.cpp:703
clang::VarDecl::isConstexpr
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1509
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2050
clang::CXXRecordDecl::hasDefinition
bool hasDefinition() const
Definition: DeclCXX.h:550
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6593
clang::FunctionType::getReturnType
QualType getReturnType() const
Definition: Type.h:3940
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::NestedNameSpecifier::getPrefix
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
Definition: NestedNameSpecifier.h:169
clang::TemplateName::AssumedTemplate
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
Definition: TemplateName.h:225
unsigned
clang::DependentTemplateSpecializationType::getQualifier
NestedNameSpecifier * getQualifier() const
Definition: Type.h:5781
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3275
clang::ODRHash::AddSubDecl
void AddSubDecl(const Decl *D)
Definition: ODRHash.cpp:539
clang::TemplateName::OverloadedTemplate
@ OverloadedTemplate
A set of overloaded template declarations.
Definition: TemplateName.h:221
clang::ObjCMethodDecl::isPropertyAccessor
bool isPropertyAccessor() const
Definition: DeclObjC.h:441
clang::ODRHash::AddEnumDecl
void AddEnumDecl(const EnumDecl *Enum)
Definition: ODRHash.cpp:675
clang::DependentNameType
Represents a qualified type name for which the type name is dependent.
Definition: Type.h:5712
clang::QualType::getTypePtr
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Definition: Type.h:6622
clang::DeducedTemplateSpecializationType::getTemplateName
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
Definition: Type.h:5314
clang::FunctionType::isConst
bool isConst() const
Definition: Type.h:3958
clang::ExtVectorType
ExtVectorType - Extended vector type.
Definition: Type.h:3479
clang::ObjCMethodDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:376
clang::SubstTemplateTypeParmPackType::getAssociatedDecl
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: Type.cpp:3681
Parent
NodeId Parent
Definition: ASTDiff.cpp:190
clang::ReferenceType
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:2880
clang::AttributedType::getAttrKind
Kind getAttrKind() const
Definition: Type.h:4889
clang::PointerType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:2779
clang::NestedNameSpecifier::TypeSpec
@ TypeSpec
A type, stored as a Type*.
Definition: NestedNameSpecifier.h:90
clang::VectorType::getNumElements
unsigned getNumElements() const
Definition: Type.h:3400
clang::ODRHash::CalculateHash
unsigned CalculateHash()
Definition: ODRHash.cpp:208
clang::ObjCTypeParamType
Represents a type parameter type in Objective C.
Definition: Type.h:5939
clang::TypeAliasDecl
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3397
clang::DeclarationName::ObjCMultiArgSelector
@ ObjCMultiArgSelector
Definition: DeclarationName.h:225
clang::ValueDecl::getType
QualType getType() const
Definition: Decl.h:712
clang::InjectedClassNameType::getDecl
CXXRecordDecl * getDecl() const
Definition: Type.cpp:3631
clang::DeducedType
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
Definition: Type.h:5212
clang::RISCV::TypeModifier::Pointer
@ Pointer
clang::ArrayType::getElementType
QualType getElementType() const
Definition: Type.h:3033
clang::RedeclarableTemplateDecl::isMemberSpecialization
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
Definition: DeclTemplate.h:909
clang::TemplateTypeParmType::isParameterPack
bool isParameterPack() const
Definition: Type.h:5045
clang::NestedNameSpecifier::getKind
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
Definition: NestedNameSpecifier.cpp:143
clang::EnumType
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
Definition: Type.h:4842
clang::TypeOfExprType::isSugared
bool isSugared() const
Returns whether this type directly provides sugar.
Definition: Type.cpp:3463
clang::ObjCPropertyDecl::getPropertyAttributes
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:811
clang::ObjCMethodDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
Definition: DeclObjC.h:538
clang::DependentSizedExtVectorType
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3318
clang::AttributedType::getModifiedType
QualType getModifiedType() const
Definition: Type.h:4893
clang::SplitQualType::Quals
Qualifiers Quals
The local qualifiers.
Definition: Type.h:675
clang::DependentNameType::getIdentifier
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
Definition: Type.h:5737
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1904
clang::TypeWithKeyword::getKeyword
ElaboratedTypeKeyword getKeyword() const
Definition: Type.h:5589
clang::DependentDecltypeType
Internal representation of canonical, dependent decltype(expr) types.
Definition: Type.h:4718
clang::ObjCInterfaceType
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:6214
clang::ObjCObjectType::getTypeArgsAsWritten
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
Definition: Type.h:6125
clang::TypeConstraint
Definition: ASTConcept.h:169
clang::TypeOfType::getUnmodifiedType
QualType getUnmodifiedType() const
Definition: Type.h:4669
clang::DecayedType
Represents a pointer type decayed from an array or function type.
Definition: Type.h:2832
clang::AdjustedType::getOriginalType
QualType getOriginalType() const
Definition: Type.h:2811
clang::ObjCMethodDecl::isVariadic
bool isVariadic() const
Definition: DeclObjC.h:436
clang::ParenType
Sugar for parentheses used when specifying types.
Definition: Type.h:2743
clang::QualType::hasLocalQualifiers
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
Definition: Type.h:842
clang::FriendDecl::getFriendType
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:123
clang::ObjCMethodDecl::param_size
unsigned param_size() const
Definition: DeclObjC.h:350
clang::UnaryTransformType::getUnderlyingType
QualType getUnderlyingType() const
Definition: Type.h:4759
clang::TemplateTemplateParmDecl::isParameterPack
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
Definition: DeclTemplate.h:1696
clang::LValueReferenceType
An lvalue reference type, per C++11 [dcl.ref].
Definition: Type.h:2924
clang::TemplateArgument::Pack
@ Pack
The template argument is actually a parameter pack.
Definition: TemplateBase.h:100
clang::CXXMethodDecl
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1983
clang::Decl::getDeclContext
DeclContext * getDeclContext()
Definition: DeclBase.h:441
clang::TemplateSpecializationType::getTemplateName
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:5422
clang::TemplateName::DependentTemplate
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
Definition: TemplateName.h:233
clang::ObjCMethodDecl::getImplementationControl
ImplementationControl getImplementationControl() const
Definition: DeclObjC.h:505
clang::TemplateName::UsingTemplate
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
Definition: TemplateName.h:246