clang 8.0.0

ODRHash.cpp
Go to the documentation of this file.
1 //===-- ODRHash.cpp - Hashing to diagnose ODR failures ----------*- C++ -*-===//
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 /// \file
11 /// This file implements the ODRHash class, which calculates a hash based
12 /// on AST nodes, which is stable across different runs.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #include "clang/AST/ODRHash.h"
17
18 #include "clang/AST/DeclVisitor.h"
19 #include "clang/AST/NestedNameSpecifier.h"
20 #include "clang/AST/StmtVisitor.h"
21 #include "clang/AST/TypeVisitor.h"
22
23 using namespace clang;
24
25 void ODRHash::AddStmt(const Stmt *S) {
26 assert(S && "Expecting non-null pointer.");
27 S->ProcessODRHash(ID, *this);
28 }
29
30 void ODRHash::AddIdentifierInfo(const IdentifierInfo *II) {
31 assert(II && "Expecting non-null pointer.");
32 ID.AddString(II->getName());
33 }
34
35 void ODRHash::AddDeclarationName(DeclarationName Name, bool TreatAsDecl) {
36 if (TreatAsDecl)
37 // Matches the NamedDecl check in AddDecl
38 AddBoolean(true);
39
40 AddDeclarationNameImpl(Name);
41
42 if (TreatAsDecl)
43 // Matches the ClassTemplateSpecializationDecl check in AddDecl
44 AddBoolean(false);
45 }
46
47 void ODRHash::AddDeclarationNameImpl(DeclarationName Name) {
48 // Index all DeclarationName and use index numbers to refer to them.
49 auto Result = DeclNameMap.insert(std::make_pair(Name, DeclNameMap.size()));
50 ID.AddInteger(Result.first->second);
51 if (!Result.second) {
52 // If found in map, the DeclarationName has previously been processed.
53 return;
54 }
55
56 // First time processing each DeclarationName, also process its details.
57 AddBoolean(Name.isEmpty());
58 if (Name.isEmpty())
59 return;
60
61 auto Kind = Name.getNameKind();
62 ID.AddInteger(Kind);
63 switch (Kind) {
64 case DeclarationName::Identifier:
65 AddIdentifierInfo(Name.getAsIdentifierInfo());
66 break;
67 case DeclarationName::ObjCZeroArgSelector:
68 case DeclarationName::ObjCOneArgSelector:
69 case DeclarationName::ObjCMultiArgSelector: {
70 Selector S = Name.getObjCSelector();
71 AddBoolean(S.isNull());
72 AddBoolean(S.isKeywordSelector());
73 AddBoolean(S.isUnarySelector());
74 unsigned NumArgs = S.getNumArgs();
75 for (unsigned i = 0; i < NumArgs; ++i) {
76 AddIdentifierInfo(S.getIdentifierInfoForSlot(i));
77 }
78 break;
79 }
80 case DeclarationName::CXXConstructorName:
81 case DeclarationName::CXXDestructorName:
82 AddQualType(Name.getCXXNameType());
83 break;
84 case DeclarationName::CXXOperatorName:
85 ID.AddInteger(Name.getCXXOverloadedOperator());
86 break;
87 case DeclarationName::CXXLiteralOperatorName:
88 AddIdentifierInfo(Name.getCXXLiteralIdentifier());
89 break;
90 case DeclarationName::CXXConversionFunctionName:
91 AddQualType(Name.getCXXNameType());
92 break;
93 case DeclarationName::CXXUsingDirective:
94 break;
95 case DeclarationName::CXXDeductionGuideName: {
96 auto *Template = Name.getCXXDeductionGuideTemplate();
97 AddBoolean(Template);
98 if (Template) {
99 AddDecl(Template);
100 }
101 }
102 }
103 }
104
105 void ODRHash::AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
106 assert(NNS && "Expecting non-null pointer.");
107 const auto *Prefix = NNS->getPrefix();
108 AddBoolean(Prefix);
109 if (Prefix) {
110 AddNestedNameSpecifier(Prefix);
111 }
112 auto Kind = NNS->getKind();
113 ID.AddInteger(Kind);
114 switch (Kind) {
115 case NestedNameSpecifier::Identifier:
116 AddIdentifierInfo(NNS->getAsIdentifier());
117 break;
118 case NestedNameSpecifier::Namespace:
119 AddDecl(NNS->getAsNamespace());
120 break;
121 case NestedNameSpecifier::NamespaceAlias:
122 AddDecl(NNS->getAsNamespaceAlias());
123 break;
124 case NestedNameSpecifier::TypeSpec:
125 case NestedNameSpecifier::TypeSpecWithTemplate:
126 AddType(NNS->getAsType());
127 break;
128 case NestedNameSpecifier::Global:
129 case NestedNameSpecifier::Super:
130 break;
131 }
132 }
133
134 void ODRHash::AddTemplateName(TemplateName Name) {
135 auto Kind = Name.getKind();
136 ID.AddInteger(Kind);
137
138 switch (Kind) {
139 case TemplateName::Template:
140 AddDecl(Name.getAsTemplateDecl());
141 break;
142 // TODO: Support these cases.
143 case TemplateName::OverloadedTemplate:
144 case TemplateName::QualifiedTemplate:
145 case TemplateName::DependentTemplate:
146 case TemplateName::SubstTemplateTemplateParm:
147 case TemplateName::SubstTemplateTemplateParmPack:
148 break;
149 }
150 }
151
152 void ODRHash::AddTemplateArgument(TemplateArgument TA) {
153 const auto Kind = TA.getKind();
154 ID.AddInteger(Kind);
155
156 switch (Kind) {
157 case TemplateArgument::Null:
158 llvm_unreachable("Expected valid TemplateArgument");
159 case TemplateArgument::Type:
160 AddQualType(TA.getAsType());
161 break;
162 case TemplateArgument::Declaration:
163 AddDecl(TA.getAsDecl());
164 break;
165 case TemplateArgument::NullPtr:
166 case TemplateArgument::Integral:
167 break;
168 case TemplateArgument::Template:
169 case TemplateArgument::TemplateExpansion:
170 AddTemplateName(TA.getAsTemplateOrTemplatePattern());
171 break;
172 case TemplateArgument::Expression:
173 AddStmt(TA.getAsExpr());
174 break;
175 case TemplateArgument::Pack:
176 ID.AddInteger(TA.pack_size());
177 for (auto SubTA : TA.pack_elements()) {
178 AddTemplateArgument(SubTA);
179 }
180 break;
181 }
182 }
183
184 void ODRHash::AddTemplateParameterList(const TemplateParameterList *TPL) {
185 assert(TPL && "Expecting non-null pointer.");
186
187 ID.AddInteger(TPL->size());
188 for (auto *ND : TPL->asArray()) {
189 AddSubDecl(ND);
190 }
191 }
192
193 void ODRHash::clear() {
194 DeclNameMap.clear();
195 Bools.clear();
196 ID.clear();
197 }
198
199 unsigned ODRHash::CalculateHash() {
200 // Append the bools to the end of the data segment backwards. This allows
201 // for the bools data to be compressed 32 times smaller compared to using
202 // ID.AddBoolean
203 const unsigned unsigned_bits = sizeof(unsigned) * CHAR_BIT;
204 const unsigned size = Bools.size();
205 const unsigned remainder = size % unsigned_bits;
206 const unsigned loops = size / unsigned_bits;
207 auto I = Bools.rbegin();
208 unsigned value = 0;
209 for (unsigned i = 0; i < remainder; ++i) {
210 value <<= 1;
211 value |= *I;
212 ++I;
213 }
214 ID.AddInteger(value);
215
216 for (unsigned i = 0; i < loops; ++i) {
217 value = 0;
218 for (unsigned j = 0; j < unsigned_bits; ++j) {
219 value <<= 1;
220 value |= *I;
221 ++I;
222 }
223 ID.AddInteger(value);
224 }
225
226 assert(I == Bools.rend());
227 Bools.clear();
228 return ID.ComputeHash();
229 }
230
231 namespace {
232 // Process a Decl pointer. Add* methods call back into ODRHash while Visit*
233 // methods process the relevant parts of the Decl.
234 class ODRDeclVisitor : public ConstDeclVisitor<ODRDeclVisitor> {
235 typedef ConstDeclVisitor<ODRDeclVisitor> Inherited;
236 llvm::FoldingSetNodeID &ID;
237 ODRHash &Hash;
238
239 public:
240 ODRDeclVisitor(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
241 : ID(ID), Hash(Hash) {}
242
243 void AddStmt(const Stmt *S) {
244 Hash.AddBoolean(S);
245 if (S) {
246 Hash.AddStmt(S);
247 }
248 }
249
250 void AddIdentifierInfo(const IdentifierInfo *II) {
251 Hash.AddBoolean(II);
252 if (II) {
253 Hash.AddIdentifierInfo(II);
254 }
255 }
256
257 void AddQualType(QualType T) {
258 Hash.AddQualType(T);
259 }
260
261 void AddDecl(const Decl *D) {
262 Hash.AddBoolean(D);
263 if (D) {
264 Hash.AddDecl(D);
265 }
266 }
267
268 void AddTemplateArgument(TemplateArgument TA) {
269 Hash.AddTemplateArgument(TA);
270 }
271
272 void Visit(const Decl *D) {
273 ID.AddInteger(D->getKind());
274 Inherited::Visit(D);
275 }
276
277 void VisitNamedDecl(const NamedDecl *D) {
278 Hash.AddDeclarationName(D->getDeclName());
279 Inherited::VisitNamedDecl(D);
280 }
281
282 void VisitValueDecl(const ValueDecl *D) {
283 if (!isa<FunctionDecl>(D)) {
284 AddQualType(D->getType());
285 }
286 Inherited::VisitValueDecl(D);
287 }
288
289 void VisitVarDecl(const VarDecl *D) {
290 Hash.AddBoolean(D->isStaticLocal());
291 Hash.AddBoolean(D->isConstexpr());
292 const bool HasInit = D->hasInit();
293 Hash.AddBoolean(HasInit);
294 if (HasInit) {
295 AddStmt(D->getInit());
296 }
297 Inherited::VisitVarDecl(D);
298 }
299
300 void VisitParmVarDecl(const ParmVarDecl *D) {
301 // TODO: Handle default arguments.
302 Inherited::VisitParmVarDecl(D);
303 }
304
305 void VisitAccessSpecDecl(const AccessSpecDecl *D) {
306 ID.AddInteger(D->getAccess());
307 Inherited::VisitAccessSpecDecl(D);
308 }
309
310 void VisitStaticAssertDecl(const StaticAssertDecl *D) {
311 AddStmt(D->getAssertExpr());
312 AddStmt(D->getMessage());
313
314 Inherited::VisitStaticAssertDecl(D);
315 }
316
317 void VisitFieldDecl(const FieldDecl *D) {
318 const bool IsBitfield = D->isBitField();
319 Hash.AddBoolean(IsBitfield);
320
321 if (IsBitfield) {
322 AddStmt(D->getBitWidth());
323 }
324
325 Hash.AddBoolean(D->isMutable());
326 AddStmt(D->getInClassInitializer());
327
328 Inherited::VisitFieldDecl(D);
329 }
330
331 void VisitFunctionDecl(const FunctionDecl *D) {
332 // Handled by the ODRHash for FunctionDecl
333 ID.AddInteger(D->getODRHash());
334
335 Inherited::VisitFunctionDecl(D);
336 }
337
338 void VisitCXXMethodDecl(const CXXMethodDecl *D) {
339 // Handled by the ODRHash for FunctionDecl
340
341 Inherited::VisitCXXMethodDecl(D);
342 }
343
344 void VisitTypedefNameDecl(const TypedefNameDecl *D) {
345 AddQualType(D->getUnderlyingType());
346
347 Inherited::VisitTypedefNameDecl(D);
348 }
349
350 void VisitTypedefDecl(const TypedefDecl *D) {
351 Inherited::VisitTypedefDecl(D);
352 }
353
354 void VisitTypeAliasDecl(const TypeAliasDecl *D) {
355 Inherited::VisitTypeAliasDecl(D);
356 }
357
358 void VisitFriendDecl(const FriendDecl *D) {
359 TypeSourceInfo *TSI = D->getFriendType();
360 Hash.AddBoolean(TSI);
361 if (TSI) {
362 AddQualType(TSI->getType());
363 } else {
364 AddDecl(D->getFriendDecl());
365 }
366 }
367
368 void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) {
369 // Only care about default arguments as part of the definition.
370 const bool hasDefaultArgument =
371 D->hasDefaultArgument() && !D->defaultArgumentWasInherited();
372 Hash.AddBoolean(hasDefaultArgument);
373 if (hasDefaultArgument) {
374 AddTemplateArgument(D->getDefaultArgument());
375 }
376 Hash.AddBoolean(D->isParameterPack());
377
378 Inherited::VisitTemplateTypeParmDecl(D);
379 }
380
381 void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) {
382 // Only care about default arguments as part of the definition.
383 const bool hasDefaultArgument =
384 D->hasDefaultArgument() && !D->defaultArgumentWasInherited();
385 Hash.AddBoolean(hasDefaultArgument);
386 if (hasDefaultArgument) {
387 AddStmt(D->getDefaultArgument());
388 }
389 Hash.AddBoolean(D->isParameterPack());
390
391 Inherited::VisitNonTypeTemplateParmDecl(D);
392 }
393
394 void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D) {
395 // Only care about default arguments as part of the definition.
396 const bool hasDefaultArgument =
397 D->hasDefaultArgument() && !D->defaultArgumentWasInherited();
398 Hash.AddBoolean(hasDefaultArgument);
399 if (hasDefaultArgument) {
400 AddTemplateArgument(D->getDefaultArgument().getArgument());
401 }
402 Hash.AddBoolean(D->isParameterPack());
403
404 Inherited::VisitTemplateTemplateParmDecl(D);
405 }
406
407 void VisitTemplateDecl(const TemplateDecl *D) {
408 Hash.AddTemplateParameterList(D->getTemplateParameters());
409
410 Inherited::VisitTemplateDecl(D);
411 }
412
413 void VisitRedeclarableTemplateDecl(const RedeclarableTemplateDecl *D) {
414 Hash.AddBoolean(D->isMemberSpecialization());
415 Inherited::VisitRedeclarableTemplateDecl(D);
416 }
417
418 void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
419 AddDecl(D->getTemplatedDecl());
420 ID.AddInteger(D->getTemplatedDecl()->getODRHash());
421 Inherited::VisitFunctionTemplateDecl(D);
422 }
423
424 void VisitEnumConstantDecl(const EnumConstantDecl *D) {
425 AddStmt(D->getInitExpr());
426 Inherited::VisitEnumConstantDecl(D);
427 }
428 };
429 } // namespace
430
431 // Only allow a small portion of Decl's to be processed. Remove this once
432 // all Decl's can be handled.
433 bool ODRHash::isWhitelistedDecl(const Decl *D, const DeclContext *Parent) {
434 if (D->isImplicit()) return false;
435 if (D->getDeclContext() != Parent) return false;
436
437 switch (D->getKind()) {
438 default:
439 return false;
440 case Decl::AccessSpec:
441 case Decl::CXXConstructor:
442 case Decl::CXXDestructor:
443 case Decl::CXXMethod:
444 case Decl::EnumConstant: // Only found in EnumDecl's.
445 case Decl::Field:
446 case Decl::Friend:
447 case Decl::FunctionTemplate:
448 case Decl::StaticAssert:
449 case Decl::TypeAlias:
450 case Decl::Typedef:
451 case Decl::Var:
452 return true;
453 }
454 }
455
456 void ODRHash::AddSubDecl(const Decl *D) {
457 assert(D && "Expecting non-null pointer.");
458
459 ODRDeclVisitor(ID, *this).Visit(D);
460 }
461
462 void ODRHash::AddCXXRecordDecl(const CXXRecordDecl *Record) {
463 assert(Record && Record->hasDefinition() &&
464 "Expected non-null record to be a definition.");
465
466 const DeclContext *DC = Record;
467 while (DC) {
468 if (isa<ClassTemplateSpecializationDecl>(DC)) {
469 return;
470 }
471 DC = DC->getParent();
472 }
473
474 AddDecl(Record);
475
476 // Filter out sub-Decls which will not be processed in order to get an
477 // accurate count of Decl's.
478 llvm::SmallVector<const Decl *, 16> Decls;
479 for (Decl *SubDecl : Record->decls()) {
480 if (isWhitelistedDecl(SubDecl, Record)) {
481 Decls.push_back(SubDecl);
482 if (auto *Function = dyn_cast<FunctionDecl>(SubDecl)) {
483 // Compute/Preload ODRHash into FunctionDecl.
484 Function->getODRHash();
485 }
486 }
487 }
488
489 ID.AddInteger(Decls.size());
490 for (auto SubDecl : Decls) {
491 AddSubDecl(SubDecl);
492 }
493
494 const ClassTemplateDecl *TD = Record->getDescribedClassTemplate();
495 AddBoolean(TD);
496 if (TD) {
497 AddTemplateParameterList(TD->getTemplateParameters());
498 }
499
500 ID.AddInteger(Record->getNumBases());
501 auto Bases = Record->bases();
502 for (auto Base : Bases) {
503 AddQualType(Base.getType());
504 ID.AddInteger(Base.isVirtual());
505 ID.AddInteger(Base.getAccessSpecifierAsWritten());
506 }
507 }
508
509 void ODRHash::AddFunctionDecl(const FunctionDecl *Function,
510 bool SkipBody) {
511 assert(Function && "Expecting non-null pointer.");
512
513 // Skip functions that are specializations or in specialization context.
514 const DeclContext *DC = Function;
515 while (DC) {
516 if (isa<ClassTemplateSpecializationDecl>(DC)) return;
517 if (auto *F = dyn_cast<FunctionDecl>(DC)) {
518 if (F->isFunctionTemplateSpecialization()) {
519 if (!isa<CXXMethodDecl>(DC)) return;
520 if (DC->getLexicalParent()->isFileContext()) return;
521 // Inline method specializations are the only supported
522 // specialization for now.
523 }
524 }
525 DC = DC->getParent();
526 }
527
528 ID.AddInteger(Function->getDeclKind());
529
530 const auto *SpecializationArgs = Function->getTemplateSpecializationArgs();
531 AddBoolean(SpecializationArgs);
532 if (SpecializationArgs) {
533 ID.AddInteger(SpecializationArgs->size());
534 for (const TemplateArgument &TA : SpecializationArgs->asArray()) {
535 AddTemplateArgument(TA);
536 }
537 }
538
539 if (const auto *Method = dyn_cast<CXXMethodDecl>(Function)) {
540 AddBoolean(Method->isConst());
541 AddBoolean(Method->isVolatile());
542 }
543
544 ID.AddInteger(Function->getStorageClass());
545 AddBoolean(Function->isInlineSpecified());
546 AddBoolean(Function->isVirtualAsWritten());
547 AddBoolean(Function->isPure());
548 AddBoolean(Function->isDeletedAsWritten());
549 AddBoolean(Function->isExplicitlyDefaulted());
550
551 AddDecl(Function);
552
553 AddQualType(Function->getReturnType());
554
555 ID.AddInteger(Function->param_size());
556 for (auto Param : Function->parameters())
557 AddSubDecl(Param);
558
559 if (SkipBody) {
560 AddBoolean(false);
561 return;
562 }
563
564 const bool HasBody = Function->isThisDeclarationADefinition() &&
565 !Function->isDefaulted() && !Function->isDeleted() &&
566 !Function->isLateTemplateParsed();
567 AddBoolean(HasBody);
568 if (!HasBody) {
569 return;
570 }
571
572 auto *Body = Function->getBody();
573 AddBoolean(Body);
574 if (Body)
575 AddStmt(Body);
576
577 // Filter out sub-Decls which will not be processed in order to get an
578 // accurate count of Decl's.
579 llvm::SmallVector<const Decl *, 16> Decls;
580 for (Decl *SubDecl : Function->decls()) {
581 if (isWhitelistedDecl(SubDecl, Function)) {
582 Decls.push_back(SubDecl);
583 }
584 }
585
586 ID.AddInteger(Decls.size());
587 for (auto SubDecl : Decls) {
588 AddSubDecl(SubDecl);
589 }
590 }
591
592 void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
593 assert(Enum);
594 AddDeclarationName(Enum->getDeclName());
595
596 AddBoolean(Enum->isScoped());
597 if (Enum->isScoped())
598 AddBoolean(Enum->isScopedUsingClassTag());
599
600 if (Enum->getIntegerTypeSourceInfo())
601 AddQualType(Enum->getIntegerType());
602
603 // Filter out sub-Decls which will not be processed in order to get an
604 // accurate count of Decl's.
605 llvm::SmallVector<const Decl *, 16> Decls;
606 for (Decl *SubDecl : Enum->decls()) {
607 if (isWhitelistedDecl(SubDecl, Enum)) {
608 assert(isa<EnumConstantDecl>(SubDecl) && "Unexpected Decl");
609 Decls.push_back(SubDecl);
610 }
611 }
612
613 ID.AddInteger(Decls.size());
614 for (auto SubDecl : Decls) {
615 AddSubDecl(SubDecl);
616 }
617
618 }
619
620 void ODRHash::AddDecl(const Decl *D) {
621 assert(D && "Expecting non-null pointer.");
622 D = D->getCanonicalDecl();
623
624 const NamedDecl *ND = dyn_cast<NamedDecl>(D);
625 AddBoolean(ND);
626 if (!ND) {
627 ID.AddInteger(D->getKind());
628 return;
629 }
630
631 AddDeclarationName(ND->getDeclName());
632
633 const auto *Specialization =
634 dyn_cast<ClassTemplateSpecializationDecl>(D);
635 AddBoolean(Specialization);
636 if (Specialization) {
637 const TemplateArgumentList &List = Specialization->getTemplateArgs();
638 ID.AddInteger(List.size());
639 for (const TemplateArgument &TA : List.asArray())
640 AddTemplateArgument(TA);
641 }
642 }
643
644 namespace {
645 // Process a Type pointer. Add* methods call back into ODRHash while Visit*
646 // methods process the relevant parts of the Type.
647 class ODRTypeVisitor : public TypeVisitor<ODRTypeVisitor> {
648 typedef TypeVisitor<ODRTypeVisitor> Inherited;
649 llvm::FoldingSetNodeID &ID;
650 ODRHash &Hash;
651
652 public:
653 ODRTypeVisitor(llvm::FoldingSetNodeID &ID, ODRHash &Hash)
654 : ID(ID), Hash(Hash) {}
655
656 void AddStmt(Stmt *S) {
657 Hash.AddBoolean(S);
658 if (S) {
659 Hash.AddStmt(S);
660 }
661 }
662
663 void AddDecl(Decl *D) {
664 Hash.AddBoolean(D);
665 if (D) {
666 Hash.AddDecl(D);
667 }
668 }
669
670 void AddQualType(QualType T) {
671 Hash.AddQualType(T);
672 }
673
674 void AddType(const Type *T) {
675 Hash.AddBoolean(T);
676 if (T) {
677 Hash.AddType(T);
678 }
679 }
680
681 void AddNestedNameSpecifier(const NestedNameSpecifier *NNS) {
682 Hash.AddBoolean(NNS);
683 if (NNS) {
684 Hash.AddNestedNameSpecifier(NNS);
685 }
686 }
687
688 void AddIdentifierInfo(const IdentifierInfo *II) {
689 Hash.AddBoolean(II);
690 if (II) {
691 Hash.AddIdentifierInfo(II);
692 }
693 }
694
695 void VisitQualifiers(Qualifiers Quals) {
696 ID.AddInteger(Quals.getAsOpaqueValue());
697 }
698
699 void Visit(const Type *T) {
700 ID.AddInteger(T->getTypeClass());
701 Inherited::Visit(T);
702 }
703
704 void VisitType(const Type *T) {}
705
706 void VisitAdjustedType(const AdjustedType *T) {
707 AddQualType(T->getOriginalType());
708 AddQualType(T->getAdjustedType());
709 VisitType(T);
710 }
711
712 void VisitDecayedType(const DecayedType *T) {
713 AddQualType(T->getDecayedType());
714 AddQualType(T->getPointeeType());
715 VisitAdjustedType(T);
716 }
717
718 void VisitArrayType(const ArrayType *T) {
719 AddQualType(T->getElementType());
720 ID.AddInteger(T->getSizeModifier());
721 VisitQualifiers(T->getIndexTypeQualifiers());
722 VisitType(T);
723 }
724 void VisitConstantArrayType(const ConstantArrayType *T) {
725 T->getSize().Profile(ID);
726 VisitArrayType(T);
727 }
728
729 void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
730 AddStmt(T->getSizeExpr());
731 VisitArrayType(T);
732 }
733
734 void VisitIncompleteArrayType(const IncompleteArrayType *T) {
735 VisitArrayType(T);
736 }
737
738 void VisitVariableArrayType(const VariableArrayType *T) {
739 AddStmt(T->getSizeExpr());
740 VisitArrayType(T);
741 }
742
743 void VisitAttributedType(const AttributedType *T) {
744 ID.AddInteger(T->getAttrKind());
745 AddQualType(T->getModifiedType());
746 AddQualType(T->getEquivalentType());
747
748 VisitType(T);
749 }
750
751 void VisitBlockPointerType(const BlockPointerType *T) {
752 AddQualType(T->getPointeeType());
753 VisitType(T);
754 }
755
756 void VisitBuiltinType(const BuiltinType *T) {
757 ID.AddInteger(T->getKind());
758 VisitType(T);
759 }
760
761 void VisitComplexType(const ComplexType *T) {
762 AddQualType(T->getElementType());
763 VisitType(T);
764 }
765
766 void VisitDecltypeType(const DecltypeType *T) {
767 AddStmt(T->getUnderlyingExpr());
768 AddQualType(T->getUnderlyingType());
769 VisitType(T);
770 }
771
772 void VisitDependentDecltypeType(const DependentDecltypeType *T) {
773 VisitDecltypeType(T);
774 }
775
776 void VisitDeducedType(const DeducedType *T) {
777 AddQualType(T->getDeducedType());
778 VisitType(T);
779 }
780
781 void VisitAutoType(const AutoType *T) {
782 ID.AddInteger((unsigned)T->getKeyword());
783 VisitDeducedType(T);
784 }
785
786 void VisitDeducedTemplateSpecializationType(
787 const DeducedTemplateSpecializationType *T) {
788 Hash.AddTemplateName(T->getTemplateName());
789 VisitDeducedType(T);
790 }
791
792 void VisitDependentAddressSpaceType(const DependentAddressSpaceType *T) {
793 AddQualType(T->getPointeeType());
794 AddStmt(T->getAddrSpaceExpr());
795 VisitType(T);
796 }
797
798 void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T) {
799 AddQualType(T->getElementType());
800 AddStmt(T->getSizeExpr());
801 VisitType(T);
802 }
803
804 void VisitFunctionType(const FunctionType *T) {
805 AddQualType(T->getReturnType());
806 T->getExtInfo().Profile(ID);
807 Hash.AddBoolean(T->isConst());
808 Hash.AddBoolean(T->isVolatile());
809 Hash.AddBoolean(T->isRestrict());
810 VisitType(T);
811 }
812
813 void VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
814 VisitFunctionType(T);
815 }
816
817 void VisitFunctionProtoType(const FunctionProtoType *T) {
818 ID.AddInteger(T->getNumParams());
819 for (auto ParamType : T->getParamTypes())
820 AddQualType(ParamType);
821
822 VisitFunctionType(T);
823 }
824
825 void VisitInjectedClassNameType(const InjectedClassNameType *T) {
826 AddDecl(T->getDecl());
827 VisitType(T);
828 }
829
830 void VisitMemberPointerType(const MemberPointerType *T) {
831 AddQualType(T->getPointeeType());
832 AddType(T->getClass());
833 VisitType(T);
834 }
835
836 void VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
837 AddQualType(T->getPointeeType());
838 VisitType(T);
839 }
840
841 void VisitObjCObjectType(const ObjCObjectType *T) {
842 AddDecl(T->getInterface());
843
844 auto TypeArgs = T->getTypeArgsAsWritten();
845 ID.AddInteger(TypeArgs.size());
846 for (auto Arg : TypeArgs) {
847 AddQualType(Arg);
848 }
849
850 auto Protocols = T->getProtocols();
851 ID.AddInteger(Protocols.size());
852 for (auto Protocol : Protocols) {
853 AddDecl(Protocol);
854 }
855
856 Hash.AddBoolean(T->isKindOfType());
857
858 VisitType(T);
859 }
860
861 void VisitObjCInterfaceType(const ObjCInterfaceType *T) {
862 // This type is handled by the parent type ObjCObjectType.
863 VisitObjCObjectType(T);
864 }
865
866 void VisitObjCTypeParamType(const ObjCTypeParamType *T) {
867 AddDecl(T->getDecl());
868 auto Protocols = T->getProtocols();
869 ID.AddInteger(Protocols.size());
870 for (auto Protocol : Protocols) {
871 AddDecl(Protocol);
872 }
873
874 VisitType(T);
875 }
876
877 void VisitPackExpansionType(const PackExpansionType *T) {
878 AddQualType(T->getPattern());
879 VisitType(T);
880 }
881
882 void VisitParenType(const ParenType *T) {
883 AddQualType(T->getInnerType());
884 VisitType(T);
885 }
886
887 void VisitPipeType(const PipeType *T) {
888 AddQualType(T->getElementType());
889 Hash.AddBoolean(T->isReadOnly());
890 VisitType(T);
891 }
892
893 void VisitPointerType(const PointerType *T) {
894 AddQualType(T->getPointeeType());
895 VisitType(T);
896 }
897
898 void VisitReferenceType(const ReferenceType *T) {
899 AddQualType(T->getPointeeTypeAsWritten());
900 VisitType(T);
901 }
902
903 void VisitLValueReferenceType(const LValueReferenceType *T) {
904 VisitReferenceType(T);
905 }
906
907 void VisitRValueReferenceType(const RValueReferenceType *T) {
908 VisitReferenceType(T);
909 }
910
911 void
912 VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T) {
913 AddType(T->getReplacedParameter());
914 Hash.AddTemplateArgument(T->getArgumentPack());
915 VisitType(T);
916 }
917
918 void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
919 AddType(T->getReplacedParameter());
920 AddQualType(T->getReplacementType());
921 VisitType(T);
922 }
923
924 void VisitTagType(const TagType *T) {
925 AddDecl(T->getDecl());
926 VisitType(T);
927 }
928
929 void VisitRecordType(const RecordType *T) { VisitTagType(T); }
930 void VisitEnumType(const EnumType *T) { VisitTagType(T); }
931
932 void VisitTemplateSpecializationType(const TemplateSpecializationType *T) {
933 ID.AddInteger(T->getNumArgs());
934 for (const auto &TA : T->template_arguments()) {
935 Hash.AddTemplateArgument(TA);
936 }
937 Hash.AddTemplateName(T->getTemplateName());
938 VisitType(T);
939 }
940
941 void VisitTemplateTypeParmType(const TemplateTypeParmType *T) {
942 ID.AddInteger(T->getDepth());
943 ID.AddInteger(T->getIndex());
944 Hash.AddBoolean(T->isParameterPack());
945 AddDecl(T->getDecl());
946 }
947
948 void VisitTypedefType(const TypedefType *T) {
949 AddDecl(T->getDecl());
950 QualType UnderlyingType = T->getDecl()->getUnderlyingType();
951 VisitQualifiers(UnderlyingType.getQualifiers());
952 while (true) {
953 if (const TypedefType *Underlying =
954 dyn_cast<TypedefType>(UnderlyingType.getTypePtr())) {
955 UnderlyingType = Underlying->getDecl()->getUnderlyingType();
956 continue;
957 }
958 if (const ElaboratedType *Underlying =
959 dyn_cast<ElaboratedType>(UnderlyingType.getTypePtr())) {
960 UnderlyingType = Underlying->getNamedType();
961 continue;
962 }
963
964 break;
965 }
966 AddType(UnderlyingType.getTypePtr());
967 VisitType(T);
968 }
969
970 void VisitTypeOfExprType(const TypeOfExprType *T) {
971 AddStmt(T->getUnderlyingExpr());
972 Hash.AddBoolean(T->isSugared());
973 if (T->isSugared())
974 AddQualType(T->desugar());
975
976 VisitType(T);
977 }
978 void VisitTypeOfType(const TypeOfType *T) {
979 AddQualType(T->getUnderlyingType());
980 VisitType(T);
981 }
982
983 void VisitTypeWithKeyword(const TypeWithKeyword *T) {
984 ID.AddInteger(T->getKeyword());
985 VisitType(T);
986 };
987
988 void VisitDependentNameType(const DependentNameType *T) {
989 AddNestedNameSpecifier(T->getQualifier());
990 AddIdentifierInfo(T->getIdentifier());
991 VisitTypeWithKeyword(T);
992 }
993
994 void VisitDependentTemplateSpecializationType(
995 const DependentTemplateSpecializationType *T) {
996 AddIdentifierInfo(T->getIdentifier());
997 AddNestedNameSpecifier(T->getQualifier());
998 ID.AddInteger(T->getNumArgs());
999 for (const auto &TA : T->template_arguments()) {
1000 Hash.AddTemplateArgument(TA);
1001 }
1002 VisitTypeWithKeyword(T);
1003 }
1004
1005 void VisitElaboratedType(const ElaboratedType *T) {
1006 AddNestedNameSpecifier(T->getQualifier());
1007 AddQualType(T->getNamedType());
1008 VisitTypeWithKeyword(T);
1009 }
1010
1011 void VisitUnaryTransformType(const UnaryTransformType *T) {
1012 AddQualType(T->getUnderlyingType());
1013 AddQualType(T->getBaseType());
1014 VisitType(T);
1015 }
1016
1017 void VisitUnresolvedUsingType(const UnresolvedUsingType *T) {
1018 AddDecl(T->getDecl());
1019 VisitType(T);
1020 }
1021
1022 void VisitVectorType(const VectorType *T) {
1023 AddQualType(T->getElementType());
1024 ID.AddInteger(T->getNumElements());
1025 ID.AddInteger(T->getVectorKind());
1026 VisitType(T);
1027 }
1028
1029 void VisitExtVectorType(const ExtVectorType * T) {
1030 VisitVectorType(T);
1031 }
1032 };
1033 } // namespace
1034
1035 void ODRHash::AddType(const Type *T) {
1036 assert(T && "Expecting non-null pointer.");
1037 ODRTypeVisitor(ID, *this).Visit(T);
1038 }
1039
1040 void ODRHash::AddQualType(QualType T) {
1041 AddBoolean(T.isNull());
1042 if (T.isNull())
1043 return;
1044 SplitQualType split = T.split();
1045 ID.AddInteger(split.Quals.getAsOpaqueValue());
1046 AddType(split.Ty);
1047 }
1048
1049 void ODRHash::AddBoolean(bool Value) {
1050 Bools.push_back(Value);
1051 }
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:5376
clang::DeducedType::getDeducedType
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it&#39;s either not been deduced or was deduce...
Definition: Type.h:4735
clang::ElaboratedType
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
Definition: Type.h:5129
clang::SplitQualType::Ty
const Type * Ty
The locally-unqualified type.
Definition: Type.h:579
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1738
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:673
clang::ODRHash
Definition: ODRHash.h:42
clang::PointerType
PointerType - C99 6.7.5.1 - Pointer Declarators.
Definition: Type.h:2537
clang::ObjCObjectType::getTypeArgsAsWritten
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
Definition: Type.h:5649
clang::PipeType::getElementType
QualType getElementType() const
Definition: Type.h:6016
clang::PointerType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:2550
clang::UnresolvedUsingType
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
Definition: Type.h:4121
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:638
clang::CXXRecordDecl::bases
base_class_range bases()
Definition: DeclCXX.h:823
TypeVisitor.h
clang::ODRHash::AddBoolean
void AddBoolean(bool value)
Definition: ODRHash.cpp:1049
clang::CXXRecordDecl::getNumBases
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition: DeclCXX.h:817
clang::ODRHash::AddDeclarationName
void AddDeclarationName(DeclarationName Name, bool TreatAsDecl=false)
Definition: ODRHash.cpp:35
clang::DecayedType::getDecayedType
QualType getDecayedType() const
Definition: Type.h:2629
ODRHash.h
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes...
clang::FunctionType::ExtInfo::Profile
void Profile(llvm::FoldingSetNodeID &ID) const
Definition: Type.h:3575
clang::DecltypeType::getUnderlyingExpr
Expr * getUnderlyingExpr() const
Definition: Type.h:4256
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:66
clang::FieldDecl::getBitWidth
Expr * getBitWidth() const
Definition: Decl.h:2668
clang::ODRHash::AddQualType
void AddQualType(QualType T)
Definition: ODRHash.cpp:1040
clang::BuiltinType::getKind
Kind getKind() const
Definition: Type.h:2418
clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3355
clang::EnumConstantDecl
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:2786
Base
clang::TypedefDecl
Represents the declaration of a typedef-name via the &#39;typedef&#39; type specifier.
Definition: Decl.h:3018
clang::NestedNameSpecifier::Super
Microsoft&#39;s &#39;__super&#39; specifier, stored as a CXXRecordDecl* of the class it appeared in...
Definition: NestedNameSpecifier.h:100
clang::DependentNameType
Represents a qualified type name for which the type name is dependent.
Definition: Type.h:5212
clang::TemplateArgument::Expression
The template argument is an expression, and we&#39;ve not resolved it to one of the other forms yet...
Definition: TemplateBase.h:87
clang::TemplateArgumentList::size
unsigned size() const
Retrieve the number of template arguments in this template argument list.
Definition: DeclTemplate.h:270
clang::DependentNameType::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:5231
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:87
clang::TagType::getDecl
TagDecl * getDecl() const
Definition: Type.cpp:3166
clang::TemplateParameterList::asArray
ArrayRef< NamedDecl * > asArray()
Definition: DeclTemplate.h:126
clang::DeclarationName::getObjCSelector
Selector getObjCSelector() const
Get the Objective-C selector stored in this declaration name.
Definition: DeclarationName.h:482
clang::NestedNameSpecifier::getPrefix
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
Definition: NestedNameSpecifier.h:168
clang::DeclarationName::getCXXOverloadedOperator
OverloadedOperatorKind getCXXOverloadedOperator() const
If this name is the name of an overloadable operator in C++ (e.g., operator+), retrieve the kind of o...
Definition: DeclarationName.h:463
clang::AutoType
Represents a C++11 auto or C++14 decltype(auto) type.
Definition: Type.h:4749
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1407
clang::ArrayType
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:2812
clang::TemplateArgument::Declaration
The template argument is a declaration that was provided for a pointer, reference, or pointer to member non-type template parameter.
Definition: TemplateBase.h:64
clang::TypeSourceInfo
A container of type source information.
Definition: Decl.h:87
clang::DeclarationName::isEmpty
bool isEmpty() const
Evaluates true when this declaration name is empty.
Definition: DeclarationName.h:373
clang::TemplateTypeParmType::getDecl
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:4569
clang::TemplateName::SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
Definition: TemplateName.h:207
clang::FunctionDecl::isVirtualAsWritten
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2000
clang::FunctionDecl::param_size
size_t param_size() const
Definition: Decl.h:2278
clang::ArrayType::getElementType
QualType getElementType() const
Definition: Type.h:2847
clang::NonTypeTemplateParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
Definition: DeclTemplate.h:1347
Value
Value
Definition: UninitializedValues.cpp:102
clang::DeducedTemplateSpecializationType::getTemplateName
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
Definition: Type.h:4803
clang::NestedNameSpecifier::Identifier
An identifier, stored as an IdentifierInfo*.
Definition: NestedNameSpecifier.h:80
clang::FriendDecl
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
Definition: DeclFriend.h:54
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:813
clang::RedeclarableTemplateDecl
Declaration of a redeclarable template.
Definition: DeclTemplate.h:737
clang::ObjCProtocolQualifiers::getProtocols
ArrayRef< ObjCProtocolDecl * > getProtocols() const
Retrieve all of the protocol qualifiers.
Definition: Type.h:5457
clang::FunctionDecl::getReturnType
QualType getReturnType() const
Definition: Decl.h:2302
clang::FunctionProtoType::getNumParams
unsigned getNumParams() const
Definition: Type.h:3888
clang::NonTypeTemplateParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1337
clang::TemplateArgument::Null
Represents an empty template argument, e.g., one that has not been deduced.
Definition: TemplateBase.h:57
clang::DeclContext::decls
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition: DeclBase.h:1997
clang::DeducedTemplateSpecializationType
Represents a C++17 deduced template specialization type.
Definition: Type.h:4785
clang::DeclarationName::CXXUsingDirective
Definition: DeclarationName.h:216
clang::NestedNameSpecifier::Namespace
A namespace, stored as a NamespaceDecl*.
Definition: NestedNameSpecifier.h:83
clang::FunctionType::isConst
bool isConst() const
Definition: Type.h:3630
clang::TemplateParameterList
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:68
clang::DeclarationName::ObjCOneArgSelector
Definition: DeclarationName.h:206
clang::NestedNameSpecifier::getKind
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
Definition: NestedNameSpecifier.cpp:143
clang::ODRHash::AddTemplateArgument
void AddTemplateArgument(TemplateArgument TA)
Definition: ODRHash.cpp:152
clang::CXXRecordDecl::hasDefinition
bool hasDefinition() const
Definition: DeclCXX.h:776
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1550
clang::SubstTemplateTypeParmType
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:4603
clang::Qualifiers
The collection of all-type qualifiers we support.
Definition: Type.h:141
clang::ODRHash::clear
void clear()
Definition: ODRHash.cpp:193
clang::PipeType
PipeType - OpenCL20.
Definition: Type.h:6002
clang::DeclarationName::CXXDeductionGuideName
Definition: DeclarationName.h:211
clang::NamedDecl::getDeclName
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:298
clang::AdjustedType::getOriginalType
QualType getOriginalType() const
Definition: Type.h:2601
clang::EnumDecl::getIntegerTypeSourceInfo
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
Definition: Decl.h:3496
clang::ClassTemplateSpecializationDecl
Represents a class template specialization, which refers to a class template with a given set of temp...
Definition: DeclTemplate.h:1648
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:58
clang::FriendDecl::getFriendType
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:124
clang::StaticAssertDecl::getMessage
StringLiteral * getMessage()
Definition: DeclCXX.h:3772
clang::ObjCObjectType
Represents a class type in Objective C.
Definition: Type.h:5538
clang::BlockPointerType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:2654
clang::TemplateArgument::getAsExpr
Expr * getAsExpr() const
Retrieve the template argument as an expression.
Definition: TemplateBase.h:330
clang::FunctionProtoType::getParamTypes
ArrayRef< QualType > getParamTypes() const
Definition: Type.h:3895
clang::TemplateArgument::Integral
The template argument is an integral value stored in an llvm::APSInt that was provided for an integra...
Definition: TemplateBase.h:72
clang::TemplateName::getAsTemplateDecl
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
Definition: TemplateName.cpp:96
clang::DeclarationName::getNameKind
NameKind getNameKind() const
Determine what kind of name this is.
Definition: DeclarationName.h:385
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2579
clang::TemplateSpecializationType::getTemplateName
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:4904
clang::NestedNameSpecifier::getAsType
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
Definition: NestedNameSpecifier.h:195
clang::TypeVisitor
An operation on a type.
Definition: TypeVisitor.h:65
clang::FriendDecl::getFriendDecl
NamedDecl * getFriendDecl() const
If this friend declaration doesn&#39;t name a type, return the inner declaration.
Definition: DeclFriend.h:139
clang::SubstTemplateTypeParmPackType
Represents the result of substituting a set of types for a template type parameter pack...
Definition: Type.h:4659
clang::ODRHash::AddTemplateParameterList
void AddTemplateParameterList(const TemplateParameterList *TPL)
Definition: ODRHash.cpp:184
clang::DeclarationName::ObjCZeroArgSelector
Definition: DeclarationName.h:205
clang::AccessSpecDecl
Represents an access specifier followed by colon &#39;:&#39;.
Definition: DeclCXX.h:132
clang::DeclarationName::CXXLiteralOperatorName
Definition: DeclarationName.h:213
clang::FunctionDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:2262
clang::Selector::isUnarySelector
bool isUnarySelector() const
Definition: IdentifierTable.h:750
clang::RValueReferenceType
An rvalue reference type, per C++11 [dcl.ref].
Definition: Type.h:2738
clang::UnresolvedUsingType::getDecl
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4132
clang::FieldDecl::isBitField
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:2657
clang::NestedNameSpecifier::getAsIdentifier
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
Definition: NestedNameSpecifier.h:175
clang::TemplateName::QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written...
Definition: TemplateName.h:199
clang::FunctionDecl::getBody
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
Definition: Decl.cpp:2731
clang::ODRHash::AddDecl
void AddDecl(const Decl *D)
Definition: ODRHash.cpp:620
clang::ODRHash::AddFunctionDecl
void AddFunctionDecl(const FunctionDecl *Function, bool SkipBody=false)
Definition: ODRHash.cpp:509
CHAR_BIT
#define CHAR_BIT
Definition: limits.h:79
clang::RedeclarableTemplateDecl::isMemberSpecialization
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
Definition: DeclTemplate.h:880
clang::NestedNameSpecifier::getAsNamespaceAlias
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
Definition: NestedNameSpecifier.cpp:177
clang::TypeOfExprType
Represents a typeof (or typeof) expression (a GCC extension).
Definition: Type.h:4176
clang::MemberPointerType::getClass
const Type * getClass() const
Definition: Type.h:2790
clang::InjectedClassNameType::getDecl
CXXRecordDecl * getDecl() const
Definition: Type.cpp:3255
clang::VarDecl::isConstexpr
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1382
remainder
#define remainder(__x, __y)
Definition: tgmath.h:1106
clang::DecayedType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:6836
clang::VariableArrayType::getSizeExpr
Expr * getSizeExpr() const
Definition: Type.h:2991
clang::EnumConstantDecl::getInitExpr
const Expr * getInitExpr() const
Definition: Decl.h:2805
clang::TemplateTypeParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1198
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:5773
clang::TemplateTemplateParmDecl::isParameterPack
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
Definition: DeclTemplate.h:1515
clang::DependentSizedArrayType::getSizeExpr
Expr * getSizeExpr() const
Definition: Type.h:3048
clang::ReferenceType::getPointeeTypeAsWritten
QualType getPointeeTypeAsWritten() const
Definition: Type.h:2692
clang::Decl::getCanonicalDecl
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:870
clang::DependentSizedExtVectorType::getElementType
QualType getElementType() const
Definition: Type.h:3144
clang::DependentSizedExtVectorType
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3128
clang::ODRHash::AddTemplateName
void AddTemplateName(TemplateName Name)
Definition: ODRHash.cpp:134
clang::FunctionNoProtoType
Represents a K&R-style &#39;int foo()&#39; function, which has no information available about its arguments...
Definition: Type.h:3650
clang::DependentAddressSpaceType::getAddrSpaceExpr
Expr * getAddrSpaceExpr() const
Definition: Type.h:3099
Parent
NodeId Parent
Definition: ASTDiff.cpp:192
clang::TypeAliasDecl
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3038
clang::FunctionProtoType
Represents a prototype with parameter type info, e.g.
Definition: Type.h:3687
clang::TemplateName::DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
Definition: TemplateName.h:203
clang::NonTypeTemplateParmDecl::isParameterPack
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
Definition: DeclTemplate.h:1372
clang::ObjCTypeParamType::getDecl
ObjCTypeParamDecl * getDecl() const
Definition: Type.h:5507
clang::TemplateArgument::getAsDecl
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:264
clang::DependentSizedArrayType
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3026
clang::TemplateDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:432
clang::DeclContext::getLexicalParent
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
Definition: DeclBase.h:1768
clang::ComplexType::getElementType
QualType getElementType() const
Definition: Type.h:2490
clang::FunctionDecl::isInlineSpecified
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2342
clang::DeclarationName::getCXXNameType
QualType getCXXNameType() const
If this name is one of the C++ names (of a constructor, destructor, or conversion function)...
Definition: DeclarationName.h:440
clang::DependentTemplateSpecializationType::getNumArgs
unsigned getNumArgs() const
Retrieve the number of template arguments.
Definition: Type.h:5299
clang::NestedNameSpecifier::getAsNamespace
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
Definition: NestedNameSpecifier.cpp:169
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:637
clang::FunctionDecl::isDefaulted
bool isDefaulted() const
Whether this function is defaulted per C++0x.
Definition: Decl.h:2034
clang::Qualifiers::getAsOpaqueValue
unsigned getAsOpaqueValue() const
Definition: Type.h:254
clang::EnumDecl::isScopedUsingClassTag
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3523
clang::TemplateTypeParmDecl
Declaration of a template type parameter.
Definition: DeclTemplate.h:1158
clang::TemplateTypeParmType::getIndex
unsigned getIndex() const
Definition: Type.h:4566
clang::DependentDecltypeType
Internal representation of canonical, dependent decltype(expr) types.
Definition: Type.h:4274
clang::TemplateArgument::NullPtr
The template argument is a null pointer or null pointer to member that was provided for a non-type te...
Definition: TemplateBase.h:68
clang::FunctionDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Returns whether this specific declaration of the function is also a definition that does not contain ...
Definition: Decl.h:1983
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:547
clang::FunctionDecl::getTemplateSpecializationArgs
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
Definition: Decl.cpp:3475
clang::DeclContext::isFileContext
bool isFileContext() const
Definition: DeclBase.h:1818
clang::Decl::getDeclContext
DeclContext * getDeclContext()
Definition: DeclBase.h:427
clang::UnaryTransformType::getBaseType
QualType getBaseType() const
Definition: Type.h:4315
clang::DependentNameType::getIdentifier
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
Definition: Type.h:5238
clang::Stmt::ProcessODRHash
void ProcessODRHash(llvm::FoldingSetNodeID &ID, ODRHash &Hash) const
Calculate a unique representation for a statement that is stable across compiler invocations.
Definition: StmtProfile.cpp:2018
clang::FunctionDecl::getStorageClass
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2331
clang::TemplateArgumentList::asArray
ArrayRef< TemplateArgument > asArray() const
Produce this as an array ref.
Definition: DeclTemplate.h:264
clang::NonTypeTemplateParmDecl
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Definition: DeclTemplate.h:1261
DeclVisitor.h
clang::TemplateName
Represents a C++ template name within the type system.
Definition: TemplateName.h:179
clang::DecltypeType
Represents the type decltype(expr) (C++11).
Definition: Type.h:4246
clang::NestedNameSpecifier::NamespaceAlias
A namespace alias, stored as a NamespaceAliasDecl*.
Definition: NestedNameSpecifier.h:86
clang::DeclarationName::getAsIdentifierInfo
IdentifierInfo * getAsIdentifierInfo() const
Retrieve the IdentifierInfo * stored in this declaration name, or null if this declaration name isn&#39;t...
Definition: DeclarationName.h:411
clang::SplitQualType
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:577
clang::TypeOfExprType::desugar
QualType desugar() const
Remove a single level of sugar.
Definition: Type.cpp:3096
clang::UnaryTransformType
A unary type transform, which is a type constructed from another.
Definition: Type.h:4289
StmtVisitor.h
clang::SplitQualType::Quals
Qualifiers Quals
The local qualifiers.
Definition: Type.h:582
clang::DeclContext::getParent
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1752
clang::TypeWithKeyword
A helper class for Type nodes having an ElaboratedTypeKeyword.
Definition: Type.h:5078
clang::VectorType
Represents a GCC generic vector type.
Definition: Type.h:3168
clang::ArrayType::getSizeModifier
ArraySizeModifier getSizeModifier() const
Definition: Type.h:2849
clang::LValueReferenceType
An lvalue reference type, per C++11 [dcl.ref].
Definition: Type.h:2720
clang::TemplateTemplateParmDecl
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Definition: DeclTemplate.h:1446
clang::Selector::getNumArgs
unsigned getNumArgs() const
Definition: IdentifierTable.cpp:414
clang::DeducedType
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
Definition: Type.h:4709
clang::ObjCSubstitutionContext::Result
The result type of a method or function.
clang::QualType::isNull
bool isNull() const
Return true if this QualType doesn&#39;t point to a type yet.
Definition: Type.h:703
clang::NestedNameSpecifier::TypeSpec
A type, stored as a Type*.
Definition: NestedNameSpecifier.h:89
clang::StaticAssertDecl::getAssertExpr
Expr * getAssertExpr()
Definition: DeclCXX.h:3769
clang::TemplateTemplateParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
Definition: DeclTemplate.h:1577
clang::TypeOfExprType::getUnderlyingExpr
Expr * getUnderlyingExpr() const
Definition: Type.h:4185
clang::QualType::split
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6080
clang::TemplateName::SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack...
Definition: TemplateName.h:212
clang::DeclContext::getDeclKind
Decl::Kind getDeclKind() const
Definition: DeclBase.h:1745
Kind
Kind
Definition: ChrootChecker.cpp:29
clang::TypeWithKeyword::getKeyword
ElaboratedTypeKeyword getKeyword() const
Definition: Type.h:5090
clang::Selector::getIdentifierInfoForSlot
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
Definition: IdentifierTable.cpp:425
clang::TemplateTypeParmDecl::isParameterPack
bool isParameterPack() const
Returns whether this is a parameter pack.
Definition: DeclTemplate.cpp:526
clang::FunctionTemplateDecl::getTemplatedDecl
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Definition: DeclTemplate.h:1024
clang::ParenType
Sugar for parentheses used when specifying types.
Definition: Type.h:2507
clang::AdjustedType::getAdjustedType
QualType getAdjustedType() const
Definition: Type.h:2602
clang::FunctionType::getReturnType
QualType getReturnType() const
Definition: Type.h:3613
clang::DeclarationName::CXXConstructorName
Definition: DeclarationName.h:207
clang::FunctionDecl::isPure
bool isPure() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2009
clang::EnumType
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
Definition: Type.h:4396
clang::DeclarationName::Identifier
Definition: DeclarationName.h:204
clang::TypeOfType
Represents typeof(type), a GCC extension.
Definition: Type.h:4219
clang::ObjCInterfaceType
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:5738
clang::ODRHash::AddType
void AddType(const Type *T)
Definition: ODRHash.cpp:1035
clang::SubstTemplateTypeParmPackType::getArgumentPack
TemplateArgument getArgumentPack() const
Definition: Type.cpp:3272
clang::ODRHash::AddIdentifierInfo
void AddIdentifierInfo(const IdentifierInfo *II)
Definition: ODRHash.cpp:30
clang::VectorType::getElementType
QualType getElementType() const
Definition: Type.h:3203
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:2721
clang::FunctionType::isRestrict
bool isRestrict() const
Definition: Type.h:3632
clang::CXXMethodDecl
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2041
clang::NestedNameSpecifier
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Definition: NestedNameSpecifier.h:49
clang::TemplateTypeParmType::isParameterPack
bool isParameterPack() const
Definition: Type.h:4567
clang::TemplateArgument::pack_size
unsigned pack_size() const
The number of template arguments in the given template argument pack.
Definition: TemplateBase.h:360
clang::SubstTemplateTypeParmPackType::getReplacedParameter
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
Definition: Type.h:4677
clang::AttributedType::getEquivalentType
QualType getEquivalentType() const
Definition: Type.h:4451
clang::EnumDecl::isScoped
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3520
clang::ParenType::getInnerType
QualType getInnerType() const
Definition: Type.h:2520
clang::TemplateTemplateParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1564
llvm::SmallVector
Definition: LLVM.h:36
clang::TemplateParameterList::size
unsigned size() const
Definition: DeclTemplate.h:124
clang::ElaboratedType::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:5166
clang::FunctionDecl::getODRHash
unsigned getODRHash()
Returns ODRHash of the function.
Definition: Decl.cpp:3741
clang::AutoType::getKeyword
AutoTypeKeyword getKeyword() const
Definition: Type.h:4764
clang::ArrayType::getIndexTypeQualifiers
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:2853
clang::Type::getTypeClass
TypeClass getTypeClass() const
Definition: Type.h:1811
clang::ODRHash::AddNestedNameSpecifier
void AddNestedNameSpecifier(const NestedNameSpecifier *NNS)
Definition: ODRHash.cpp:105
clang::DependentTemplateSpecializationType::template_arguments
ArrayRef< TemplateArgument > template_arguments() const
Definition: Type.h:5305
clang::FunctionDecl::isExplicitlyDefaulted
bool isExplicitlyDefaulted() const
Whether this function is explicitly defaulted per C++0x.
Definition: Decl.h:2039
clang::StaticAssertDecl
Represents a C++11 static_assert declaration.
Definition: DeclCXX.h:3746
clang::ODRHash::AddSubDecl
void AddSubDecl(const Decl *D)
Definition: ODRHash.cpp:456
clang::ODRHash::AddEnumDecl
void AddEnumDecl(const EnumDecl *Enum)
Definition: ODRHash.cpp:592
clang::DecayedType
Represents a pointer type decayed from an array or function type.
Definition: Type.h:2622
clang::InjectedClassNameType
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:4978
clang::DependentAddressSpaceType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:3100
clang::PackExpansionType
Represents a pack expansion of types.
Definition: Type.h:5355
clang::TemplateArgument::pack_elements
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
Definition: TemplateBase.h:354
clang::IdentifierInfo::getName
StringRef getName() const
Return the actual identifier string.
Definition: IdentifierTable.h:156
NestedNameSpecifier.h
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:2916
clang::TemplateArgument
Represents a template argument.
Definition: TemplateBase.h:51
clang::AdjustedType
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons...
Definition: Type.h:2585
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::FunctionType::getExtInfo
ExtInfo getExtInfo() const
Definition: Type.h:3624
clang::TemplateArgumentLoc::getArgument
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:499
clang::FunctionDecl::isLateTemplateParsed
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
Definition: Decl.h:2013
clang::DependentTemplateSpecializationType::getQualifier
NestedNameSpecifier * getQualifier() const
Definition: Type.h:5290
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1262
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:399
clang::TemplateArgument::TemplateExpansion
The template argument is a pack expansion of a template name that was provided for a template templat...
Definition: TemplateBase.h:80
clang::TypedefNameDecl::getUnderlyingType
QualType getUnderlyingType() const
Definition: Decl.h:2971
clang::Decl::getAccess
AccessSpecifier getAccess() const
Definition: DeclBase.h:462
clang::VarDecl::getInit
const Expr * getInit() const
Definition: Decl.h:1220
clang::DecltypeType::getUnderlyingType
QualType getUnderlyingType() const
Definition: Type.h:4257
clang::ODRHash::AddCXXRecordDecl
void AddCXXRecordDecl(const CXXRecordDecl *Record)
Definition: ODRHash.cpp:462
clang::DeclarationName
The name of a declaration.
Definition: DeclarationName.h:146
clang::VectorType::getVectorKind
VectorKind getVectorKind() const
Definition: Type.h:3213
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:421
clang::Selector::isKeywordSelector
bool isKeywordSelector() const
Definition: IdentifierTable.h:746
clang::ObjCObjectType::isKindOfType
bool isKindOfType() const
Whether this ia a "__kindof" type (semantically).
Definition: Type.cpp:682
clang::EnumDecl
Represents an enum.
Definition: Decl.h:3326
clang::MemberPointerType
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:2756
clang::NonTypeTemplateParmDecl::getDefaultArgument
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1340
clang::DeclarationName::CXXDestructorName
Definition: DeclarationName.h:208
clang::DeclarationName::CXXConversionFunctionName
Definition: DeclarationName.h:209
clang::TemplateTypeParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
Definition: DeclTemplate.h:1215
clang::NestedNameSpecifier::TypeSpecWithTemplate
A type that was preceded by the &#39;template&#39; keyword, stored as a Type*.
Definition: NestedNameSpecifier.h:93
clang::SubstTemplateTypeParmType::getReplacedParameter
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
Definition: Type.h:4618
clang::UnaryTransformType::getUnderlyingType
QualType getUnderlyingType() const
Definition: Type.h:4314
clang::AttributedType::getModifiedType
QualType getModifiedType() const
Definition: Type.h:4450
clang::ObjCObjectPointerType
Represents a pointer to an Objective C object.
Definition: Type.h:5794
clang::BlockPointerType
Pointer to a block type.
Definition: Type.h:2639
clang::DeclarationName::ObjCMultiArgSelector
Definition: DeclarationName.h:218
clang::TypeOfExprType::isSugared
bool isSugared() const
Returns whether this type directly provides sugar.
Definition: Type.cpp:3092
clang::RecordType
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4370
clang::ComplexType
Complex values, per C99 6.2.5p11.
Definition: Type.h:2477
clang::TemplateSpecializationType::getNumArgs
unsigned getNumArgs() const
Retrieve the number of template arguments.
Definition: Type.h:4912
clang::ConstantArrayType::getSize
const llvm::APInt & getSize() const
Definition: Type.h:2890
clang::AttributedType::getAttrKind
Kind getAttrKind() const
Definition: Type.h:4446
clang::VarDecl::isStaticLocal
bool isStaticLocal() const
Returns true if a variable with function scope is a static local variable.
Definition: Decl.h:1060
clang::ExtVectorType
ExtVectorType - Extended vector type.
Definition: Type.h:3287
clang::ReferenceType
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:2673
clang::FunctionType::isVolatile
bool isVolatile() const
Definition: Type.h:3631
clang::ODRHash::CalculateHash
unsigned CalculateHash()
Definition: ODRHash.cpp:199
clang::TemplateArgument::Type
The template argument is a type.
Definition: TemplateBase.h:60
clang::TypeOfType::getUnderlyingType
QualType getUnderlyingType() const
Definition: Type.h:4234
clang::TemplateArgument::Pack
The template argument is actually a parameter pack.
Definition: TemplateBase.h:91
clang::TemplateTemplateParmDecl::getDefaultArgument
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1567
clang::TemplateArgumentList
A template argument list.
Definition: DeclTemplate.h:210
clang::CXXRecordDecl::getDescribedClassTemplate
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
Definition: DeclCXX.cpp:1619
clang::TypedefType::getDecl
TypedefNameDecl * getDecl() const
Definition: Type.h:4167
clang::TemplateArgument::getKind
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:235
clang::TemplateTypeParmType::getDepth
unsigned getDepth() const
Definition: Type.h:4565
clang::AttributedType
An attributed type is a type to which a type attribute has been applied.
Definition: Type.h:4425
clang::DeclarationName::getCXXDeductionGuideTemplate
TemplateDecl * getCXXDeductionGuideTemplate() const
If this name is the name of a C++ deduction guide, return the template associated with that name...
Definition: DeclarationName.h:452
clang::ObjCTypeParamType
Represents a type parameter type in Objective C.
Definition: Type.h:5464
clang::FieldDecl::isMutable
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:2654
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:300
clang::DependentTemplateSpecializationType
Represents a template specialization type whose template cannot be resolved, e.g. ...
Definition: Type.h:5264
clang::TemplateSpecializationType::template_arguments
ArrayRef< TemplateArgument > template_arguments() const
Definition: Type.h:4920
clang::TemplateArgument::Template
The template argument is a template name that was provided for a template template parameter...
Definition: TemplateBase.h:76
clang::IncompleteArrayType
Represents a C array with an unspecified size.
Definition: Type.h:2926
clang::ElaboratedType::getNamedType
QualType getNamedType() const
Retrieve the type named by the qualified-id.
Definition: Type.h:5169
clang::Selector::isNull
bool isNull() const
Determine whether this is the empty selector.
Definition: IdentifierTable.h:743
clang::SubstTemplateTypeParmType::getReplacementType
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
Definition: Type.h:4624
clang::ClassTemplateDecl
Declaration of a class template.
Definition: DeclTemplate.h:2049
clang::BuiltinType
This class is used for builtin types like &#39;int&#39;.
Definition: Type.h:2391
clang::EnumDecl::getIntegerType
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3480
clang::ODRHash::AddStmt
void AddStmt(const Stmt *S)
Definition: ODRHash.cpp:25
clang::TemplateName::getKind
NameKind getKind() const
Definition: TemplateName.cpp:79
clang::VectorType::getNumElements
unsigned getNumElements() const
Definition: Type.h:3204
clang::PipeType::isReadOnly
bool isReadOnly() const
Definition: Type.h:6035
clang::TemplateArgument::getAsType
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:257
clang::DependentAddressSpaceType
Represents an extended address space qualifier where the input address space value is dependent...
Definition: Type.h:3086
clang::TemplateSpecializationType
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:4841
clang::FunctionDecl::isDeleted
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2136
clang::TypedefType
Definition: Type.h:4151
clang::ODRHash::isWhitelistedDecl
static bool isWhitelistedDecl(const Decl *D, const DeclContext *Parent)
Definition: ODRHash.cpp:433
clang::TemplateTypeParmDecl::getDefaultArgument
QualType getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1201
clang::DeclarationName::getCXXLiteralIdentifier
IdentifierInfo * getCXXLiteralIdentifier() const
If this name is the name of a literal operator, retrieve the identifier associated with it...
Definition: DeclarationName.h:473
clang::ValueDecl::getType
QualType getType() const
Definition: Decl.h:648
clang::TemplateName::OverloadedTemplate
A set of overloaded template declarations.
Definition: TemplateName.h:195
clang::DeclarationName::CXXOperatorName
Definition: DeclarationName.h:210
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:249
clang::TagType
Definition: Type.h:4347
clang::TemplateTypeParmType
Definition: Type.h:4522
clang::VariableArrayType
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:2971
clang::ConstDeclVisitor
A simple visitor class that helps create declaration visitors.
Definition: DeclVisitor.h:74
clang::NestedNameSpecifier::Global
The global specifier &#39;::&#39;. There is no stored value.
Definition: NestedNameSpecifier.h:96
clang::TemplateArgument::getAsTemplateOrTemplatePattern
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Definition: TemplateBase.h:288
clang::VarDecl::hasInit
bool hasInit() const
Definition: Decl.cpp:2164
clang::ConstantArrayType
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:2872
clang::FunctionTemplateDecl
Declaration of a template function.
Definition: DeclTemplate.h:969
clang::FunctionDecl::isDeletedAsWritten
bool isDeletedAsWritten() const
Definition: Decl.h:2140
clang::MemberPointerType::getPointeeType
QualType getPointeeType() const
Definition: Type.h:2776
clang::TypeSourceInfo::getType
QualType getType() const
Return the type wrapped by this type source info.
Definition: Decl.h:98
clang::TemplateName::Template
A single template declaration.
Definition: TemplateName.h:192
clang::DependentTemplateSpecializationType::getIdentifier
const IdentifierInfo * getIdentifier() const
Definition: Type.h:5291
clang::DependentSizedExtVectorType::getSizeExpr
Expr * getSizeExpr() const
Definition: Type.h:3143
clang::ObjCObjectPointerType::getPointeeType
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
Definition: Type.h:5810