clang  15.0.0git
ASTWriterDecl.cpp
Go to the documentation of this file.
1 //===--- ASTWriterDecl.cpp - Declaration Serialization --------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements serialization for Declarations.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "ASTCommon.h"
14 #include "clang/AST/Attr.h"
15 #include "clang/AST/DeclCXX.h"
16 #include "clang/AST/DeclTemplate.h"
17 #include "clang/AST/DeclVisitor.h"
18 #include "clang/AST/Expr.h"
19 #include "clang/AST/OpenMPClause.h"
24 #include "llvm/Bitstream/BitstreamWriter.h"
25 #include "llvm/Support/ErrorHandling.h"
26 using namespace clang;
27 using namespace serialization;
28 
29 //===----------------------------------------------------------------------===//
30 // Declaration serialization
31 //===----------------------------------------------------------------------===//
32 
33 namespace clang {
34  class ASTDeclWriter : public DeclVisitor<ASTDeclWriter, void> {
35  ASTWriter &Writer;
36  ASTContext &Context;
37  ASTRecordWriter Record;
38 
40  unsigned AbbrevToUse;
41 
42  public:
43  ASTDeclWriter(ASTWriter &Writer, ASTContext &Context,
45  : Writer(Writer), Context(Context), Record(Writer, Record),
46  Code((serialization::DeclCode)0), AbbrevToUse(0) {}
47 
49  if (!Code)
50  llvm::report_fatal_error(StringRef("unexpected declaration kind '") +
51  D->getDeclKindName() + "'");
52  return Record.Emit(Code, AbbrevToUse);
53  }
54 
55  void Visit(Decl *D);
56 
57  void VisitDecl(Decl *D);
58  void VisitPragmaCommentDecl(PragmaCommentDecl *D);
59  void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D);
60  void VisitTranslationUnitDecl(TranslationUnitDecl *D);
61  void VisitNamedDecl(NamedDecl *D);
62  void VisitLabelDecl(LabelDecl *LD);
63  void VisitNamespaceDecl(NamespaceDecl *D);
64  void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
65  void VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
66  void VisitTypeDecl(TypeDecl *D);
67  void VisitTypedefNameDecl(TypedefNameDecl *D);
68  void VisitTypedefDecl(TypedefDecl *D);
69  void VisitTypeAliasDecl(TypeAliasDecl *D);
70  void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D);
71  void VisitUnresolvedUsingIfExistsDecl(UnresolvedUsingIfExistsDecl *D);
72  void VisitTagDecl(TagDecl *D);
73  void VisitEnumDecl(EnumDecl *D);
74  void VisitRecordDecl(RecordDecl *D);
75  void VisitCXXRecordDecl(CXXRecordDecl *D);
76  void VisitClassTemplateSpecializationDecl(
78  void VisitClassTemplatePartialSpecializationDecl(
80  void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D);
81  void VisitVarTemplatePartialSpecializationDecl(
83  void VisitClassScopeFunctionSpecializationDecl(
85  void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D);
86  void VisitValueDecl(ValueDecl *D);
87  void VisitEnumConstantDecl(EnumConstantDecl *D);
88  void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D);
89  void VisitDeclaratorDecl(DeclaratorDecl *D);
90  void VisitFunctionDecl(FunctionDecl *D);
91  void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D);
92  void VisitCXXMethodDecl(CXXMethodDecl *D);
93  void VisitCXXConstructorDecl(CXXConstructorDecl *D);
94  void VisitCXXDestructorDecl(CXXDestructorDecl *D);
95  void VisitCXXConversionDecl(CXXConversionDecl *D);
96  void VisitFieldDecl(FieldDecl *D);
97  void VisitMSPropertyDecl(MSPropertyDecl *D);
98  void VisitMSGuidDecl(MSGuidDecl *D);
99  void VisitUnnamedGlobalConstantDecl(UnnamedGlobalConstantDecl *D);
100  void VisitTemplateParamObjectDecl(TemplateParamObjectDecl *D);
101  void VisitIndirectFieldDecl(IndirectFieldDecl *D);
102  void VisitVarDecl(VarDecl *D);
103  void VisitImplicitParamDecl(ImplicitParamDecl *D);
104  void VisitParmVarDecl(ParmVarDecl *D);
105  void VisitDecompositionDecl(DecompositionDecl *D);
106  void VisitBindingDecl(BindingDecl *D);
107  void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D);
108  void VisitTemplateDecl(TemplateDecl *D);
109  void VisitConceptDecl(ConceptDecl *D);
110  void VisitRequiresExprBodyDecl(RequiresExprBodyDecl *D);
111  void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D);
112  void VisitClassTemplateDecl(ClassTemplateDecl *D);
113  void VisitVarTemplateDecl(VarTemplateDecl *D);
114  void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
115  void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
116  void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
117  void VisitUsingDecl(UsingDecl *D);
118  void VisitUsingEnumDecl(UsingEnumDecl *D);
119  void VisitUsingPackDecl(UsingPackDecl *D);
120  void VisitUsingShadowDecl(UsingShadowDecl *D);
121  void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D);
122  void VisitLinkageSpecDecl(LinkageSpecDecl *D);
123  void VisitExportDecl(ExportDecl *D);
124  void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
125  void VisitImportDecl(ImportDecl *D);
126  void VisitAccessSpecDecl(AccessSpecDecl *D);
127  void VisitFriendDecl(FriendDecl *D);
128  void VisitFriendTemplateDecl(FriendTemplateDecl *D);
129  void VisitStaticAssertDecl(StaticAssertDecl *D);
130  void VisitBlockDecl(BlockDecl *D);
131  void VisitCapturedDecl(CapturedDecl *D);
132  void VisitEmptyDecl(EmptyDecl *D);
133  void VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D);
134 
135  void VisitDeclContext(DeclContext *DC);
136  template <typename T> void VisitRedeclarable(Redeclarable<T> *D);
137 
138 
139  // FIXME: Put in the same order is DeclNodes.td?
140  void VisitObjCMethodDecl(ObjCMethodDecl *D);
141  void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D);
142  void VisitObjCContainerDecl(ObjCContainerDecl *D);
143  void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
144  void VisitObjCIvarDecl(ObjCIvarDecl *D);
145  void VisitObjCProtocolDecl(ObjCProtocolDecl *D);
146  void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D);
147  void VisitObjCCategoryDecl(ObjCCategoryDecl *D);
148  void VisitObjCImplDecl(ObjCImplDecl *D);
149  void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D);
150  void VisitObjCImplementationDecl(ObjCImplementationDecl *D);
151  void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D);
152  void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
153  void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
154  void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D);
155  void VisitOMPAllocateDecl(OMPAllocateDecl *D);
156  void VisitOMPRequiresDecl(OMPRequiresDecl *D);
157  void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D);
158  void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D);
159  void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D);
160 
161  /// Add an Objective-C type parameter list to the given record.
163  // Empty type parameter list.
164  if (!typeParams) {
165  Record.push_back(0);
166  return;
167  }
168 
169  Record.push_back(typeParams->size());
170  for (auto typeParam : *typeParams) {
171  Record.AddDeclRef(typeParam);
172  }
173  Record.AddSourceLocation(typeParams->getLAngleLoc());
174  Record.AddSourceLocation(typeParams->getRAngleLoc());
175  }
176 
177  /// Add to the record the first declaration from each module file that
178  /// provides a declaration of D. The intent is to provide a sufficient
179  /// set such that reloading this set will load all current redeclarations.
180  void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal) {
181  llvm::MapVector<ModuleFile*, const Decl*> Firsts;
182  // FIXME: We can skip entries that we know are implied by others.
183  for (const Decl *R = D->getMostRecentDecl(); R; R = R->getPreviousDecl()) {
184  if (R->isFromASTFile())
185  Firsts[Writer.Chain->getOwningModuleFile(R)] = R;
186  else if (IncludeLocal)
187  Firsts[nullptr] = R;
188  }
189  for (const auto &F : Firsts)
190  Record.AddDeclRef(F.second);
191  }
192 
193  /// Get the specialization decl from an entry in the specialization list.
194  template <typename EntryType>
196  getSpecializationDecl(EntryType &T) {
198  }
199 
200  /// Get the list of partial specializations from a template's common ptr.
201  template<typename T>
202  decltype(T::PartialSpecializations) &getPartialSpecializations(T *Common) {
203  return Common->PartialSpecializations;
204  }
206  return None;
207  }
208 
209  template<typename DeclTy>
211  auto *Common = D->getCommonPtr();
212 
213  // If we have any lazy specializations, and the external AST source is
214  // our chained AST reader, we can just write out the DeclIDs. Otherwise,
215  // we need to resolve them to actual declarations.
216  if (Writer.Chain != Writer.Context->getExternalSource() &&
217  Common->LazySpecializations) {
218  D->LoadLazySpecializations();
219  assert(!Common->LazySpecializations);
220  }
221 
222  ArrayRef<DeclID> LazySpecializations;
223  if (auto *LS = Common->LazySpecializations)
224  LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
225 
226  // Add a slot to the record for the number of specializations.
227  unsigned I = Record.size();
228  Record.push_back(0);
229 
230  // AddFirstDeclFromEachModule might trigger deserialization, invalidating
231  // *Specializations iterators.
233  for (auto &Entry : Common->Specializations)
234  Specs.push_back(getSpecializationDecl(Entry));
235  for (auto &Entry : getPartialSpecializations(Common))
236  Specs.push_back(getSpecializationDecl(Entry));
237 
238  for (auto *D : Specs) {
239  assert(D->isCanonicalDecl() && "non-canonical decl in set");
240  AddFirstDeclFromEachModule(D, /*IncludeLocal*/true);
241  }
242  Record.append(LazySpecializations.begin(), LazySpecializations.end());
243 
244  // Update the size entry we added earlier.
245  Record[I] = Record.size() - I - 1;
246  }
247 
248  /// Ensure that this template specialization is associated with the specified
249  /// template on reload.
250  void RegisterTemplateSpecialization(const Decl *Template,
251  const Decl *Specialization) {
252  Template = Template->getCanonicalDecl();
253 
254  // If the canonical template is local, we'll write out this specialization
255  // when we emit it.
256  // FIXME: We can do the same thing if there is any local declaration of
257  // the template, to avoid emitting an update record.
258  if (!Template->isFromASTFile())
259  return;
260 
261  // We only need to associate the first local declaration of the
262  // specialization. The other declarations will get pulled in by it.
264  return;
265 
266  Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
268  }
269  };
270 }
271 
274 
275  // Source locations require array (variable-length) abbreviations. The
276  // abbreviation infrastructure requires that arrays are encoded last, so
277  // we handle it here in the case of those classes derived from DeclaratorDecl
278  if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)) {
279  if (auto *TInfo = DD->getTypeSourceInfo())
280  Record.AddTypeLoc(TInfo->getTypeLoc());
281  }
282 
283  // Handle FunctionDecl's body here and write it after all other Stmts/Exprs
284  // have been written. We want it last because we will not read it back when
285  // retrieving it from the AST, we'll just lazily set the offset.
286  if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
287  Record.push_back(FD->doesThisDeclarationHaveABody());
288  if (FD->doesThisDeclarationHaveABody())
289  Record.AddFunctionDefinition(FD);
290  }
291 
292  // If this declaration is also a DeclContext, write blocks for the
293  // declarations that lexically stored inside its context and those
294  // declarations that are visible from its context.
295  if (DeclContext *DC = dyn_cast<DeclContext>(D))
296  VisitDeclContext(DC);
297 }
298 
300  Record.AddDeclRef(cast_or_null<Decl>(D->getDeclContext()));
301  if (D->getDeclContext() != D->getLexicalDeclContext())
302  Record.AddDeclRef(cast_or_null<Decl>(D->getLexicalDeclContext()));
303  else
304  Record.push_back(0);
305  Record.push_back(D->isInvalidDecl());
306  Record.push_back(D->hasAttrs());
307  if (D->hasAttrs())
308  Record.AddAttributes(D->getAttrs());
309  Record.push_back(D->isImplicit());
310  Record.push_back(D->isUsed(false));
311  Record.push_back(D->isReferenced());
312  Record.push_back(D->isTopLevelDeclInObjCContainer());
313  Record.push_back(D->getAccess());
314  Record.push_back((uint64_t)D->getModuleOwnershipKind());
315  Record.push_back(Writer.getSubmoduleID(D->getOwningModule()));
316 
317  // If this declaration injected a name into a context different from its
318  // lexical context, and that context is an imported namespace, we need to
319  // update its visible declarations to include this name.
320  //
321  // This happens when we instantiate a class with a friend declaration or a
322  // function with a local extern declaration, for instance.
323  //
324  // FIXME: Can we handle this in AddedVisibleDecl instead?
325  if (D->isOutOfLine()) {
326  auto *DC = D->getDeclContext();
327  while (auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
328  if (!NS->isFromASTFile())
329  break;
330  Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
331  if (!NS->isInlineNamespace())
332  break;
333  DC = NS->getParent();
334  }
335  }
336 }
337 
339  StringRef Arg = D->getArg();
340  Record.push_back(Arg.size());
341  VisitDecl(D);
342  Record.AddSourceLocation(D->getBeginLoc());
343  Record.push_back(D->getCommentKind());
344  Record.AddString(Arg);
346 }
347 
350  StringRef Name = D->getName();
351  StringRef Value = D->getValue();
352  Record.push_back(Name.size() + 1 + Value.size());
353  VisitDecl(D);
354  Record.AddSourceLocation(D->getBeginLoc());
355  Record.AddString(Name);
356  Record.AddString(Value);
358 }
359 
361  llvm_unreachable("Translation units aren't directly serialized");
362 }
363 
365  VisitDecl(D);
366  Record.AddDeclarationName(D->getDeclName());
367  Record.push_back(needsAnonymousDeclarationNumber(D)
368  ? Writer.getAnonymousDeclarationNumber(D)
369  : 0);
370 }
371 
373  VisitNamedDecl(D);
374  Record.AddSourceLocation(D->getBeginLoc());
375  Record.AddTypeRef(QualType(D->getTypeForDecl(), 0));
376 }
377 
379  VisitRedeclarable(D);
380  VisitTypeDecl(D);
381  Record.AddTypeSourceInfo(D->getTypeSourceInfo());
382  Record.push_back(D->isModed());
383  if (D->isModed())
384  Record.AddTypeRef(D->getUnderlyingType());
385  Record.AddDeclRef(D->getAnonDeclWithTypedefName(false));
386 }
387 
389  VisitTypedefNameDecl(D);
390  if (D->getDeclContext() == D->getLexicalDeclContext() &&
391  !D->hasAttrs() &&
392  !D->isImplicit() &&
393  D->getFirstDecl() == D->getMostRecentDecl() &&
394  !D->isInvalidDecl() &&
396  !D->isModulePrivate() &&
399  AbbrevToUse = Writer.getDeclTypedefAbbrev();
400 
402 }
403 
405  VisitTypedefNameDecl(D);
406  Record.AddDeclRef(D->getDescribedAliasTemplate());
408 }
409 
411  VisitRedeclarable(D);
412  VisitTypeDecl(D);
413  Record.push_back(D->getIdentifierNamespace());
414  Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding
415  if (!isa<CXXRecordDecl>(D))
416  Record.push_back(D->isCompleteDefinition());
417  Record.push_back(D->isEmbeddedInDeclarator());
418  Record.push_back(D->isFreeStanding());
419  Record.push_back(D->isCompleteDefinitionRequired());
420  Record.AddSourceRange(D->getBraceRange());
421 
422  if (D->hasExtInfo()) {
423  Record.push_back(1);
424  Record.AddQualifierInfo(*D->getExtInfo());
425  } else if (auto *TD = D->getTypedefNameForAnonDecl()) {
426  Record.push_back(2);
427  Record.AddDeclRef(TD);
428  Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
429  } else {
430  Record.push_back(0);
431  }
432 }
433 
435  VisitTagDecl(D);
436  Record.AddTypeSourceInfo(D->getIntegerTypeSourceInfo());
437  if (!D->getIntegerTypeSourceInfo())
438  Record.AddTypeRef(D->getIntegerType());
439  Record.AddTypeRef(D->getPromotionType());
440  Record.push_back(D->getNumPositiveBits());
441  Record.push_back(D->getNumNegativeBits());
442  Record.push_back(D->isScoped());
443  Record.push_back(D->isScopedUsingClassTag());
444  Record.push_back(D->isFixed());
445  Record.push_back(D->getODRHash());
446 
447  if (MemberSpecializationInfo *MemberInfo = D->getMemberSpecializationInfo()) {
448  Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
449  Record.push_back(MemberInfo->getTemplateSpecializationKind());
450  Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
451  } else {
452  Record.AddDeclRef(nullptr);
453  }
454 
455  if (D->getDeclContext() == D->getLexicalDeclContext() &&
456  !D->hasAttrs() &&
457  !D->isImplicit() &&
458  !D->isUsed(false) &&
459  !D->hasExtInfo() &&
461  D->getFirstDecl() == D->getMostRecentDecl() &&
462  !D->isInvalidDecl() &&
463  !D->isReferenced() &&
465  D->getAccess() == AS_none &&
466  !D->isModulePrivate() &&
468  !D->getIntegerTypeSourceInfo() &&
472  AbbrevToUse = Writer.getDeclEnumAbbrev();
473 
475 }
476 
478  VisitTagDecl(D);
479  Record.push_back(D->hasFlexibleArrayMember());
480  Record.push_back(D->isAnonymousStructOrUnion());
481  Record.push_back(D->hasObjectMember());
482  Record.push_back(D->hasVolatileMember());
483  Record.push_back(D->isNonTrivialToPrimitiveDefaultInitialize());
484  Record.push_back(D->isNonTrivialToPrimitiveCopy());
485  Record.push_back(D->isNonTrivialToPrimitiveDestroy());
487  Record.push_back(D->hasNonTrivialToPrimitiveDestructCUnion());
488  Record.push_back(D->hasNonTrivialToPrimitiveCopyCUnion());
489  Record.push_back(D->isParamDestroyedInCallee());
490  Record.push_back(D->getArgPassingRestrictions());
491 
492  if (D->getDeclContext() == D->getLexicalDeclContext() &&
493  !D->hasAttrs() &&
494  !D->isImplicit() &&
495  !D->isUsed(false) &&
496  !D->hasExtInfo() &&
498  D->getFirstDecl() == D->getMostRecentDecl() &&
499  !D->isInvalidDecl() &&
500  !D->isReferenced() &&
502  D->getAccess() == AS_none &&
503  !D->isModulePrivate() &&
507  AbbrevToUse = Writer.getDeclRecordAbbrev();
508 
510 }
511 
513  VisitNamedDecl(D);
514  Record.AddTypeRef(D->getType());
515 }
516 
518  VisitValueDecl(D);
519  Record.push_back(D->getInitExpr()? 1 : 0);
520  if (D->getInitExpr())
521  Record.AddStmt(D->getInitExpr());
522  Record.AddAPSInt(D->getInitVal());
523 
525 }
526 
528  VisitValueDecl(D);
529  Record.AddSourceLocation(D->getInnerLocStart());
530  Record.push_back(D->hasExtInfo());
531  if (D->hasExtInfo()) {
532  DeclaratorDecl::ExtInfo *Info = D->getExtInfo();
533  Record.AddQualifierInfo(*Info);
534  Record.AddStmt(Info->TrailingRequiresClause);
535  }
536  // The location information is deferred until the end of the record.
537  Record.AddTypeRef(D->getTypeSourceInfo() ? D->getTypeSourceInfo()->getType()
538  : QualType());
539 }
540 
542  VisitRedeclarable(D);
543  VisitDeclaratorDecl(D);
544  Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName());
545  Record.push_back(D->getIdentifierNamespace());
546 
547  // FunctionDecl's body is handled last at ASTWriterDecl::Visit,
548  // after everything else is written.
549  Record.push_back(static_cast<int>(D->getStorageClass())); // FIXME: stable encoding
550  Record.push_back(D->isInlineSpecified());
551  Record.push_back(D->isInlined());
552  Record.push_back(D->isVirtualAsWritten());
553  Record.push_back(D->isPure());
554  Record.push_back(D->hasInheritedPrototype());
555  Record.push_back(D->hasWrittenPrototype());
556  Record.push_back(D->isDeletedBit());
557  Record.push_back(D->isTrivial());
558  Record.push_back(D->isTrivialForCall());
559  Record.push_back(D->isDefaulted());
560  Record.push_back(D->isExplicitlyDefaulted());
561  Record.push_back(D->hasImplicitReturnZero());
562  Record.push_back(static_cast<uint64_t>(D->getConstexprKind()));
563  Record.push_back(D->usesSEHTry());
564  Record.push_back(D->hasSkippedBody());
565  Record.push_back(D->isMultiVersion());
566  Record.push_back(D->isLateTemplateParsed());
567  Record.push_back(D->getLinkageInternal());
568  Record.AddSourceLocation(D->getEndLoc());
569 
570  Record.push_back(D->getODRHash());
571 
572  if (D->isDefaulted()) {
573  if (auto *FDI = D->getDefaultedFunctionInfo()) {
574  Record.push_back(FDI->getUnqualifiedLookups().size());
575  for (DeclAccessPair P : FDI->getUnqualifiedLookups()) {
576  Record.AddDeclRef(P.getDecl());
577  Record.push_back(P.getAccess());
578  }
579  } else {
580  Record.push_back(0);
581  }
582  }
583 
584  Record.push_back(D->getTemplatedKind());
585  switch (D->getTemplatedKind()) {
587  break;
589  Record.AddDeclRef(D->getDescribedFunctionTemplate());
590  break;
593  Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
594  Record.push_back(MemberInfo->getTemplateSpecializationKind());
595  Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
596  break;
597  }
600  FTSInfo = D->getTemplateSpecializationInfo();
601 
602  RegisterTemplateSpecialization(FTSInfo->getTemplate(), D);
603 
604  Record.AddDeclRef(FTSInfo->getTemplate());
605  Record.push_back(FTSInfo->getTemplateSpecializationKind());
606 
607  // Template arguments.
608  Record.AddTemplateArgumentList(FTSInfo->TemplateArguments);
609 
610  // Template args as written.
611  Record.push_back(FTSInfo->TemplateArgumentsAsWritten != nullptr);
612  if (FTSInfo->TemplateArgumentsAsWritten) {
613  Record.push_back(FTSInfo->TemplateArgumentsAsWritten->NumTemplateArgs);
614  for (int i=0, e = FTSInfo->TemplateArgumentsAsWritten->NumTemplateArgs;
615  i!=e; ++i)
616  Record.AddTemplateArgumentLoc(
617  (*FTSInfo->TemplateArgumentsAsWritten)[i]);
618  Record.AddSourceLocation(FTSInfo->TemplateArgumentsAsWritten->LAngleLoc);
619  Record.AddSourceLocation(FTSInfo->TemplateArgumentsAsWritten->RAngleLoc);
620  }
621 
622  Record.AddSourceLocation(FTSInfo->getPointOfInstantiation());
623 
624  if (MemberSpecializationInfo *MemberInfo =
625  FTSInfo->getMemberSpecializationInfo()) {
626  Record.push_back(1);
627  Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
628  Record.push_back(MemberInfo->getTemplateSpecializationKind());
629  Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
630  } else {
631  Record.push_back(0);
632  }
633 
634  if (D->isCanonicalDecl()) {
635  // Write the template that contains the specializations set. We will
636  // add a FunctionTemplateSpecializationInfo to it when reading.
637  Record.AddDeclRef(FTSInfo->getTemplate()->getCanonicalDecl());
638  }
639  break;
640  }
643  DFTSInfo = D->getDependentSpecializationInfo();
644 
645  // Templates.
646  Record.push_back(DFTSInfo->getNumTemplates());
647  for (int i=0, e = DFTSInfo->getNumTemplates(); i != e; ++i)
648  Record.AddDeclRef(DFTSInfo->getTemplate(i));
649 
650  // Templates args.
651  Record.push_back(DFTSInfo->getNumTemplateArgs());
652  for (int i=0, e = DFTSInfo->getNumTemplateArgs(); i != e; ++i)
653  Record.AddTemplateArgumentLoc(DFTSInfo->getTemplateArg(i));
654  Record.AddSourceLocation(DFTSInfo->getLAngleLoc());
655  Record.AddSourceLocation(DFTSInfo->getRAngleLoc());
656  break;
657  }
658  }
659 
660  Record.push_back(D->param_size());
661  for (auto P : D->parameters())
662  Record.AddDeclRef(P);
664 }
665 
667  ASTRecordWriter &Record) {
668  uint64_t Kind = static_cast<uint64_t>(ES.getKind());
669  Kind = Kind << 1 | static_cast<bool>(ES.getExpr());
670  Record.push_back(Kind);
671  if (ES.getExpr()) {
672  Record.AddStmt(ES.getExpr());
673  }
674 }
675 
678  Record.AddDeclRef(D->Ctor);
679  VisitFunctionDecl(D);
680  Record.push_back(D->isCopyDeductionCandidate());
682 }
683 
685  VisitNamedDecl(D);
686  // FIXME: convert to LazyStmtPtr?
687  // Unlike C/C++, method bodies will never be in header files.
688  bool HasBodyStuff = D->getBody() != nullptr;
689  Record.push_back(HasBodyStuff);
690  if (HasBodyStuff) {
691  Record.AddStmt(D->getBody());
692  }
693  Record.AddDeclRef(D->getSelfDecl());
694  Record.AddDeclRef(D->getCmdDecl());
695  Record.push_back(D->isInstanceMethod());
696  Record.push_back(D->isVariadic());
697  Record.push_back(D->isPropertyAccessor());
698  Record.push_back(D->isSynthesizedAccessorStub());
699  Record.push_back(D->isDefined());
700  Record.push_back(D->isOverriding());
701  Record.push_back(D->hasSkippedBody());
702 
703  Record.push_back(D->isRedeclaration());
704  Record.push_back(D->hasRedeclaration());
705  if (D->hasRedeclaration()) {
706  assert(Context.getObjCMethodRedeclaration(D));
707  Record.AddDeclRef(Context.getObjCMethodRedeclaration(D));
708  }
709 
710  // FIXME: stable encoding for @required/@optional
711  Record.push_back(D->getImplementationControl());
712  // FIXME: stable encoding for in/out/inout/bycopy/byref/oneway/nullability
713  Record.push_back(D->getObjCDeclQualifier());
714  Record.push_back(D->hasRelatedResultType());
715  Record.AddTypeRef(D->getReturnType());
716  Record.AddTypeSourceInfo(D->getReturnTypeSourceInfo());
717  Record.AddSourceLocation(D->getEndLoc());
718  Record.push_back(D->param_size());
719  for (const auto *P : D->parameters())
720  Record.AddDeclRef(P);
721 
722  Record.push_back(D->getSelLocsKind());
723  unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
724  SourceLocation *SelLocs = D->getStoredSelLocs();
725  Record.push_back(NumStoredSelLocs);
726  for (unsigned i = 0; i != NumStoredSelLocs; ++i)
727  Record.AddSourceLocation(SelLocs[i]);
728 
730 }
731 
733  VisitTypedefNameDecl(D);
734  Record.push_back(D->Variance);
735  Record.push_back(D->Index);
736  Record.AddSourceLocation(D->VarianceLoc);
737  Record.AddSourceLocation(D->ColonLoc);
738 
740 }
741 
743  VisitNamedDecl(D);
744  Record.AddSourceLocation(D->getAtStartLoc());
745  Record.AddSourceRange(D->getAtEndRange());
746  // Abstract class (no need to define a stable serialization::DECL code).
747 }
748 
750  VisitRedeclarable(D);
751  VisitObjCContainerDecl(D);
752  Record.AddTypeRef(QualType(D->getTypeForDecl(), 0));
753  AddObjCTypeParamList(D->TypeParamList);
754 
755  Record.push_back(D->isThisDeclarationADefinition());
756  if (D->isThisDeclarationADefinition()) {
757  // Write the DefinitionData
758  ObjCInterfaceDecl::DefinitionData &Data = D->data();
759 
760  Record.AddTypeSourceInfo(D->getSuperClassTInfo());
761  Record.AddSourceLocation(D->getEndOfDefinitionLoc());
762  Record.push_back(Data.HasDesignatedInitializers);
763 
764  // Write out the protocols that are directly referenced by the @interface.
765  Record.push_back(Data.ReferencedProtocols.size());
766  for (const auto *P : D->protocols())
767  Record.AddDeclRef(P);
768  for (const auto &PL : D->protocol_locs())
769  Record.AddSourceLocation(PL);
770 
771  // Write out the protocols that are transitively referenced.
772  Record.push_back(Data.AllReferencedProtocols.size());
774  P = Data.AllReferencedProtocols.begin(),
775  PEnd = Data.AllReferencedProtocols.end();
776  P != PEnd; ++P)
777  Record.AddDeclRef(*P);
778 
779 
780  if (ObjCCategoryDecl *Cat = D->getCategoryListRaw()) {
781  // Ensure that we write out the set of categories for this class.
782  Writer.ObjCClassesWithCategories.insert(D);
783 
784  // Make sure that the categories get serialized.
785  for (; Cat; Cat = Cat->getNextClassCategoryRaw())
786  (void)Writer.GetDeclRef(Cat);
787  }
788  }
789 
791 }
792 
794  VisitFieldDecl(D);
795  // FIXME: stable encoding for @public/@private/@protected/@package
796  Record.push_back(D->getAccessControl());
797  Record.push_back(D->getSynthesize());
798 
799  if (D->getDeclContext() == D->getLexicalDeclContext() &&
800  !D->hasAttrs() &&
801  !D->isImplicit() &&
802  !D->isUsed(false) &&
803  !D->isInvalidDecl() &&
804  !D->isReferenced() &&
805  !D->isModulePrivate() &&
806  !D->getBitWidth() &&
807  !D->hasExtInfo() &&
808  D->getDeclName())
809  AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
810 
812 }
813 
815  VisitRedeclarable(D);
816  VisitObjCContainerDecl(D);
817 
818  Record.push_back(D->isThisDeclarationADefinition());
819  if (D->isThisDeclarationADefinition()) {
820  Record.push_back(D->protocol_size());
821  for (const auto *I : D->protocols())
822  Record.AddDeclRef(I);
823  for (const auto &PL : D->protocol_locs())
824  Record.AddSourceLocation(PL);
825  }
826 
828 }
829 
831  VisitFieldDecl(D);
833 }
834 
836  VisitObjCContainerDecl(D);
837  Record.AddSourceLocation(D->getCategoryNameLoc());
838  Record.AddSourceLocation(D->getIvarLBraceLoc());
839  Record.AddSourceLocation(D->getIvarRBraceLoc());
840  Record.AddDeclRef(D->getClassInterface());
841  AddObjCTypeParamList(D->TypeParamList);
842  Record.push_back(D->protocol_size());
843  for (const auto *I : D->protocols())
844  Record.AddDeclRef(I);
845  for (const auto &PL : D->protocol_locs())
846  Record.AddSourceLocation(PL);
848 }
849 
851  VisitNamedDecl(D);
852  Record.AddDeclRef(D->getClassInterface());
854 }
855 
857  VisitNamedDecl(D);
858  Record.AddSourceLocation(D->getAtLoc());
859  Record.AddSourceLocation(D->getLParenLoc());
860  Record.AddTypeRef(D->getType());
861  Record.AddTypeSourceInfo(D->getTypeSourceInfo());
862  // FIXME: stable encoding
863  Record.push_back((unsigned)D->getPropertyAttributes());
864  Record.push_back((unsigned)D->getPropertyAttributesAsWritten());
865  // FIXME: stable encoding
866  Record.push_back((unsigned)D->getPropertyImplementation());
867  Record.AddDeclarationName(D->getGetterName());
868  Record.AddSourceLocation(D->getGetterNameLoc());
869  Record.AddDeclarationName(D->getSetterName());
870  Record.AddSourceLocation(D->getSetterNameLoc());
871  Record.AddDeclRef(D->getGetterMethodDecl());
872  Record.AddDeclRef(D->getSetterMethodDecl());
873  Record.AddDeclRef(D->getPropertyIvarDecl());
875 }
876 
878  VisitObjCContainerDecl(D);
879  Record.AddDeclRef(D->getClassInterface());
880  // Abstract class (no need to define a stable serialization::DECL code).
881 }
882 
884  VisitObjCImplDecl(D);
885  Record.AddSourceLocation(D->getCategoryNameLoc());
887 }
888 
890  VisitObjCImplDecl(D);
891  Record.AddDeclRef(D->getSuperClass());
892  Record.AddSourceLocation(D->getSuperClassLoc());
893  Record.AddSourceLocation(D->getIvarLBraceLoc());
894  Record.AddSourceLocation(D->getIvarRBraceLoc());
895  Record.push_back(D->hasNonZeroConstructors());
896  Record.push_back(D->hasDestructors());
897  Record.push_back(D->NumIvarInitializers);
898  if (D->NumIvarInitializers)
899  Record.AddCXXCtorInitializers(
900  llvm::makeArrayRef(D->init_begin(), D->init_end()));
902 }
903 
905  VisitDecl(D);
906  Record.AddSourceLocation(D->getBeginLoc());
907  Record.AddDeclRef(D->getPropertyDecl());
908  Record.AddDeclRef(D->getPropertyIvarDecl());
909  Record.AddSourceLocation(D->getPropertyIvarDeclLoc());
910  Record.AddDeclRef(D->getGetterMethodDecl());
911  Record.AddDeclRef(D->getSetterMethodDecl());
912  Record.AddStmt(D->getGetterCXXConstructor());
913  Record.AddStmt(D->getSetterCXXAssignment());
915 }
916 
918  VisitDeclaratorDecl(D);
919  Record.push_back(D->isMutable());
920 
921  FieldDecl::InitStorageKind ISK = D->InitStorage.getInt();
922  Record.push_back(ISK);
923  if (ISK == FieldDecl::ISK_CapturedVLAType)
924  Record.AddTypeRef(QualType(D->getCapturedVLAType(), 0));
925  else if (ISK)
926  Record.AddStmt(D->getInClassInitializer());
927 
928  Record.AddStmt(D->getBitWidth());
929 
930  if (!D->getDeclName())
931  Record.AddDeclRef(Context.getInstantiatedFromUnnamedFieldDecl(D));
932 
933  if (D->getDeclContext() == D->getLexicalDeclContext() &&
934  !D->hasAttrs() &&
935  !D->isImplicit() &&
936  !D->isUsed(false) &&
937  !D->isInvalidDecl() &&
938  !D->isReferenced() &&
940  !D->isModulePrivate() &&
941  !D->getBitWidth() &&
942  !D->hasInClassInitializer() &&
943  !D->hasCapturedVLAType() &&
944  !D->hasExtInfo() &&
947  D->getDeclName())
948  AbbrevToUse = Writer.getDeclFieldAbbrev();
949 
951 }
952 
954  VisitDeclaratorDecl(D);
955  Record.AddIdentifierRef(D->getGetterId());
956  Record.AddIdentifierRef(D->getSetterId());
958 }
959 
961  VisitValueDecl(D);
962  MSGuidDecl::Parts Parts = D->getParts();
963  Record.push_back(Parts.Part1);
964  Record.push_back(Parts.Part2);
965  Record.push_back(Parts.Part3);
966  Record.append(std::begin(Parts.Part4And5), std::end(Parts.Part4And5));
968 }
969 
972  VisitValueDecl(D);
973  Record.AddAPValue(D->getValue());
975 }
976 
978  VisitValueDecl(D);
979  Record.AddAPValue(D->getValue());
981 }
982 
984  VisitValueDecl(D);
985  Record.push_back(D->getChainingSize());
986 
987  for (const auto *P : D->chain())
988  Record.AddDeclRef(P);
990 }
991 
993  VisitRedeclarable(D);
994  VisitDeclaratorDecl(D);
995  Record.push_back(D->getStorageClass());
996  Record.push_back(D->getTSCSpec());
997  Record.push_back(D->getInitStyle());
998  Record.push_back(D->isARCPseudoStrong());
999  if (!isa<ParmVarDecl>(D)) {
1000  Record.push_back(D->isThisDeclarationADemotedDefinition());
1001  Record.push_back(D->isExceptionVariable());
1002  Record.push_back(D->isNRVOVariable());
1003  Record.push_back(D->isCXXForRangeDecl());
1004  Record.push_back(D->isObjCForDecl());
1005  Record.push_back(D->isInline());
1006  Record.push_back(D->isInlineSpecified());
1007  Record.push_back(D->isConstexpr());
1008  Record.push_back(D->isInitCapture());
1009  Record.push_back(D->isPreviousDeclInSameBlockScope());
1010  if (const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
1011  Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
1012  else
1013  Record.push_back(0);
1014  Record.push_back(D->isEscapingByref());
1015  }
1016  Record.push_back(D->getLinkageInternal());
1017 
1018  Record.AddVarDeclInit(D);
1019 
1020  if (D->hasAttr<BlocksAttr>() && D->getType()->getAsCXXRecordDecl()) {
1021  BlockVarCopyInit Init = Writer.Context->getBlockVarCopyInit(D);
1022  Record.AddStmt(Init.getCopyExpr());
1023  if (Init.getCopyExpr())
1024  Record.push_back(Init.canThrow());
1025  }
1026 
1027  if (D->getStorageDuration() == SD_Static) {
1028  bool ModulesCodegen = false;
1029  if (Writer.WritingModule &&
1031  !isa<VarTemplateSpecializationDecl>(D)) {
1032  // When building a C++20 module interface unit or a partition unit, a
1033  // strong definition in the module interface is provided by the
1034  // compilation of that unit, not by its users. (Inline variables are still
1035  // emitted in module users.)
1036  ModulesCodegen =
1037  (Writer.WritingModule->isInterfaceOrPartition() ||
1038  (D->hasAttr<DLLExportAttr>() &&
1039  Writer.Context->getLangOpts().BuildingPCHWithObjectFile)) &&
1040  Writer.Context->GetGVALinkageForVariable(D) == GVA_StrongExternal;
1041  }
1042  Record.push_back(ModulesCodegen);
1043  if (ModulesCodegen)
1044  Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D));
1045  }
1046 
1047  enum {
1048  VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1049  };
1050  if (VarTemplateDecl *TemplD = D->getDescribedVarTemplate()) {
1051  Record.push_back(VarTemplate);
1052  Record.AddDeclRef(TemplD);
1053  } else if (MemberSpecializationInfo *SpecInfo
1054  = D->getMemberSpecializationInfo()) {
1055  Record.push_back(StaticDataMemberSpecialization);
1056  Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1057  Record.push_back(SpecInfo->getTemplateSpecializationKind());
1058  Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1059  } else {
1060  Record.push_back(VarNotTemplate);
1061  }
1062 
1063  if (D->getDeclContext() == D->getLexicalDeclContext() &&
1064  !D->hasAttrs() &&
1065  !D->isImplicit() &&
1066  !D->isUsed(false) &&
1067  !D->isInvalidDecl() &&
1068  !D->isReferenced() &&
1070  D->getAccess() == AS_none &&
1071  !D->isModulePrivate() &&
1074  !D->hasExtInfo() &&
1075  D->getFirstDecl() == D->getMostRecentDecl() &&
1076  D->getKind() == Decl::Var &&
1077  !D->isInline() &&
1078  !D->isConstexpr() &&
1079  !D->isInitCapture() &&
1081  !(D->hasAttr<BlocksAttr>() && D->getType()->getAsCXXRecordDecl()) &&
1082  !D->isEscapingByref() &&
1083  D->getStorageDuration() != SD_Static &&
1085  AbbrevToUse = Writer.getDeclVarAbbrev();
1086 
1087  Code = serialization::DECL_VAR;
1088 }
1089 
1091  VisitVarDecl(D);
1093 }
1094 
1096  VisitVarDecl(D);
1097  Record.push_back(D->isObjCMethodParameter());
1098  Record.push_back(D->getFunctionScopeDepth());
1099  Record.push_back(D->getFunctionScopeIndex());
1100  Record.push_back(D->getObjCDeclQualifier()); // FIXME: stable encoding
1101  Record.push_back(D->isKNRPromoted());
1102  Record.push_back(D->hasInheritedDefaultArg());
1103  Record.push_back(D->hasUninstantiatedDefaultArg());
1104  if (D->hasUninstantiatedDefaultArg())
1105  Record.AddStmt(D->getUninstantiatedDefaultArg());
1107 
1108  // If the assumptions about the DECL_PARM_VAR abbrev are true, use it. Here
1109  // we dynamically check for the properties that we optimize for, but don't
1110  // know are true of all PARM_VAR_DECLs.
1111  if (D->getDeclContext() == D->getLexicalDeclContext() &&
1112  !D->hasAttrs() &&
1113  !D->hasExtInfo() &&
1114  !D->isImplicit() &&
1115  !D->isUsed(false) &&
1116  !D->isInvalidDecl() &&
1117  !D->isReferenced() &&
1118  D->getAccess() == AS_none &&
1119  !D->isModulePrivate() &&
1120  D->getStorageClass() == 0 &&
1121  D->getInitStyle() == VarDecl::CInit && // Can params have anything else?
1122  D->getFunctionScopeDepth() == 0 &&
1123  D->getObjCDeclQualifier() == 0 &&
1124  !D->isKNRPromoted() &&
1125  !D->hasInheritedDefaultArg() &&
1126  D->getInit() == nullptr &&
1127  !D->hasUninstantiatedDefaultArg()) // No default expr.
1128  AbbrevToUse = Writer.getDeclParmVarAbbrev();
1129 
1130  // Check things we know are true of *every* PARM_VAR_DECL, which is more than
1131  // just us assuming it.
1132  assert(!D->getTSCSpec() && "PARM_VAR_DECL can't use TLS");
1134  && "PARM_VAR_DECL can't be demoted definition.");
1135  assert(D->getAccess() == AS_none && "PARM_VAR_DECL can't be public/private");
1136  assert(!D->isExceptionVariable() && "PARM_VAR_DECL can't be exception var");
1137  assert(D->getPreviousDecl() == nullptr && "PARM_VAR_DECL can't be redecl");
1138  assert(!D->isStaticDataMember() &&
1139  "PARM_VAR_DECL can't be static data member");
1140 }
1141 
1143  // Record the number of bindings first to simplify deserialization.
1144  Record.push_back(D->bindings().size());
1145 
1146  VisitVarDecl(D);
1147  for (auto *B : D->bindings())
1148  Record.AddDeclRef(B);
1150 }
1151 
1153  VisitValueDecl(D);
1154  Record.AddStmt(D->getBinding());
1156 }
1157 
1159  VisitDecl(D);
1160  Record.AddStmt(D->getAsmString());
1161  Record.AddSourceLocation(D->getRParenLoc());
1163 }
1164 
1166  VisitDecl(D);
1168 }
1169 
1172  VisitDecl(D);
1173  Record.AddDeclRef(D->getExtendingDecl());
1174  Record.AddStmt(D->getTemporaryExpr());
1175  Record.push_back(static_cast<bool>(D->getValue()));
1176  if (D->getValue())
1177  Record.AddAPValue(*D->getValue());
1178  Record.push_back(D->getManglingNumber());
1180 }
1182  VisitDecl(D);
1183  Record.AddStmt(D->getBody());
1184  Record.AddTypeSourceInfo(D->getSignatureAsWritten());
1185  Record.push_back(D->param_size());
1186  for (ParmVarDecl *P : D->parameters())
1187  Record.AddDeclRef(P);
1188  Record.push_back(D->isVariadic());
1189  Record.push_back(D->blockMissingReturnType());
1190  Record.push_back(D->isConversionFromLambda());
1191  Record.push_back(D->doesNotEscape());
1192  Record.push_back(D->canAvoidCopyToHeap());
1193  Record.push_back(D->capturesCXXThis());
1194  Record.push_back(D->getNumCaptures());
1195  for (const auto &capture : D->captures()) {
1196  Record.AddDeclRef(capture.getVariable());
1197 
1198  unsigned flags = 0;
1199  if (capture.isByRef()) flags |= 1;
1200  if (capture.isNested()) flags |= 2;
1201  if (capture.hasCopyExpr()) flags |= 4;
1202  Record.push_back(flags);
1203 
1204  if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1205  }
1206 
1208 }
1209 
1211  Record.push_back(CD->getNumParams());
1212  VisitDecl(CD);
1213  Record.push_back(CD->getContextParamPosition());
1214  Record.push_back(CD->isNothrow() ? 1 : 0);
1215  // Body is stored by VisitCapturedStmt.
1216  for (unsigned I = 0; I < CD->getNumParams(); ++I)
1217  Record.AddDeclRef(CD->getParam(I));
1219 }
1220 
1222  VisitDecl(D);
1223  Record.push_back(D->getLanguage());
1224  Record.AddSourceLocation(D->getExternLoc());
1225  Record.AddSourceLocation(D->getRBraceLoc());
1227 }
1228 
1230  VisitDecl(D);
1231  Record.AddSourceLocation(D->getRBraceLoc());
1233 }
1234 
1236  VisitNamedDecl(D);
1237  Record.AddSourceLocation(D->getBeginLoc());
1239 }
1240 
1241 
1243  VisitRedeclarable(D);
1244  VisitNamedDecl(D);
1245  Record.push_back(D->isInline());
1246  Record.AddSourceLocation(D->getBeginLoc());
1247  Record.AddSourceLocation(D->getRBraceLoc());
1248 
1249  if (D->isOriginalNamespace())
1250  Record.AddDeclRef(D->getAnonymousNamespace());
1252 
1253  if (Writer.hasChain() && D->isAnonymousNamespace() &&
1254  D == D->getMostRecentDecl()) {
1255  // This is a most recent reopening of the anonymous namespace. If its parent
1256  // is in a previous PCH (or is the TU), mark that parent for update, because
1257  // the original namespace always points to the latest re-opening of its
1258  // anonymous namespace.
1259  Decl *Parent = cast<Decl>(
1261  if (Parent->isFromASTFile() || isa<TranslationUnitDecl>(Parent)) {
1262  Writer.DeclUpdates[Parent].push_back(
1263  ASTWriter::DeclUpdate(UPD_CXX_ADDED_ANONYMOUS_NAMESPACE, D));
1264  }
1265  }
1266 }
1267 
1269  VisitRedeclarable(D);
1270  VisitNamedDecl(D);
1271  Record.AddSourceLocation(D->getNamespaceLoc());
1272  Record.AddSourceLocation(D->getTargetNameLoc());
1273  Record.AddNestedNameSpecifierLoc(D->getQualifierLoc());
1274  Record.AddDeclRef(D->getNamespace());
1276 }
1277 
1279  VisitNamedDecl(D);
1280  Record.AddSourceLocation(D->getUsingLoc());
1281  Record.AddNestedNameSpecifierLoc(D->getQualifierLoc());
1282  Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName());
1283  Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1284  Record.push_back(D->hasTypename());
1285  Record.AddDeclRef(Context.getInstantiatedFromUsingDecl(D));
1287 }
1288 
1290  VisitNamedDecl(D);
1291  Record.AddSourceLocation(D->getUsingLoc());
1292  Record.AddSourceLocation(D->getEnumLoc());
1293  Record.AddDeclRef(D->getEnumDecl());
1294  Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1295  Record.AddDeclRef(Context.getInstantiatedFromUsingEnumDecl(D));
1297 }
1298 
1300  Record.push_back(D->NumExpansions);
1301  VisitNamedDecl(D);
1302  Record.AddDeclRef(D->getInstantiatedFromUsingDecl());
1303  for (auto *E : D->expansions())
1304  Record.AddDeclRef(E);
1306 }
1307 
1309  VisitRedeclarable(D);
1310  VisitNamedDecl(D);
1311  Record.AddDeclRef(D->getTargetDecl());
1312  Record.push_back(D->getIdentifierNamespace());
1313  Record.AddDeclRef(D->UsingOrNextShadow);
1314  Record.AddDeclRef(Context.getInstantiatedFromUsingShadowDecl(D));
1316 }
1317 
1320  VisitUsingShadowDecl(D);
1321  Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1322  Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1323  Record.push_back(D->IsVirtual);
1325 }
1326 
1328  VisitNamedDecl(D);
1329  Record.AddSourceLocation(D->getUsingLoc());
1330  Record.AddSourceLocation(D->getNamespaceKeyLocation());
1331  Record.AddNestedNameSpecifierLoc(D->getQualifierLoc());
1332  Record.AddDeclRef(D->getNominatedNamespace());
1333  Record.AddDeclRef(dyn_cast<Decl>(D->getCommonAncestor()));
1335 }
1336 
1338  VisitValueDecl(D);
1339  Record.AddSourceLocation(D->getUsingLoc());
1340  Record.AddNestedNameSpecifierLoc(D->getQualifierLoc());
1341  Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName());
1342  Record.AddSourceLocation(D->getEllipsisLoc());
1344 }
1345 
1348  VisitTypeDecl(D);
1349  Record.AddSourceLocation(D->getTypenameLoc());
1350  Record.AddNestedNameSpecifierLoc(D->getQualifierLoc());
1351  Record.AddSourceLocation(D->getEllipsisLoc());
1353 }
1354 
1357  VisitNamedDecl(D);
1359 }
1360 
1362  VisitRecordDecl(D);
1363 
1364  enum {
1365  CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1366  };
1367  if (ClassTemplateDecl *TemplD = D->getDescribedClassTemplate()) {
1368  Record.push_back(CXXRecTemplate);
1369  Record.AddDeclRef(TemplD);
1370  } else if (MemberSpecializationInfo *MSInfo
1371  = D->getMemberSpecializationInfo()) {
1372  Record.push_back(CXXRecMemberSpecialization);
1373  Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1374  Record.push_back(MSInfo->getTemplateSpecializationKind());
1375  Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1376  } else {
1377  Record.push_back(CXXRecNotTemplate);
1378  }
1379 
1380  Record.push_back(D->isThisDeclarationADefinition());
1382  Record.AddCXXDefinitionData(D);
1383 
1384  // Store (what we currently believe to be) the key function to avoid
1385  // deserializing every method so we can compute it.
1386  if (D->isCompleteDefinition())
1387  Record.AddDeclRef(Context.getCurrentKeyFunction(D));
1388 
1390 }
1391 
1393  VisitFunctionDecl(D);
1394  if (D->isCanonicalDecl()) {
1395  Record.push_back(D->size_overridden_methods());
1396  for (const CXXMethodDecl *MD : D->overridden_methods())
1397  Record.AddDeclRef(MD);
1398  } else {
1399  // We only need to record overridden methods once for the canonical decl.
1400  Record.push_back(0);
1401  }
1402 
1403  if (D->getDeclContext() == D->getLexicalDeclContext() &&
1404  D->getFirstDecl() == D->getMostRecentDecl() &&
1405  !D->isInvalidDecl() &&
1406  !D->hasAttrs() &&
1409  !D->hasExtInfo() &&
1410  !D->hasInheritedPrototype() &&
1411  D->hasWrittenPrototype())
1412  AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1413 
1415 }
1416 
1418  Record.push_back(D->getTrailingAllocKind());
1420  if (auto Inherited = D->getInheritedConstructor()) {
1421  Record.AddDeclRef(Inherited.getShadowDecl());
1422  Record.AddDeclRef(Inherited.getConstructor());
1423  }
1424 
1425  VisitCXXMethodDecl(D);
1427 }
1428 
1430  VisitCXXMethodDecl(D);
1431 
1432  Record.AddDeclRef(D->getOperatorDelete());
1433  if (D->getOperatorDelete())
1434  Record.AddStmt(D->getOperatorDeleteThisArg());
1435 
1437 }
1438 
1441  VisitCXXMethodDecl(D);
1443 }
1444 
1446  VisitDecl(D);
1447  Record.push_back(Writer.getSubmoduleID(D->getImportedModule()));
1448  ArrayRef<SourceLocation> IdentifierLocs = D->getIdentifierLocs();
1449  Record.push_back(!IdentifierLocs.empty());
1450  if (IdentifierLocs.empty()) {
1451  Record.AddSourceLocation(D->getEndLoc());
1452  Record.push_back(1);
1453  } else {
1454  for (unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1455  Record.AddSourceLocation(IdentifierLocs[I]);
1456  Record.push_back(IdentifierLocs.size());
1457  }
1458  // Note: the number of source locations must always be the last element in
1459  // the record.
1461 }
1462 
1464  VisitDecl(D);
1465  Record.AddSourceLocation(D->getColonLoc());
1467 }
1468 
1470  // Record the number of friend type template parameter lists here
1471  // so as to simplify memory allocation during deserialization.
1472  Record.push_back(D->NumTPLists);
1473  VisitDecl(D);
1474  bool hasFriendDecl = D->Friend.is<NamedDecl*>();
1475  Record.push_back(hasFriendDecl);
1476  if (hasFriendDecl)
1477  Record.AddDeclRef(D->getFriendDecl());
1478  else
1479  Record.AddTypeSourceInfo(D->getFriendType());
1480  for (unsigned i = 0; i < D->NumTPLists; ++i)
1481  Record.AddTemplateParameterList(D->getFriendTypeTemplateParameterList(i));
1482  Record.AddDeclRef(D->getNextFriend());
1483  Record.push_back(D->UnsupportedFriend);
1484  Record.AddSourceLocation(D->FriendLoc);
1486 }
1487 
1489  VisitDecl(D);
1490  Record.push_back(D->getNumTemplateParameters());
1491  for (unsigned i = 0, e = D->getNumTemplateParameters(); i != e; ++i)
1492  Record.AddTemplateParameterList(D->getTemplateParameterList(i));
1493  Record.push_back(D->getFriendDecl() != nullptr);
1494  if (D->getFriendDecl())
1495  Record.AddDeclRef(D->getFriendDecl());
1496  else
1497  Record.AddTypeSourceInfo(D->getFriendType());
1498  Record.AddSourceLocation(D->getFriendLoc());
1500 }
1501 
1503  VisitNamedDecl(D);
1504 
1505  Record.AddDeclRef(D->getTemplatedDecl());
1506  Record.AddTemplateParameterList(D->getTemplateParameters());
1507 }
1508 
1510  VisitTemplateDecl(D);
1511  Record.AddStmt(D->getConstraintExpr());
1513 }
1514 
1517 }
1518 
1520  VisitRedeclarable(D);
1521 
1522  // Emit data to initialize CommonOrPrev before VisitTemplateDecl so that
1523  // getCommonPtr() can be used while this is still initializing.
1524  if (D->isFirstDecl()) {
1525  // This declaration owns the 'common' pointer, so serialize that data now.
1526  Record.AddDeclRef(D->getInstantiatedFromMemberTemplate());
1528  Record.push_back(D->isMemberSpecialization());
1529  }
1530 
1531  VisitTemplateDecl(D);
1532  Record.push_back(D->getIdentifierNamespace());
1533 }
1534 
1536  VisitRedeclarableTemplateDecl(D);
1537 
1538  if (D->isFirstDecl())
1539  AddTemplateSpecializations(D);
1541 }
1542 
1545  RegisterTemplateSpecialization(D->getSpecializedTemplate(), D);
1546 
1547  VisitCXXRecordDecl(D);
1548 
1549  llvm::PointerUnion<ClassTemplateDecl *,
1552  if (Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1553  Record.AddDeclRef(InstFromD);
1554  } else {
1555  Record.AddDeclRef(InstFrom.get<ClassTemplatePartialSpecializationDecl *>());
1556  Record.AddTemplateArgumentList(&D->getTemplateInstantiationArgs());
1557  }
1558 
1559  Record.AddTemplateArgumentList(&D->getTemplateArgs());
1560  Record.AddSourceLocation(D->getPointOfInstantiation());
1561  Record.push_back(D->getSpecializationKind());
1562  Record.push_back(D->isCanonicalDecl());
1563 
1564  if (D->isCanonicalDecl()) {
1565  // When reading, we'll add it to the folding set of the following template.
1566  Record.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl());
1567  }
1568 
1569  // Explicit info.
1570  Record.AddTypeSourceInfo(D->getTypeAsWritten());
1571  if (D->getTypeAsWritten()) {
1572  Record.AddSourceLocation(D->getExternLoc());
1573  Record.AddSourceLocation(D->getTemplateKeywordLoc());
1574  }
1575 
1577 }
1578 
1581  Record.AddTemplateParameterList(D->getTemplateParameters());
1582  Record.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten());
1583 
1584  VisitClassTemplateSpecializationDecl(D);
1585 
1586  // These are read/set from/to the first declaration.
1587  if (D->getPreviousDecl() == nullptr) {
1588  Record.AddDeclRef(D->getInstantiatedFromMember());
1589  Record.push_back(D->isMemberSpecialization());
1590  }
1591 
1593 }
1594 
1596  VisitRedeclarableTemplateDecl(D);
1597 
1598  if (D->isFirstDecl())
1599  AddTemplateSpecializations(D);
1601 }
1602 
1605  RegisterTemplateSpecialization(D->getSpecializedTemplate(), D);
1606 
1607  VisitVarDecl(D);
1608 
1609  llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1610  InstFrom = D->getSpecializedTemplateOrPartial();
1611  if (Decl *InstFromD = InstFrom.dyn_cast<VarTemplateDecl *>()) {
1612  Record.AddDeclRef(InstFromD);
1613  } else {
1614  Record.AddDeclRef(InstFrom.get<VarTemplatePartialSpecializationDecl *>());
1615  Record.AddTemplateArgumentList(&D->getTemplateInstantiationArgs());
1616  }
1617 
1618  // Explicit info.
1619  Record.AddTypeSourceInfo(D->getTypeAsWritten());
1620  if (D->getTypeAsWritten()) {
1621  Record.AddSourceLocation(D->getExternLoc());
1622  Record.AddSourceLocation(D->getTemplateKeywordLoc());
1623  }
1624 
1625  Record.AddTemplateArgumentList(&D->getTemplateArgs());
1626  Record.AddSourceLocation(D->getPointOfInstantiation());
1627  Record.push_back(D->getSpecializationKind());
1628  Record.push_back(D->IsCompleteDefinition);
1629  Record.push_back(D->isCanonicalDecl());
1630 
1631  if (D->isCanonicalDecl()) {
1632  // When reading, we'll add it to the folding set of the following template.
1633  Record.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl());
1634  }
1635 
1637 }
1638 
1641  Record.AddTemplateParameterList(D->getTemplateParameters());
1642  Record.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten());
1643 
1644  VisitVarTemplateSpecializationDecl(D);
1645 
1646  // These are read/set from/to the first declaration.
1647  if (D->getPreviousDecl() == nullptr) {
1648  Record.AddDeclRef(D->getInstantiatedFromMember());
1649  Record.push_back(D->isMemberSpecialization());
1650  }
1651 
1653 }
1654 
1657  VisitDecl(D);
1658  Record.AddDeclRef(D->getSpecialization());
1659  Record.push_back(D->hasExplicitTemplateArgs());
1660  if (D->hasExplicitTemplateArgs())
1661  Record.AddASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten());
1663 }
1664 
1665 
1667  VisitRedeclarableTemplateDecl(D);
1668 
1669  if (D->isFirstDecl())
1670  AddTemplateSpecializations(D);
1672 }
1673 
1675  Record.push_back(D->hasTypeConstraint());
1676  VisitTypeDecl(D);
1677 
1678  Record.push_back(D->wasDeclaredWithTypename());
1679 
1680  const TypeConstraint *TC = D->getTypeConstraint();
1681  Record.push_back(TC != nullptr);
1682  if (TC) {
1683  Record.AddNestedNameSpecifierLoc(TC->getNestedNameSpecifierLoc());
1684  Record.AddDeclarationNameInfo(TC->getConceptNameInfo());
1685  Record.AddDeclRef(TC->getNamedConcept());
1686  Record.push_back(TC->getTemplateArgsAsWritten() != nullptr);
1687  if (TC->getTemplateArgsAsWritten())
1688  Record.AddASTTemplateArgumentListInfo(TC->getTemplateArgsAsWritten());
1689  Record.AddStmt(TC->getImmediatelyDeclaredConstraint());
1690  Record.push_back(D->isExpandedParameterPack());
1691  if (D->isExpandedParameterPack())
1692  Record.push_back(D->getNumExpansionParameters());
1693  }
1694 
1695  bool OwnsDefaultArg = D->hasDefaultArgument() &&
1697  Record.push_back(OwnsDefaultArg);
1698  if (OwnsDefaultArg)
1699  Record.AddTypeSourceInfo(D->getDefaultArgumentInfo());
1700 
1702 }
1703 
1705  // For an expanded parameter pack, record the number of expansion types here
1706  // so that it's easier for deserialization to allocate the right amount of
1707  // memory.
1709  Record.push_back(!!TypeConstraint);
1710  if (D->isExpandedParameterPack())
1711  Record.push_back(D->getNumExpansionTypes());
1712 
1713  VisitDeclaratorDecl(D);
1714  // TemplateParmPosition.
1715  Record.push_back(D->getDepth());
1716  Record.push_back(D->getPosition());
1717  if (TypeConstraint)
1718  Record.AddStmt(TypeConstraint);
1719 
1720  if (D->isExpandedParameterPack()) {
1721  for (unsigned I = 0, N = D->getNumExpansionTypes(); I != N; ++I) {
1722  Record.AddTypeRef(D->getExpansionType(I));
1723  Record.AddTypeSourceInfo(D->getExpansionTypeSourceInfo(I));
1724  }
1725 
1727  } else {
1728  // Rest of NonTypeTemplateParmDecl.
1729  Record.push_back(D->isParameterPack());
1730  bool OwnsDefaultArg = D->hasDefaultArgument() &&
1732  Record.push_back(OwnsDefaultArg);
1733  if (OwnsDefaultArg)
1734  Record.AddStmt(D->getDefaultArgument());
1736  }
1737 }
1738 
1740  // For an expanded parameter pack, record the number of expansion types here
1741  // so that it's easier for deserialization to allocate the right amount of
1742  // memory.
1743  if (D->isExpandedParameterPack())
1744  Record.push_back(D->getNumExpansionTemplateParameters());
1745 
1746  VisitTemplateDecl(D);
1747  // TemplateParmPosition.
1748  Record.push_back(D->getDepth());
1749  Record.push_back(D->getPosition());
1750 
1751  if (D->isExpandedParameterPack()) {
1752  for (unsigned I = 0, N = D->getNumExpansionTemplateParameters();
1753  I != N; ++I)
1754  Record.AddTemplateParameterList(D->getExpansionTemplateParameters(I));
1756  } else {
1757  // Rest of TemplateTemplateParmDecl.
1758  Record.push_back(D->isParameterPack());
1759  bool OwnsDefaultArg = D->hasDefaultArgument() &&
1761  Record.push_back(OwnsDefaultArg);
1762  if (OwnsDefaultArg)
1763  Record.AddTemplateArgumentLoc(D->getDefaultArgument());
1765  }
1766 }
1767 
1769  VisitRedeclarableTemplateDecl(D);
1771 }
1772 
1774  VisitDecl(D);
1775  Record.AddStmt(D->getAssertExpr());
1776  Record.push_back(D->isFailed());
1777  Record.AddStmt(D->getMessage());
1778  Record.AddSourceLocation(D->getRParenLoc());
1780 }
1781 
1782 /// Emit the DeclContext part of a declaration context decl.
1784  Record.AddOffset(Writer.WriteDeclContextLexicalBlock(Context, DC));
1785  Record.AddOffset(Writer.WriteDeclContextVisibleBlock(Context, DC));
1786 }
1787 
1789  assert(IsLocalDecl(D) && "expected a local declaration");
1790 
1791  const Decl *Canon = D->getCanonicalDecl();
1792  if (IsLocalDecl(Canon))
1793  return Canon;
1794 
1795  const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1796  if (CacheEntry)
1797  return CacheEntry;
1798 
1799  for (const Decl *Redecl = D; Redecl; Redecl = Redecl->getPreviousDecl())
1800  if (IsLocalDecl(Redecl))
1801  D = Redecl;
1802  return CacheEntry = D;
1803 }
1804 
1805 template <typename T>
1807  T *First = D->getFirstDecl();
1808  T *MostRecent = First->getMostRecentDecl();
1809  T *DAsT = static_cast<T *>(D);
1810  if (MostRecent != First) {
1811  assert(isRedeclarableDeclKind(DAsT->getKind()) &&
1812  "Not considered redeclarable?");
1813 
1814  Record.AddDeclRef(First);
1815 
1816  // Write out a list of local redeclarations of this declaration if it's the
1817  // first local declaration in the chain.
1818  const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1819  if (DAsT == FirstLocal) {
1820  // Emit a list of all imported first declarations so that we can be sure
1821  // that all redeclarations visible to this module are before D in the
1822  // redecl chain.
1823  unsigned I = Record.size();
1824  Record.push_back(0);
1825  if (Writer.Chain)
1826  AddFirstDeclFromEachModule(DAsT, /*IncludeLocal*/false);
1827  // This is the number of imported first declarations + 1.
1828  Record[I] = Record.size() - I;
1829 
1830  // Collect the set of local redeclarations of this declaration, from
1831  // newest to oldest.
1832  ASTWriter::RecordData LocalRedecls;
1833  ASTRecordWriter LocalRedeclWriter(Record, LocalRedecls);
1834  for (const Decl *Prev = FirstLocal->getMostRecentDecl();
1835  Prev != FirstLocal; Prev = Prev->getPreviousDecl())
1836  if (!Prev->isFromASTFile())
1837  LocalRedeclWriter.AddDeclRef(Prev);
1838 
1839  // If we have any redecls, write them now as a separate record preceding
1840  // the declaration itself.
1841  if (LocalRedecls.empty())
1842  Record.push_back(0);
1843  else
1844  Record.AddOffset(LocalRedeclWriter.Emit(LOCAL_REDECLARATIONS));
1845  } else {
1846  Record.push_back(0);
1847  Record.AddDeclRef(FirstLocal);
1848  }
1849 
1850  // Make sure that we serialize both the previous and the most-recent
1851  // declarations, which (transitively) ensures that all declarations in the
1852  // chain get serialized.
1853  //
1854  // FIXME: This is not correct; when we reach an imported declaration we
1855  // won't emit its previous declaration.
1856  (void)Writer.GetDeclRef(D->getPreviousDecl());
1857  (void)Writer.GetDeclRef(MostRecent);
1858  } else {
1859  // We use the sentinel value 0 to indicate an only declaration.
1860  Record.push_back(0);
1861  }
1862 }
1863 
1865  Record.writeOMPChildren(D->Data);
1866  VisitDecl(D);
1868 }
1869 
1871  Record.writeOMPChildren(D->Data);
1872  VisitDecl(D);
1874 }
1875 
1877  Record.writeOMPChildren(D->Data);
1878  VisitDecl(D);
1880 }
1881 
1883  VisitValueDecl(D);
1884  Record.AddSourceLocation(D->getBeginLoc());
1885  Record.AddStmt(D->getCombinerIn());
1886  Record.AddStmt(D->getCombinerOut());
1887  Record.AddStmt(D->getCombiner());
1888  Record.AddStmt(D->getInitOrig());
1889  Record.AddStmt(D->getInitPriv());
1890  Record.AddStmt(D->getInitializer());
1891  Record.push_back(D->getInitializerKind());
1892  Record.AddDeclRef(D->getPrevDeclInScope());
1894 }
1895 
1897  Record.writeOMPChildren(D->Data);
1898  VisitValueDecl(D);
1899  Record.AddDeclarationName(D->getVarName());
1900  Record.AddDeclRef(D->getPrevDeclInScope());
1902 }
1903 
1905  VisitVarDecl(D);
1907 }
1908 
1909 //===----------------------------------------------------------------------===//
1910 // ASTWriter Implementation
1911 //===----------------------------------------------------------------------===//
1912 
1913 void ASTWriter::WriteDeclAbbrevs() {
1914  using namespace llvm;
1915 
1916  std::shared_ptr<BitCodeAbbrev> Abv;
1917 
1918  // Abbreviation for DECL_FIELD
1919  Abv = std::make_shared<BitCodeAbbrev>();
1920  Abv->Add(BitCodeAbbrevOp(serialization::DECL_FIELD));
1921  // Decl
1922  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
1923  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
1924  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
1925  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
1926  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
1927  Abv->Add(BitCodeAbbrevOp(0)); // isUsed
1928  Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
1929  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
1930  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // AccessSpecifier
1931  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
1932  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
1933  // NamedDecl
1934  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
1935  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
1936  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
1937  // ValueDecl
1938  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
1939  // DeclaratorDecl
1940  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
1941  Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
1942  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TSIType
1943  // FieldDecl
1944  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isMutable
1945  Abv->Add(BitCodeAbbrevOp(0)); // InitStyle
1946  // Type Source Info
1947  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1948  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
1949  DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1950 
1951  // Abbreviation for DECL_OBJC_IVAR
1952  Abv = std::make_shared<BitCodeAbbrev>();
1953  Abv->Add(BitCodeAbbrevOp(serialization::DECL_OBJC_IVAR));
1954  // Decl
1955  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
1956  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
1957  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
1958  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
1959  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
1960  Abv->Add(BitCodeAbbrevOp(0)); // isUsed
1961  Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
1962  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
1963  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // AccessSpecifier
1964  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
1965  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
1966  // NamedDecl
1967  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
1968  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
1969  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
1970  // ValueDecl
1971  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
1972  // DeclaratorDecl
1973  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
1974  Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
1975  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TSIType
1976  // FieldDecl
1977  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isMutable
1978  Abv->Add(BitCodeAbbrevOp(0)); // InitStyle
1979  // ObjC Ivar
1980  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getAccessControl
1981  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getSynthesize
1982  // Type Source Info
1983  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1984  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
1985  DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1986 
1987  // Abbreviation for DECL_ENUM
1988  Abv = std::make_shared<BitCodeAbbrev>();
1989  Abv->Add(BitCodeAbbrevOp(serialization::DECL_ENUM));
1990  // Redeclarable
1991  Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
1992  // Decl
1993  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
1994  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
1995  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
1996  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
1997  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
1998  Abv->Add(BitCodeAbbrevOp(0)); // isUsed
1999  Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
2000  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
2001  Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
2002  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
2003  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
2004  // NamedDecl
2005  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
2006  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
2007  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
2008  // TypeDecl
2009  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Source Location
2010  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type Ref
2011  // TagDecl
2012  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // IdentifierNamespace
2013  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getTagKind
2014  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isCompleteDefinition
2015  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // EmbeddedInDeclarator
2016  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsFreeStanding
2017  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsCompleteDefinitionRequired
2018  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SourceLocation
2019  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SourceLocation
2020  Abv->Add(BitCodeAbbrevOp(0)); // ExtInfoKind
2021  // EnumDecl
2022  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // AddTypeRef
2023  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // IntegerType
2024  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getPromotionType
2025  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getNumPositiveBits
2026  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getNumNegativeBits
2027  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isScoped
2028  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isScopedUsingClassTag
2029  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isFixed
2030  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));// ODRHash
2031  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InstantiatedMembEnum
2032  // DC
2033  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalOffset
2034  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // VisibleOffset
2035  DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2036 
2037  // Abbreviation for DECL_RECORD
2038  Abv = std::make_shared<BitCodeAbbrev>();
2039  Abv->Add(BitCodeAbbrevOp(serialization::DECL_RECORD));
2040  // Redeclarable
2041  Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
2042  // Decl
2043  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
2044  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
2045  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
2046  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
2047  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
2048  Abv->Add(BitCodeAbbrevOp(0)); // isUsed
2049  Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
2050  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
2051  Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
2052  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
2053  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
2054  // NamedDecl
2055  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
2056  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
2057  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
2058  // TypeDecl
2059  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Source Location
2060  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type Ref
2061  // TagDecl
2062  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // IdentifierNamespace
2063  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getTagKind
2064  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isCompleteDefinition
2065  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // EmbeddedInDeclarator
2066  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsFreeStanding
2067  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsCompleteDefinitionRequired
2068  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SourceLocation
2069  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SourceLocation
2070  Abv->Add(BitCodeAbbrevOp(0)); // ExtInfoKind
2071  // RecordDecl
2072  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // FlexibleArrayMember
2073  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // AnonymousStructUnion
2074  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // hasObjectMember
2075  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // hasVolatileMember
2076 
2077  // isNonTrivialToPrimitiveDefaultInitialize
2078  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2079  // isNonTrivialToPrimitiveCopy
2080  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2081  // isNonTrivialToPrimitiveDestroy
2082  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2083  // hasNonTrivialToPrimitiveDefaultInitializeCUnion
2084  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2085  // hasNonTrivialToPrimitiveDestructCUnion
2086  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2087  // hasNonTrivialToPrimitiveCopyCUnion
2088  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2089  // isParamDestroyedInCallee
2090  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2091  // getArgPassingRestrictions
2092  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2093 
2094  // DC
2095  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalOffset
2096  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // VisibleOffset
2097  DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2098 
2099  // Abbreviation for DECL_PARM_VAR
2100  Abv = std::make_shared<BitCodeAbbrev>();
2101  Abv->Add(BitCodeAbbrevOp(serialization::DECL_PARM_VAR));
2102  // Redeclarable
2103  Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
2104  // Decl
2105  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
2106  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
2107  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
2108  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
2109  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
2110  Abv->Add(BitCodeAbbrevOp(0)); // isUsed
2111  Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
2112  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
2113  Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
2114  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
2115  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
2116  // NamedDecl
2117  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
2118  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
2119  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
2120  // ValueDecl
2121  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2122  // DeclaratorDecl
2123  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
2124  Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
2125  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TSIType
2126  // VarDecl
2127  Abv->Add(BitCodeAbbrevOp(0)); // SClass
2128  Abv->Add(BitCodeAbbrevOp(0)); // TSCSpec
2129  Abv->Add(BitCodeAbbrevOp(0)); // InitStyle
2130  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong
2131  Abv->Add(BitCodeAbbrevOp(0)); // Linkage
2132  Abv->Add(BitCodeAbbrevOp(0)); // HasInit
2133  Abv->Add(BitCodeAbbrevOp(0)); // HasMemberSpecializationInfo
2134  // ParmVarDecl
2135  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsObjCMethodParameter
2136  Abv->Add(BitCodeAbbrevOp(0)); // ScopeDepth
2137  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // ScopeIndex
2138  Abv->Add(BitCodeAbbrevOp(0)); // ObjCDeclQualifier
2139  Abv->Add(BitCodeAbbrevOp(0)); // KNRPromoted
2140  Abv->Add(BitCodeAbbrevOp(0)); // HasInheritedDefaultArg
2141  Abv->Add(BitCodeAbbrevOp(0)); // HasUninstantiatedDefaultArg
2142  // Type Source Info
2143  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2144  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
2145  DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2146 
2147  // Abbreviation for DECL_TYPEDEF
2148  Abv = std::make_shared<BitCodeAbbrev>();
2149  Abv->Add(BitCodeAbbrevOp(serialization::DECL_TYPEDEF));
2150  // Redeclarable
2151  Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
2152  // Decl
2153  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
2154  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
2155  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
2156  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
2157  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
2158  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isUsed
2159  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isReferenced
2160  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
2161  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // C++ AccessSpecifier
2162  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
2163  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
2164  // NamedDecl
2165  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
2166  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
2167  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
2168  // TypeDecl
2169  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Source Location
2170  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type Ref
2171  // TypedefDecl
2172  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2173  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
2174  DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2175 
2176  // Abbreviation for DECL_VAR
2177  Abv = std::make_shared<BitCodeAbbrev>();
2178  Abv->Add(BitCodeAbbrevOp(serialization::DECL_VAR));
2179  // Redeclarable
2180  Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
2181  // Decl
2182  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
2183  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
2184  Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl
2185  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
2186  Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
2187  Abv->Add(BitCodeAbbrevOp(0)); // isUsed
2188  Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
2189  Abv->Add(BitCodeAbbrevOp(0)); // TopLevelDeclInObjCContainer
2190  Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
2191  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
2192  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
2193  // NamedDecl
2194  Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
2195  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
2196  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
2197  // ValueDecl
2198  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2199  // DeclaratorDecl
2200  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
2201  Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
2202  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TSIType
2203  // VarDecl
2204  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // SClass
2205  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // TSCSpec
2206  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // InitStyle
2207  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong
2208  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsThisDeclarationADemotedDefinition
2209  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isExceptionVariable
2210  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isNRVOVariable
2211  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isCXXForRangeDecl
2212  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isObjCForDecl
2213  Abv->Add(BitCodeAbbrevOp(0)); // isInline
2214  Abv->Add(BitCodeAbbrevOp(0)); // isInlineSpecified
2215  Abv->Add(BitCodeAbbrevOp(0)); // isConstexpr
2216  Abv->Add(BitCodeAbbrevOp(0)); // isInitCapture
2217  Abv->Add(BitCodeAbbrevOp(0)); // isPrevDeclInSameScope
2218  Abv->Add(BitCodeAbbrevOp(0)); // ImplicitParamKind
2219  Abv->Add(BitCodeAbbrevOp(0)); // EscapingByref
2220  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Linkage
2221  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // HasConstant*
2222  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // VarKind (local enum)
2223  // Type Source Info
2224  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2225  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
2226  DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2227 
2228  // Abbreviation for DECL_CXX_METHOD
2229  Abv = std::make_shared<BitCodeAbbrev>();
2230  Abv->Add(BitCodeAbbrevOp(serialization::DECL_CXX_METHOD));
2231  // RedeclarableDecl
2232  Abv->Add(BitCodeAbbrevOp(0)); // CanonicalDecl
2233  // Decl
2234  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
2235  Abv->Add(BitCodeAbbrevOp(0)); // LexicalDeclContext
2236  Abv->Add(BitCodeAbbrevOp(0)); // Invalid
2237  Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
2238  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Implicit
2239  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Used
2240  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Referenced
2241  Abv->Add(BitCodeAbbrevOp(0)); // InObjCContainer
2242  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // Access
2243  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // ModuleOwnershipKind
2244  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SubmoduleID
2245  // NamedDecl
2246  Abv->Add(BitCodeAbbrevOp(DeclarationName::Identifier)); // NameKind
2247  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Identifier
2248  Abv->Add(BitCodeAbbrevOp(0)); // AnonDeclNumber
2249  // ValueDecl
2250  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2251  // DeclaratorDecl
2252  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerLocStart
2253  Abv->Add(BitCodeAbbrevOp(0)); // HasExtInfo
2254  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TSIType
2255  // FunctionDecl
2256  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11)); // IDNS
2257  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // StorageClass
2258  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Inline
2259  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // InlineSpecified
2260  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // VirtualAsWritten
2261  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Pure
2262  Abv->Add(BitCodeAbbrevOp(0)); // HasInheritedProto
2263  Abv->Add(BitCodeAbbrevOp(1)); // HasWrittenProto
2264  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Deleted
2265  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Trivial
2266  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // TrivialForCall
2267  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // Defaulted
2268  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ExplicitlyDefaulted
2269  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // ImplicitReturnZero
2270  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // Constexpr
2271  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // UsesSEHTry
2272  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // SkippedBody
2273  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // MultiVersion
2274  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // LateParsed
2275  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Linkage
2276  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LocEnd
2277  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // ODRHash
2278  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // TemplateKind
2279  // This Array slurps the rest of the record. Fortunately we want to encode
2280  // (nearly) all the remaining (variable number of) fields in the same way.
2281  //
2282  // This is the function template information if any, then
2283  // NumParams and Params[] from FunctionDecl, and
2284  // NumOverriddenMethods, OverriddenMethods[] from CXXMethodDecl.
2285  //
2286  // Add an AbbrevOp for 'size then elements' and use it here.
2287  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2288  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2289  DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2290 
2291  unsigned ExprDependenceBits = llvm::BitWidth<ExprDependence>;
2292  // Abbreviation for EXPR_DECL_REF
2293  Abv = std::make_shared<BitCodeAbbrev>();
2294  Abv->Add(BitCodeAbbrevOp(serialization::EXPR_DECL_REF));
2295  //Stmt
2296  // Expr
2297  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2298  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, ExprDependenceBits));
2299  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
2300  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
2301  //DeclRefExpr
2302  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //HasQualifier
2303  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //GetDeclFound
2304  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //ExplicitTemplateArgs
2305  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //HadMultipleCandidates
2306  Abv->Add(BitCodeAbbrevOp(0)); // RefersToEnclosingVariableOrCapture
2307  Abv->Add(BitCodeAbbrevOp(0)); // NonOdrUseReason
2308  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclRef
2309  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
2310  DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2311 
2312  // Abbreviation for EXPR_INTEGER_LITERAL
2313  Abv = std::make_shared<BitCodeAbbrev>();
2314  Abv->Add(BitCodeAbbrevOp(serialization::EXPR_INTEGER_LITERAL));
2315  //Stmt
2316  // Expr
2317  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2318  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, ExprDependenceBits));
2319  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
2320  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
2321  //Integer Literal
2322  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
2323  Abv->Add(BitCodeAbbrevOp(32)); // Bit Width
2324  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Value
2325  IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2326 
2327  // Abbreviation for EXPR_CHARACTER_LITERAL
2328  Abv = std::make_shared<BitCodeAbbrev>();
2329  Abv->Add(BitCodeAbbrevOp(serialization::EXPR_CHARACTER_LITERAL));
2330  //Stmt
2331  // Expr
2332  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2333  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, ExprDependenceBits));
2334  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
2335  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
2336  //Character Literal
2337  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getValue
2338  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
2339  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // getKind
2340  CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2341 
2342  // Abbreviation for EXPR_IMPLICIT_CAST
2343  Abv = std::make_shared<BitCodeAbbrev>();
2344  Abv->Add(BitCodeAbbrevOp(serialization::EXPR_IMPLICIT_CAST));
2345  // Stmt
2346  // Expr
2347  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
2348  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, ExprDependenceBits));
2349  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
2350  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
2351  // CastExpr
2352  Abv->Add(BitCodeAbbrevOp(0)); // PathSize
2353  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // HasFPFeatures
2354  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6)); // CastKind
2355  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // PartOfExplicitCast
2356  // ImplicitCastExpr
2357  ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2358 
2359  Abv = std::make_shared<BitCodeAbbrev>();
2360  Abv->Add(BitCodeAbbrevOp(serialization::DECL_CONTEXT_LEXICAL));
2361  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2362  DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2363 
2364  Abv = std::make_shared<BitCodeAbbrev>();
2365  Abv->Add(BitCodeAbbrevOp(serialization::DECL_CONTEXT_VISIBLE));
2366  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2367  DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2368 }
2369 
2370 /// isRequiredDecl - Check if this is a "required" Decl, which must be seen by
2371 /// consumers of the AST.
2372 ///
2373 /// Such decls will always be deserialized from the AST file, so we would like
2374 /// this to be as restrictive as possible. Currently the predicate is driven by
2375 /// code generation requirements, if other clients have a different notion of
2376 /// what is "required" then we may have to consider an alternate scheme where
2377 /// clients can iterate over the top-level decls and get information on them,
2378 /// without necessary deserializing them. We could explicitly require such
2379 /// clients to use a separate API call to "realize" the decl. This should be
2380 /// relatively painless since they would presumably only do it for top-level
2381 /// decls.
2382 static bool isRequiredDecl(const Decl *D, ASTContext &Context,
2383  bool WritingModule) {
2384  // An ObjCMethodDecl is never considered as "required" because its
2385  // implementation container always is.
2386 
2387  // File scoped assembly or obj-c or OMP declare target implementation must be
2388  // seen.
2389  if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D))
2390  return true;
2391 
2392  if (WritingModule && isPartOfPerModuleInitializer(D)) {
2393  // These declarations are part of the module initializer, and are emitted
2394  // if and when the module is imported, rather than being emitted eagerly.
2395  return false;
2396  }
2397 
2398  return Context.DeclMustBeEmitted(D);
2399 }
2400 
2401 void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) {
2402  PrettyDeclStackTraceEntry CrashInfo(Context, D, SourceLocation(),
2403  "serializing");
2404 
2405  // Determine the ID for this declaration.
2407  assert(!D->isFromASTFile() && "should not be emitting imported decl");
2408  serialization::DeclID &IDR = DeclIDs[D];
2409  if (IDR == 0)
2410  IDR = NextDeclID++;
2411 
2412  ID = IDR;
2413 
2414  assert(ID >= FirstDeclID && "invalid decl ID");
2415 
2416  RecordData Record;
2417  ASTDeclWriter W(*this, Context, Record);
2418 
2419  // Build a record for this declaration
2420  W.Visit(D);
2421 
2422  // Emit this declaration to the bitstream.
2423  uint64_t Offset = W.Emit(D);
2424 
2425  // Record the offset for this declaration
2426  SourceLocation Loc = D->getLocation();
2427  unsigned Index = ID - FirstDeclID;
2428  if (DeclOffsets.size() == Index)
2429  DeclOffsets.emplace_back(Loc, Offset, DeclTypesBlockStartOffset);
2430  else if (DeclOffsets.size() < Index) {
2431  // FIXME: Can/should this happen?
2432  DeclOffsets.resize(Index+1);
2433  DeclOffsets[Index].setLocation(Loc);
2434  DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
2435  } else {
2436  llvm_unreachable("declarations should be emitted in ID order");
2437  }
2438 
2439  SourceManager &SM = Context.getSourceManager();
2440  if (Loc.isValid() && SM.isLocalSourceLocation(Loc))
2441  associateDeclWithFile(D, ID);
2442 
2443  // Note declarations that should be deserialized eagerly so that we can add
2444  // them to a record in the AST file later.
2445  if (isRequiredDecl(D, Context, WritingModule))
2446  EagerlyDeserializedDecls.push_back(ID);
2447 }
2448 
2450  // Switch case IDs are per function body.
2451  Writer->ClearSwitchCaseIDs();
2452 
2453  assert(FD->doesThisDeclarationHaveABody());
2454  bool ModulesCodegen = false;
2455  if (!FD->isDependentContext()) {
2457  if (Writer->WritingModule &&
2458  Writer->WritingModule->isInterfaceOrPartition()) {
2459  // When building a C++20 module interface unit or a partition unit, a
2460  // strong definition in the module interface is provided by the
2461  // compilation of that unit, not by its users. (Inline functions are still
2462  // emitted in module users.)
2463  Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2464  ModulesCodegen = *Linkage == GVA_StrongExternal;
2465  }
2466  if (Writer->Context->getLangOpts().ModulesCodegen ||
2467  (FD->hasAttr<DLLExportAttr>() &&
2468  Writer->Context->getLangOpts().BuildingPCHWithObjectFile)) {
2469 
2470  // Under -fmodules-codegen, codegen is performed for all non-internal,
2471  // non-always_inline functions, unless they are available elsewhere.
2472  if (!FD->hasAttr<AlwaysInlineAttr>()) {
2473  if (!Linkage)
2474  Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2475  ModulesCodegen =
2477  }
2478  }
2479  }
2480  Record->push_back(ModulesCodegen);
2481  if (ModulesCodegen)
2482  Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2483  if (auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2484  Record->push_back(CD->getNumCtorInitializers());
2485  if (CD->getNumCtorInitializers())
2486  AddCXXCtorInitializers(
2487  llvm::makeArrayRef(CD->init_begin(), CD->init_end()));
2488  }
2489  AddStmt(FD->getBody());
2490 }
clang::serialization::DECL_CXX_METHOD
@ DECL_CXX_METHOD
A CXXMethodDecl record.
Definition: ASTBitCodes.h:1389
clang::DeclaratorDecl::getInnerLocStart
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
Definition: Decl.h:769
clang::ExplicitSpecifier
Store information needed for an explicit specifier.
Definition: DeclCXX.h:1828
clang::serialization::EXPR_CHARACTER_LITERAL
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
Definition: ASTBitCodes.h:1617
clang::serialization::DECL_NAMESPACE
@ DECL_NAMESPACE
A NamespaceDecl record.
Definition: ASTBitCodes.h:1347
clang::VarTemplatePartialSpecializationDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:2995
clang::TemplateDecl::getTemplatedDecl
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
Definition: DeclTemplate.h:432
clang::ObjCInterfaceDecl
Represents an ObjC class declaration.
Definition: DeclObjC.h:1150
clang::RecordDecl::hasFlexibleArrayMember
bool hasFlexibleArrayMember() const
Definition: Decl.h:3962
clang::CXXConstructorDecl::getExplicitSpecifier
ExplicitSpecifier getExplicitSpecifier()
Definition: DeclCXX.h:2508
clang::OMPAllocateDecl
This represents '#pragma omp allocate ...' directive.
Definition: DeclOpenMP.h:473
clang::EmptyDecl
Represents an empty-declaration.
Definition: Decl.h:4639
clang::UsingDirectiveDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Definition: DeclCXX.h:2960
clang::ASTDeclWriter::VisitObjCCategoryDecl
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
Definition: ASTWriterDecl.cpp:835
clang::ConceptDecl::getConstraintExpr
Expr * getConstraintExpr() const
Definition: DeclTemplate.h:3268
clang::serialization::DECL_OMP_DECLARE_MAPPER
@ DECL_OMP_DECLARE_MAPPER
An OMPDeclareMapperDecl record.
Definition: ASTBitCodes.h:1506
clang::OMPDeclareReductionDecl::getInitializer
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:239
clang::ASTDeclWriter::VisitFileScopeAsmDecl
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
Definition: ASTWriterDecl.cpp:1158
clang::ObjCPropertyImplDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2826
clang::FunctionDecl::doesThisDeclarationHaveABody
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
Definition: Decl.h:2179
clang::ObjCCompatibleAliasDecl
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2723
clang::ASTDeclWriter::VisitDeclContext
void VisitDeclContext(DeclContext *DC)
Emit the DeclContext part of a declaration context decl.
Definition: ASTWriterDecl.cpp:1783
clang::ASTRecordWriter::AddFunctionDefinition
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
Definition: ASTWriterDecl.cpp:2449
clang::FunctionDecl::getDefaultedFunctionInfo
DefaultedFunctionInfo * getDefaultedFunctionInfo() const
Definition: Decl.cpp:3011
clang::serialization::DECL_CAPTURED
@ DECL_CAPTURED
A CapturedDecl record.
Definition: ASTBitCodes.h:1322
clang::AccessSpecDecl
Represents an access specifier followed by colon ':'.
Definition: DeclCXX.h:86
clang::FunctionDecl::isDefaulted
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2231
clang::BlockDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:4294
clang::ASTDeclWriter::VisitClassTemplatePartialSpecializationDecl
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
Definition: ASTWriterDecl.cpp:1579
clang::serialization::DECL_USING
@ DECL_USING
A UsingDecl record.
Definition: ASTBitCodes.h:1353
clang::serialization::DECL_PARM_VAR
@ DECL_PARM_VAR
A ParmVarDecl record.
Definition: ASTBitCodes.h:1307
clang::serialization::DECL_USING_SHADOW
@ DECL_USING_SHADOW
A UsingShadowDecl record.
Definition: ASTBitCodes.h:1362
clang::ObjCMethodDecl::hasRedeclaration
bool hasRedeclaration() const
True if redeclared in the same interface.
Definition: DeclObjC.h:274
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::FunctionDecl::hasWrittenPrototype
bool hasWrittenPrototype() const
Whether this function has a written prototype.
Definition: Decl.h:2284
clang::CXXConstructorDecl
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2434
clang::VarDecl::getStorageDuration
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
Definition: Decl.h:1144
clang::RecordDecl::hasVolatileMember
bool hasVolatileMember() const
Definition: Decl.h:3992
clang::ExportDecl::getRBraceLoc
SourceLocation getRBraceLoc() const
Definition: Decl.h:4611
clang::Decl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: DeclBase.h:424
clang::FriendTemplateDecl::getFriendLoc
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
Definition: DeclTemplate.h:2513
clang::ASTDeclWriter::VisitPragmaCommentDecl
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
Definition: ASTWriterDecl.cpp:338
clang::BlockDecl::isVariadic
bool isVariadic() const
Definition: Decl.h:4283
clang::ObjCProtocolDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2117
clang::FriendTemplateDecl
Declaration of a friend template.
Definition: DeclTemplate.h:2461
clang::ASTDeclWriter::VisitUsingEnumDecl
void VisitUsingEnumDecl(UsingEnumDecl *D)
Definition: ASTWriterDecl.cpp:1289
clang::MSGuidDeclParts
Parts of a decomposed MSGuidDecl.
Definition: DeclCXX.h:4149
clang::TypeSourceInfo::getType
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6541
clang::TemplateTemplateParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1736
clang::RecordDecl::hasNonTrivialToPrimitiveCopyCUnion
bool hasNonTrivialToPrimitiveCopyCUnion() const
Definition: Decl.h:4047
clang::NamespaceDecl::getRBraceLoc
SourceLocation getRBraceLoc() const
Definition: Decl.h:656
clang::DependentFunctionTemplateSpecializationInfo
Provides information about a dependent function-template specialization declaration.
Definition: DeclTemplate.h:684
clang::serialization::DECL_UNRESOLVED_USING_IF_EXISTS
@ DECL_UNRESOLVED_USING_IF_EXISTS
An UnresolvedUsingIfExistsDecl record.
Definition: ASTBitCodes.h:1446
clang::NamespaceDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Decl.h:655
clang::TemplateTypeParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Definition: DeclTemplate.h:1283
clang::serialization::EXPR_INTEGER_LITERAL
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
Definition: ASTBitCodes.h:1605
clang::VarDecl::isInlineSpecified
bool isInlineSpecified() const
Definition: Decl.h:1462
clang::MemberSpecializationInfo
Provides information a specialization of a member of a class template, which may be a member function...
Definition: DeclTemplate.h:620
clang::DeclarationName::Identifier
@ Identifier
Definition: DeclarationName.h:209
clang::ASTDeclWriter::VisitTypeAliasTemplateDecl
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
Definition: ASTWriterDecl.cpp:1768
clang::serialization::DECL_EMPTY
@ DECL_EMPTY
An EmptyDecl record.
Definition: ASTBitCodes.h:1485
clang::Decl::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: DeclBase.h:428
clang::serialization::DECL_FRIEND_TEMPLATE
@ DECL_FRIEND_TEMPLATE
A FriendTemplateDecl record.
Definition: ASTBitCodes.h:1407
clang::ObjCImplementationDecl::init_end
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Definition: DeclObjC.h:2626
clang::FunctionDecl::TK_MemberSpecialization
@ TK_MemberSpecialization
Definition: Decl.h:1886
clang::RecordDecl::getArgPassingRestrictions
ArgPassingKind getArgPassingRestrictions() const
Definition: Decl.h:4062
clang::LinkageSpecDecl
Represents a linkage specification.
Definition: DeclCXX.h:2830
clang::DecompositionDecl::bindings
ArrayRef< BindingDecl * > bindings() const
Definition: DeclCXX.h:4083
clang::serialization::DECL_TYPE_ALIAS_TEMPLATE
@ DECL_TYPE_ALIAS_TEMPLATE
A TypeAliasTemplateDecl record.
Definition: ASTBitCodes.h:1440
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1376
clang::serialization::DECL_DECOMPOSITION
@ DECL_DECOMPOSITION
A DecompositionDecl record.
Definition: ASTBitCodes.h:1310
clang::FunctionDecl::TK_FunctionTemplate
@ TK_FunctionTemplate
Definition: Decl.h:1883
clang::CXXConversionDecl
Represents a C++ conversion function within a class.
Definition: DeclCXX.h:2764
clang::Decl::hasAttr
bool hasAttr() const
Definition: DeclBase.h:549
clang::Redeclarable
Provides common interface for the Decls that can be redeclared.
Definition: Redeclarable.h:84
clang::ObjCPropertyImplDecl::getSetterCXXAssignment
Expr * getSetterCXXAssignment() const
Definition: DeclObjC.h:2862
clang::ObjCPropertyDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:897
clang::CXXRecordDecl::getMemberSpecializationInfo
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization,...
Definition: DeclCXX.cpp:1810
clang::NamespaceAliasDecl
Represents a C++ namespace alias.
Definition: DeclCXX.h:3019
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2548
clang::ASTDeclWriter::VisitTagDecl
void VisitTagDecl(TagDecl *D)
Definition: ASTWriterDecl.cpp:410
clang::ClassTemplatePartialSpecializationDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:2149
clang::serialization::DECL_USING_PACK
@ DECL_USING_PACK
A UsingPackDecl record.
Definition: ASTBitCodes.h:1359
clang::FunctionTemplateSpecializationInfo::TemplateArguments
const TemplateArgumentList * TemplateArguments
The template arguments used to produce the function template specialization from the function templat...
Definition: DeclTemplate.h:485
clang::serialization::DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION
@ DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION
A ClassScopeFunctionSpecializationDecl record a class scope function specialization.
Definition: ASTBitCodes.h:1470
clang::MSPropertyDecl::getGetterId
IdentifierInfo * getGetterId() const
Definition: DeclCXX.h:4142
clang::Decl::isOutOfLine
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
Definition: Decl.cpp:101
clang::ASTDeclWriter::VisitUnresolvedUsingTypenameDecl
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
Definition: ASTWriterDecl.cpp:1346
clang::ASTDeclWriter::VisitMSPropertyDecl
void VisitMSPropertyDecl(MSPropertyDecl *D)
Definition: ASTWriterDecl.cpp:953
clang::UsingDirectiveDecl
Represents C++ using-directive.
Definition: DeclCXX.h:2915
clang::ObjCImplementationDecl::init_begin
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
Definition: DeclObjC.h:2617
clang::BindingDecl
A binding in a decomposition declaration.
Definition: DeclCXX.h:3992
clang::serialization::DECL_OMP_THREADPRIVATE
@ DECL_OMP_THREADPRIVATE
An OMPThreadPrivateDecl record.
Definition: ASTBitCodes.h:1476
llvm::SmallVector
Definition: LLVM.h:38
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::OMPThreadPrivateDecl
This represents '#pragma omp threadprivate ...' directive.
Definition: DeclOpenMP.h:110
clang::serialization::DECL_PRAGMA_COMMENT
@ DECL_PRAGMA_COMMENT
A PragmaCommentDecl record.
Definition: ASTBitCodes.h:1500
clang::ASTDeclWriter::VisitCXXDeductionGuideDecl
void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D)
Definition: ASTWriterDecl.cpp:676
clang::VarTemplateSpecializationDecl::getTemplateInstantiationArgs
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
Definition: DeclTemplate.h:2856
clang::VarDecl::isInitCapture
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
Definition: Decl.h:1486
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:247
clang::DeclContext::getPrimaryContext
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
Definition: DeclBase.cpp:1242
clang::ASTDeclWriter::VisitCapturedDecl
void VisitCapturedDecl(CapturedDecl *D)
Definition: ASTWriterDecl.cpp:1210
clang::OMPDeclareReductionDecl::getInitPriv
Expr * getInitPriv()
Get Priv variable of the initializer.
Definition: DeclOpenMP.h:249
clang::ClassTemplateSpecializationDecl::getPointOfInstantiation
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
Definition: DeclTemplate.h:1957
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:3811
clang::ClassTemplateSpecializationDecl::getSpecializedTemplate
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
Definition: DeclTemplate.cpp:965
clang::ASTRecordWriter::push_back
void push_back(uint64_t N)
Minimal vector-like interface.
Definition: ASTRecordWriter.h:79
clang::ClassTemplateSpecializationDecl::getExternLoc
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
Definition: DeclTemplate.h:2047
clang::ASTWriter::getFirstLocalDecl
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
Definition: ASTWriterDecl.cpp:1788
clang::ConceptReference::getNamedConcept
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:152
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:731
clang::TypeDecl::getTypeForDecl
const Type * getTypeForDecl() const
Definition: Decl.h:3189
clang::EnumDecl::isFixed
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:3844
clang::NonTypeTemplateParmDecl
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Definition: DeclTemplate.h:1401
Attr.h
clang::FileScopeAsmDecl::getRParenLoc
SourceLocation getRParenLoc() const
Definition: Decl.h:4191
clang::TypedefNameDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:3257
clang::TypeConstraint::getImmediatelyDeclaredConstraint
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
Definition: ASTConcept.h:185
clang::ASTDeclWriter::VisitNamespaceDecl
void VisitNamespaceDecl(NamespaceDecl *D)
Definition: ASTWriterDecl.cpp:1242
clang::ClassScopeFunctionSpecializationDecl::hasExplicitTemplateArgs
bool hasExplicitTemplateArgs() const
Definition: DeclTemplate.h:2641
clang::CapturedDecl::getNumParams
unsigned getNumParams() const
Definition: Decl.h:4442
clang::ObjCIvarDecl::getAccessControl
AccessControl getAccessControl() const
Definition: DeclObjC.h:1972
clang::serialization::DECL_USING_ENUM
@ DECL_USING_ENUM
A UsingEnumDecl record.
Definition: ASTBitCodes.h:1356
clang::ClassScopeFunctionSpecializationDecl
Declaration of a function specialization at template class scope.
Definition: DeclTemplate.h:2621
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2862
clang::ASTDeclWriter::VisitVarDecl
void VisitVarDecl(VarDecl *D)
Definition: ASTWriterDecl.cpp:992
clang::ClassTemplateSpecializationDecl::getSpecializationKind
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
Definition: DeclTemplate.h:1918
clang::UnresolvedUsingTypenameDecl::getEllipsisLoc
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Definition: DeclCXX.h:3895
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:3009
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1680
clang::Redeclarable::getFirstDecl
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Definition: Redeclarable.h:216
DeclCXX.h
clang::ObjCPropertyImplDecl::getGetterMethodDecl
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:2848
clang::ObjCCategoryDecl::getClassInterface
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2321
clang::Decl::isUsed
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:443
clang::EnumDecl::getODRHash
unsigned getODRHash()
Definition: Decl.cpp:4582
clang::serialization::DECL_CONSTRUCTOR_USING_SHADOW
@ DECL_CONSTRUCTOR_USING_SHADOW
A ConstructorUsingShadowDecl record.
Definition: ASTBitCodes.h:1365
clang::DependentFunctionTemplateSpecializationInfo::getTemplateArg
const TemplateArgumentLoc & getTemplateArg(unsigned I) const
Returns the nth template argument.
Definition: DeclTemplate.h:738
clang::ASTDeclWriter::AddObjCTypeParamList
void AddObjCTypeParamList(ObjCTypeParamList *typeParams)
Add an Objective-C type parameter list to the given record.
Definition: ASTWriterDecl.cpp:162
clang::FunctionDecl::TK_FunctionTemplateSpecialization
@ TK_FunctionTemplateSpecialization
Definition: Decl.h:1890
clang::DependentFunctionTemplateSpecializationInfo::getNumTemplateArgs
unsigned getNumTemplateArgs() const
Returns the number of explicit template arguments that were given.
Definition: DeclTemplate.h:731
clang::ASTContext::getInstantiatedFromUsingEnumDecl
UsingEnumDecl * getInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst)
If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.
Definition: ASTContext.cpp:1582
clang::EnumConstantDecl::getInitExpr
const Expr * getInitExpr() const
Definition: Decl.h:3096
clang::TemplateSubstitutionKind::Specialization
@ Specialization
We are substituting template parameters for template arguments in order to form a template specializa...
clang::UsingShadowDecl
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3220
clang::ASTDeclWriter::VisitVarTemplatePartialSpecializationDecl
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
Definition: ASTWriterDecl.cpp:1639
clang::ASTDeclWriter::VisitFunctionTemplateDecl
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
Definition: ASTWriterDecl.cpp:1666
clang::ASTDeclWriter::VisitOMPDeclareReductionDecl
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
Definition: ASTWriterDecl.cpp:1882
clang::NonTypeTemplateParmDecl::getExpansionType
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
Definition: DeclTemplate.h:1561
clang::Decl::getIdentifierNamespace
unsigned getIdentifierNamespace() const
Definition: DeclBase.h:843
clang::ASTDeclWriter::VisitNamedDecl
void VisitNamedDecl(NamedDecl *D)
Definition: ASTWriterDecl.cpp:364
clang::BlockDecl::getBody
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
Definition: Decl.h:4287
clang::FunctionDecl::getTemplateSpecializationInfo
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
Definition: Decl.cpp:3887
clang::FunctionDecl::hasImplicitReturnZero
bool hasImplicitReturnZero() const
Whether falling off this function implicitly returns null/zero.
Definition: Decl.h:2264
clang::ObjCPropertyImplDecl
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2753
clang::ASTDeclWriter::VisitVarTemplateSpecializationDecl
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
Definition: ASTWriterDecl.cpp:1603
clang::ParmVarDecl::getObjCDeclQualifier
ObjCDeclQualifier getObjCDeclQualifier() const
Definition: Decl.h:1744
clang::MSGuidDecl::getParts
Parts getParts() const
Get the decomposed parts of this declaration.
Definition: DeclCXX.h:4203
clang::serialization::DECL_IMPLICIT_PARAM
@ DECL_IMPLICIT_PARAM
An ImplicitParamDecl record.
Definition: ASTBitCodes.h:1304
llvm::Optional
Definition: LLVM.h:40
clang::ComparisonCategoryType::First
@ First
clang::ASTContext::getObjCMethodRedeclaration
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
Definition: ASTContext.cpp:2929
clang::TagDecl::isEmbeddedInDeclarator
bool isEmbeddedInDeclarator() const
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
Definition: Decl.h:3484
clang::serialization::DECL_UNRESOLVED_USING_TYPENAME
@ DECL_UNRESOLVED_USING_TYPENAME
An UnresolvedUsingTypenameDecl record.
Definition: ASTBitCodes.h:1374
SourceManager.h
clang::NonTypeTemplateParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1480
clang::UnresolvedUsingTypenameDecl::getTypenameLoc
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
Definition: DeclCXX.h:3874
clang::VarTemplateSpecializationDecl::getTemplateArgs
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
Definition: DeclTemplate.h:2772
clang::ASTDeclWriter::VisitDecl
void VisitDecl(Decl *D)
Definition: ASTWriterDecl.cpp:299
clang::TagDecl::getTypedefNameForAnonDecl
TypedefNameDecl * getTypedefNameForAnonDecl() const
Definition: Decl.h:3583
clang::serialization::DECL_CLASS_TEMPLATE
@ DECL_CLASS_TEMPLATE
A ClassTemplateDecl record.
Definition: ASTBitCodes.h:1410
clang::ASTDeclWriter::VisitTypeAliasDecl
void VisitTypeAliasDecl(TypeAliasDecl *D)
Definition: ASTWriterDecl.cpp:404
clang::serialization::DECL_OBJC_PROPERTY_IMPL
@ DECL_OBJC_PROPERTY_IMPL
A ObjCPropertyImplDecl record.
Definition: ASTBitCodes.h:1286
clang::ObjCPropertyImplDecl::getPropertyIvarDeclLoc
SourceLocation getPropertyIvarDeclLoc() const
Definition: DeclObjC.h:2829
clang::IndirectFieldDecl::getChainingSize
unsigned getChainingSize() const
Definition: Decl.h:3144
clang::ClassTemplatePartialSpecializationDecl
Definition: DeclTemplate.h:2092
clang::UsingPackDecl
Represents a pack of using declarations that a single using-declarator pack-expanded into.
Definition: DeclCXX.h:3677
clang::CXXDestructorDecl::getOperatorDelete
const FunctionDecl * getOperatorDelete() const
Definition: DeclCXX.h:2734
clang::ExportDecl
Represents a C++ Modules TS module export declaration.
Definition: Decl.h:4592
clang::ObjCPropertyDecl::getPropertyImplementation
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:908
clang::ASTDeclWriter::VisitEnumDecl
void VisitEnumDecl(EnumDecl *D)
Definition: ASTWriterDecl.cpp:434
clang::RedeclarableTemplateDecl
Declaration of a redeclarable template.
Definition: DeclTemplate.h:753
clang::MSGuidDeclParts::Part1
uint32_t Part1
{01234567-...
Definition: DeclCXX.h:4151
clang::serialization::DECL_REQUIRES_EXPR_BODY
@ DECL_REQUIRES_EXPR_BODY
A RequiresExprBodyDecl record.
Definition: ASTBitCodes.h:1491
clang::FunctionDecl::isInlineSpecified
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2618
clang::ASTContext::getCurrentKeyFunction
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or nullptr if there isn't on...
Definition: RecordLayoutBuilder.cpp:3362
clang::ASTTemplateArgumentListInfo::NumTemplateArgs
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
Definition: TemplateBase.h:632
clang::LifetimeExtendedTemporaryDecl::getManglingNumber
unsigned getManglingNumber() const
Definition: DeclCXX.h:3178
clang::VarTemplateSpecializationDecl
Represents a variable template specialization, which refers to a variable template with a given set o...
Definition: DeclTemplate.h:2681
clang::Decl::isTopLevelDeclInObjCContainer
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc....
Definition: DeclBase.h:600
clang::CapturedDecl
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4397
clang::serialization::DECL_FIELD
@ DECL_FIELD
A FieldDecl record.
Definition: ASTBitCodes.h:1289
clang::serialization::DECL_TYPEALIAS
@ DECL_TYPEALIAS
A TypeAliasDecl record.
Definition: ASTBitCodes.h:1241
clang::FunctionDecl::getMemberSpecializationInfo
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization,...
Definition: Decl.cpp:3755
clang::ASTDeclWriter::VisitClassScopeFunctionSpecializationDecl
void VisitClassScopeFunctionSpecializationDecl(ClassScopeFunctionSpecializationDecl *D)
Definition: ASTWriterDecl.cpp:1655
clang::ASTDeclWriter::VisitObjCImplementationDecl
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
Definition: ASTWriterDecl.cpp:889
clang::AccessSpecDecl::getColonLoc
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
Definition: DeclCXX.h:108
clang::ObjCMethodDecl::isOverriding
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
Definition: DeclObjC.h:467
clang::FunctionDecl::param_size
size_t param_size() const
Definition: Decl.h:2526
clang::serialization::isPartOfPerModuleInitializer
bool isPartOfPerModuleInitializer(const Decl *D)
Determine whether the given declaration will be included in the per-module initializer if it needs to...
Definition: ASTCommon.h:116
clang::serialization::DECL_UNNAMED_GLOBAL_CONSTANT
@ DECL_UNNAMED_GLOBAL_CONSTANT
A UnnamedGlobalConstantDecl record.
Definition: ASTBitCodes.h:1512
clang::ASTContext::getSourceManager
SourceManager & getSourceManager()
Definition: ASTContext.h:716
clang::RecordDecl::isNonTrivialToPrimitiveDestroy
bool isNonTrivialToPrimitiveDestroy() const
Definition: Decl.h:4023
clang::TemplateTypeParmDecl::hasTypeConstraint
bool hasTypeConstraint() const
Determine whether this template parameter has a type-constraint.
Definition: DeclTemplate.h:1375
clang::Decl::isReferenced
bool isReferenced() const
Whether any declaration of this entity was referenced.
Definition: DeclBase.cpp:468
clang::serialization::DECL_RECORD
@ DECL_RECORD
A RecordDecl record.
Definition: ASTBitCodes.h:1247
clang::serialization::DECL_FUNCTION_TEMPLATE
@ DECL_FUNCTION_TEMPLATE
A FunctionTemplateDecl record.
Definition: ASTBitCodes.h:1428
clang::serialization::DECL_OBJC_INTERFACE
@ DECL_OBJC_INTERFACE
A ObjCInterfaceDecl record.
Definition: ASTBitCodes.h:1259
clang::ASTDeclWriter::VisitObjCImplDecl
void VisitObjCImplDecl(ObjCImplDecl *D)
Definition: ASTWriterDecl.cpp:877
clang::EnumDecl::getNumPositiveBits
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum.
Definition: Decl.h:3821
clang::OMPDeclareReductionDecl::getCombinerOut
Expr * getCombinerOut()
Get Out variable of the combiner.
Definition: DeclOpenMP.h:227
clang::TemplateTypeParmDecl::getDefaultArgumentInfo
TypeSourceInfo * getDefaultArgumentInfo() const
Retrieves the default argument's source information, if any.
Definition: DeclTemplate.h:1274
clang::ObjCImplDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2436
clang::SourceManager
This class handles loading and caching of source files into memory.
Definition: SourceManager.h:627
clang::EnumDecl
Represents an enum.
Definition: Decl.h:3635
clang::serialization::DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION
@ DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION
A ClassTemplatePartialSpecializationDecl record.
Definition: ASTBitCodes.h:1416
clang::Decl::getModuleOwnershipKind
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
Definition: DeclBase.h:830
clang::FieldDecl::hasCapturedVLAType
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
Definition: Decl.h:3035
clang::ASTDeclWriter::VisitFriendDecl
void VisitFriendDecl(FriendDecl *D)
Definition: ASTWriterDecl.cpp:1469
clang::VarTemplatePartialSpecializationDecl::getInstantiatedFromMember
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
Definition: DeclTemplate.h:3038
clang::ASTDeclWriter::AddTemplateSpecializations
void AddTemplateSpecializations(DeclTy *D)
Definition: ASTWriterDecl.cpp:210
clang::ASTDeclWriter::VisitUsingPackDecl
void VisitUsingPackDecl(UsingPackDecl *D)
Definition: ASTWriterDecl.cpp:1299
clang::UsingShadowDecl::getTargetDecl
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3284
clang::ASTRecordWriter::AddSourceLocation
void AddSourceLocation(SourceLocation Loc, LocSeq *Seq=nullptr)
Emit a source location.
Definition: ASTRecordWriter.h:137
clang::FunctionDecl::isInlined
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
Definition: Decl.h:2640
clang::FunctionTemplateSpecializationInfo::getTemplate
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
Definition: DeclTemplate.h:527
clang::TemplateTypeParmDecl::hasDefaultArgument
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Definition: DeclTemplate.h:1266
clang::ASTDeclWriter::getSpecializationDecl
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
Definition: ASTWriterDecl.cpp:196
clang::ASTDeclWriter::VisitFunctionDecl
void VisitFunctionDecl(FunctionDecl *D)
Definition: ASTWriterDecl.cpp:541
clang::FunctionDecl::isVirtualAsWritten
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2197
Offset
unsigned Offset
Definition: Format.cpp:2574
clang::ASTDeclWriter::VisitImportDecl
void VisitImportDecl(ImportDecl *D)
Definition: ASTWriterDecl.cpp:1445
clang::serialization::DECL_CXX_RECORD
@ DECL_CXX_RECORD
A CXXRecordDecl record.
Definition: ASTBitCodes.h:1383
clang::PragmaCommentDecl::getCommentKind
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:161
clang::AS_none
@ AS_none
Definition: Specifiers.h:112
uint64_t
unsigned long uint64_t
Definition: hlsl_basic_types.h:24
clang::ObjCInterfaceDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
Definition: DeclObjC.h:1508
clang::BlockDecl::captures
ArrayRef< Capture > captures() const
Definition: Decl.h:4335
clang::OMPDeclareMapperDecl::getVarName
DeclarationName getVarName()
Get the name of the variable declared in the mapper.
Definition: DeclOpenMP.h:359
clang::BlockDecl::doesNotEscape
bool doesNotEscape() const
Definition: Decl.h:4359
clang::serialization::needsAnonymousDeclarationNumber
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
Definition: ASTCommon.cpp:449
clang::CXXRecordDecl::getDescribedClassTemplate
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
Definition: DeclCXX.cpp:1824
clang::FunctionDecl::getODRHash
unsigned getODRHash()
Returns ODRHash of the function.
Definition: Decl.cpp:4210
clang::UnresolvedUsingTypenameDecl
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3842
clang::ASTRecordWriter::AddStmt
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
Definition: ASTRecordWriter.h:122
clang::ASTDeclWriter::VisitTemplateTypeParmDecl
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
Definition: ASTWriterDecl.cpp:1674
clang::CXXRecordDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclCXX.h:1820
clang::Decl::getLexicalDeclContext
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:872
clang::VarDecl::isInline
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1459
clang::FunctionTemplateDecl
Declaration of a template function.
Definition: DeclTemplate.h:979
clang::ASTDeclWriter::VisitDeclaratorDecl
void VisitDeclaratorDecl(DeclaratorDecl *D)
Definition: ASTWriterDecl.cpp:527
clang::serialization::DECL_FILE_SCOPE_ASM
@ DECL_FILE_SCOPE_ASM
A FileScopeAsmDecl record.
Definition: ASTBitCodes.h:1316
clang::serialization::DECL_OBJC_COMPATIBLE_ALIAS
@ DECL_OBJC_COMPATIBLE_ALIAS
A ObjCCompatibleAliasDecl record.
Definition: ASTBitCodes.h:1280
clang::TemplateTypeParmDecl::isExpandedParameterPack
bool isExpandedParameterPack() const
Whether this parameter is a template type parameter pack that has a known list of different type-cons...
Definition: DeclTemplate.h:1353
clang::ObjCPropertyImplDecl::getSetterMethodDecl
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:2851
clang::FunctionTemplateSpecializationInfo::getPointOfInstantiation
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
Definition: DeclTemplate.h:558
clang::ObjCProtocolDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2156
clang::ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
Definition: DeclTemplate.h:2192
clang::ASTContext::getExternalSource
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
Definition: ASTContext.h:1183
clang::VarTemplateSpecializationDecl::getTemplateKeywordLoc
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
Definition: DeclTemplate.h:2919
clang::TranslationUnitDecl
The top declaration context.
Definition: Decl.h:80
clang::NonTypeTemplateParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Definition: DeclTemplate.h:1490
clang::ConceptReference::getTemplateArgsAsWritten
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:156
clang::FunctionDecl::getConstexprKind
ConstexprSpecKind getConstexprKind() const
Definition: Decl.h:2312
clang::ObjCMethodDecl::hasRelatedResultType
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
Definition: DeclObjC.h:259
clang::serialization::DECL_TEMPLATE_TEMPLATE_PARM
@ DECL_TEMPLATE_TEMPLATE_PARM
A TemplateTemplateParmDecl record.
Definition: ASTBitCodes.h:1437
clang::OMPDeclareMapperDecl::getPrevDeclInScope
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name.
Definition: DeclOpenMP.cpp:158
clang::VarTemplatePartialSpecializationDecl::isMemberSpecialization
bool isMemberSpecialization()
Determines whether this variable template partial specialization was a specialization of a member par...
Definition: DeclTemplate.h:3066
clang::CXXMethodDecl::overridden_methods
overridden_method_range overridden_methods() const
Definition: DeclCXX.cpp:2448
clang::ClassTemplateSpecializationDecl::getTemplateArgs
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
Definition: DeclTemplate.h:1908
DeclTemplate.h
clang::FunctionDecl::hasSkippedBody
bool hasSkippedBody() const
True if the function was a definition but its body was skipped.
Definition: Decl.h:2448
clang::ASTDeclWriter::VisitRedeclarableTemplateDecl
void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D)
Definition: ASTWriterDecl.cpp:1519
clang::OMPDeclareReductionDecl
This represents '#pragma omp declare reduction ...' directive.
Definition: DeclOpenMP.h:171
clang::RequiresExprBodyDecl
Represents the body of a requires-expression.
Definition: DeclCXX.h:1959
clang::Linkage
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
Definition: Linkage.h:23
clang::ImportDecl
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4512
clang::Decl::getAccess
AccessSpecifier getAccess() const
Definition: DeclBase.h:480
clang::ASTDeclWriter::VisitFieldDecl
void VisitFieldDecl(FieldDecl *D)
Definition: ASTWriterDecl.cpp:917
clang::FunctionDecl::isTrivial
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition: Decl.h:2223
clang::UsingEnumDecl::getUsingLoc
SourceLocation getUsingLoc() const
The source location of the 'using' keyword.
Definition: DeclCXX.h:3634
clang::RecordDecl::hasNonTrivialToPrimitiveDestructCUnion
bool hasNonTrivialToPrimitiveDestructCUnion() const
Definition: Decl.h:4039
clang::ASTDeclWriter::Visit
void Visit(Decl *D)
Definition: ASTWriterDecl.cpp:272
clang::ObjCImplementationDecl::getSuperClassLoc
SourceLocation getSuperClassLoc() const
Definition: DeclObjC.h:2685
clang::BlockDecl
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4208
clang::ASTDeclWriter::VisitObjCIvarDecl
void VisitObjCIvarDecl(ObjCIvarDecl *D)
Definition: ASTWriterDecl.cpp:793
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:435
clang::ObjCMethodDecl::isDefined
bool isDefined() const
Definition: DeclObjC.h:457
clang::FunctionDecl::getTemplatedKind
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
Definition: Decl.cpp:3732
clang::TypedefNameDecl::isModed
bool isModed() const
Definition: Decl.h:3253
clang::NonTypeTemplateParmDecl::getNumExpansionTypes
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
Definition: DeclTemplate.h:1554
clang::ObjCInterfaceDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:1344
ASTCommon.h
clang::ConceptDecl
Declaration of a C++2a concept.
Definition: DeclTemplate.h:3253
clang::serialization::DECL_VAR_TEMPLATE_SPECIALIZATION
@ DECL_VAR_TEMPLATE_SPECIALIZATION
A VarTemplateSpecializationDecl record.
Definition: ASTBitCodes.h:1422
clang::OMPDeclareReductionDecl::getPrevDeclInScope
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name.
Definition: DeclOpenMP.cpp:126
clang::serialization::DECL_CXX_DEDUCTION_GUIDE
@ DECL_CXX_DEDUCTION_GUIDE
A CXXDeductionGuideDecl record.
Definition: ASTBitCodes.h:1386
clang::ASTDeclWriter::VisitUnresolvedUsingValueDecl
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
Definition: ASTWriterDecl.cpp:1337
clang::VarDecl::isObjCForDecl
bool isObjCForDecl() const
Determine whether this variable is a for-loop declaration for a for-in statement in Objective-C.
Definition: Decl.h:1440
PrettyDeclStackTrace.h
clang::TemplateTemplateParmDecl::getPosition
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
Definition: DeclTemplate.h:1179
clang::CXXDeductionGuideDecl::isCopyDeductionCandidate
bool isCopyDeductionCandidate() const
Definition: DeclCXX.h:1937
clang::ObjCImplementationDecl::hasDestructors
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
Definition: DeclObjC.h:2655
clang::DeclAccessPair
A POD class for pairing a NamedDecl* with an access specifier.
Definition: DeclAccessPair.h:29
clang::VarDecl::getMemberSpecializationInfo
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization,...
Definition: Decl.cpp:2763
clang::ASTDeclWriter::VisitObjCCategoryImplDecl
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
Definition: ASTWriterDecl.cpp:883
clang::serialization::DECL_CXX_DESTRUCTOR
@ DECL_CXX_DESTRUCTOR
A CXXDestructorDecl record.
Definition: ASTBitCodes.h:1395
clang::FieldDecl::getBitWidth
Expr * getBitWidth() const
Definition: Decl.h:2951
clang::ASTDeclWriter::VisitMSGuidDecl
void VisitMSGuidDecl(MSGuidDecl *D)
Definition: ASTWriterDecl.cpp:960
clang::ClassScopeFunctionSpecializationDecl::getTemplateArgsAsWritten
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: DeclTemplate.h:2642
clang::VarDecl::isStaticDataMember
bool isStaticDataMember() const
Determines whether this is a static data member.
Definition: Decl.h:1198
clang::FunctionTemplateDecl::Common
Data that is common to all of the declarations of a given function template.
Definition: DeclTemplate.h:985
clang::TemplateTemplateParmDecl::getExpansionTemplateParameters
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
Definition: DeclTemplate.h:1727
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:208
clang::FriendDecl::getFriendDecl
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
Definition: DeclFriend.h:138
clang::VarTemplatePartialSpecializationDecl::getTemplateArgsAsWritten
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
Definition: DeclTemplate.h:3000
clang::ObjCPropertyDecl::getSetterMethodDecl
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:900
clang::ASTDeclWriter::VisitOMPThreadPrivateDecl
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
Definition: ASTWriterDecl.cpp:1864
clang::NamespaceAliasDecl::getNamespaceLoc
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
Definition: DeclCXX.h:3108
clang::DecompositionDecl
A decomposition declaration.
Definition: DeclCXX.h:4049
clang::FunctionDecl::getBody
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
Definition: Decl.cpp:3095
clang::FunctionTemplateDecl::getCanonicalDecl
FunctionTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
Definition: DeclTemplate.h:1049
clang::StaticAssertDecl::getRParenLoc
SourceLocation getRParenLoc() const
Definition: DeclCXX.h:3974
clang::ASTDeclWriter::getPartialSpecializations
decltype(T::PartialSpecializations) & getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
Definition: ASTWriterDecl.cpp:202
clang::ASTDeclWriter::VisitTypeDecl
void VisitTypeDecl(TypeDecl *D)
Definition: ASTWriterDecl.cpp:372
clang::serialization::DECL_OBJC_CATEGORY
@ DECL_OBJC_CATEGORY
A ObjCCategoryDecl record.
Definition: ASTBitCodes.h:1271
clang::UnresolvedUsingTypenameDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Definition: DeclCXX.h:3878
clang::Decl::isInvalidDecl
bool isInvalidDecl() const
Definition: DeclBase.h:560
clang::ASTDeclWriter::VisitRedeclarable
void VisitRedeclarable(Redeclarable< T > *D)
Definition: ASTWriterDecl.cpp:1806
clang::serialization::DECL_OBJC_AT_DEFS_FIELD
@ DECL_OBJC_AT_DEFS_FIELD
A ObjCAtDefsFieldDecl record.
Definition: ASTBitCodes.h:1268
clang::ObjCPropertyDecl::getSetterName
Selector getSetterName() const
Definition: DeclObjC.h:889
clang::serialization::EXPR_IMPLICIT_CAST
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
Definition: ASTBitCodes.h:1656
clang::ASTDeclWriter::VisitValueDecl
void VisitValueDecl(ValueDecl *D)
Definition: ASTWriterDecl.cpp:512
clang::serialization::DECL_LINKAGE_SPEC
@ DECL_LINKAGE_SPEC
A LinkageSpecDecl record.
Definition: ASTBitCodes.h:1377
clang::ASTDeclWriter::VisitExportDecl
void VisitExportDecl(ExportDecl *D)
Definition: ASTWriterDecl.cpp:1229
clang::serialization::DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION
@ DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION
A VarTemplatePartialSpecializationDecl record.
Definition: ASTBitCodes.h:1425
clang::VarDecl::isEscapingByref
bool isEscapingByref() const
Indicates the capture is a __block variable that is captured by a block that can potentially escape (...
Definition: Decl.cpp:2571
clang::ObjCPropertyImplDecl::getGetterCXXConstructor
Expr * getGetterCXXConstructor() const
Definition: DeclObjC.h:2854
clang::serialization::DECL_CLASS_TEMPLATE_SPECIALIZATION
@ DECL_CLASS_TEMPLATE_SPECIALIZATION
A ClassTemplateSpecializationDecl record.
Definition: ASTBitCodes.h:1413
clang::TagDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
Definition: Decl.h:3455
clang::StaticAssertDecl::getMessage
StringLiteral * getMessage()
Definition: DeclCXX.h:3969
clang::VarDecl::isNRVOVariable
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1420
clang::LabelDecl
Represents the declaration of a label.
Definition: Decl.h:494
clang::ObjCMethodDecl::getSelfDecl
ImplicitParamDecl * getSelfDecl() const
Definition: DeclObjC.h:423
clang::FriendTemplateDecl::getTemplateParameterList
TemplateParameterList * getTemplateParameterList(unsigned i) const
Definition: DeclTemplate.h:2517
clang::serialization::DECL_VAR_TEMPLATE
@ DECL_VAR_TEMPLATE
A VarTemplateDecl record.
Definition: ASTBitCodes.h:1419
clang::Decl::getCanonicalDecl
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition: DeclBase.h:930
clang::UsingDecl::getUsingLoc
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
Definition: DeclCXX.h:3439
clang::EnumDecl::getMemberSpecializationInfo
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization,...
Definition: Decl.h:3889
clang::MSPropertyDecl::getSetterId
IdentifierInfo * getSetterId() const
Definition: DeclCXX.h:4144
clang::ASTDeclWriter::VisitCXXRecordDecl
void VisitCXXRecordDecl(CXXRecordDecl *D)
Definition: ASTWriterDecl.cpp:1361
clang::EnumConstantDecl::getInitVal
const llvm::APSInt & getInitVal() const
Definition: Decl.h:3098
clang::MSGuidDecl
A global _GUID constant.
Definition: DeclCXX.h:4172
clang::TypedefNameDecl::getUnderlyingType
QualType getUnderlyingType() const
Definition: Decl.h:3262
clang::ObjCIvarDecl::getSynthesize
bool getSynthesize() const
Definition: DeclObjC.h:1979
clang::CXXDestructorDecl
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2701
clang::ObjCInterfaceDecl::getCategoryListRaw
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
Definition: DeclObjC.h:1762
isRequiredDecl
static bool isRequiredDecl(const Decl *D, ASTContext &Context, bool WritingModule)
isRequiredDecl - Check if this is a "required" Decl, which must be seen by consumers of the AST.
Definition: ASTWriterDecl.cpp:2382
clang::ASTDeclWriter::VisitRequiresExprBodyDecl
void VisitRequiresExprBodyDecl(RequiresExprBodyDecl *D)
Definition: ASTWriterDecl.cpp:1515
clang::EnumDecl::getMostRecentDecl
EnumDecl * getMostRecentDecl()
Definition: Decl.h:3731
clang::ImplicitParamDecl
Definition: Decl.h:1613
clang::ASTDeclWriter::VisitCXXConversionDecl
void VisitCXXConversionDecl(CXXConversionDecl *D)
Definition: ASTWriterDecl.cpp:1439
clang::FieldDecl::hasInClassInitializer
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition: Decl.h:3002
Expr.h
clang::FriendTemplateDecl::getFriendDecl
NamedDecl * getFriendDecl() const
If this friend declaration names a templated function (or a member function of a templated type),...
Definition: DeclTemplate.h:2508
clang::ASTDeclWriter::VisitLifetimeExtendedTemporaryDecl
void VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D)
Definition: ASTWriterDecl.cpp:1170
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:1618
clang::TypeDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: Decl.h:3192
clang::TemplateTemplateParmDecl::getNumExpansionTemplateParameters
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
Definition: DeclTemplate.h:1720
clang::serialization::DECL_OBJC_PROPERTY
@ DECL_OBJC_PROPERTY
A ObjCPropertyDecl record.
Definition: ASTBitCodes.h:1283
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:874
clang::ObjCMethodDecl::getReturnType
QualType getReturnType() const
Definition: DeclObjC.h:332
clang::serialization::DECL_OMP_REQUIRES
@ DECL_OMP_REQUIRES
An OMPRequiresDecl record.
Definition: ASTBitCodes.h:1479
clang::ASTDeclWriter::VisitTranslationUnitDecl
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
Definition: ASTWriterDecl.cpp:360
clang::serialization::DECL_CXX_CONVERSION
@ DECL_CXX_CONVERSION
A CXXConversionDecl record.
Definition: ASTBitCodes.h:1398
clang::EnumDecl::getPromotionType
QualType getPromotionType() const
Return the integer type that enumerators should promote to.
Definition: Decl.h:3787
clang::serialization::DECL_USING_DIRECTIVE
@ DECL_USING_DIRECTIVE
A UsingDirecitveDecl record.
Definition: ASTBitCodes.h:1368
clang::ASTRecordWriter::size
size_t size() const
Definition: ASTRecordWriter.h:85
clang::TagDecl
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3355
clang::OMPDeclareMapperDecl
This represents '#pragma omp declare mapper ...' directive.
Definition: DeclOpenMP.h:286
clang::PragmaCommentDecl::getArg
StringRef getArg() const
Definition: Decl.h:163
clang::UsingDirectiveDecl::getNamespaceKeyLocation
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
Definition: DeclCXX.h:2990
clang::ObjCCategoryImplDecl
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2495
clang::serialization::DECL_ENUM
@ DECL_ENUM
An EnumDecl record.
Definition: ASTBitCodes.h:1244
clang::TypeDecl
Represents a declaration of a type.
Definition: Decl.h:3165
clang::Type::getAsCXXRecordDecl
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
Definition: Type.cpp:1759
clang::NamedDecl::isModulePrivate
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:614
clang::serialization::DECL_STATIC_ASSERT
@ DECL_STATIC_ASSERT
A StaticAssertDecl record.
Definition: ASTBitCodes.h:1449
clang::DependentFunctionTemplateSpecializationInfo::getNumTemplates
unsigned getNumTemplates() const
Returns the number of function templates that this might be a specialization of.
Definition: DeclTemplate.h:717
clang::ImportDecl::getIdentifierLocs
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
Definition: Decl.cpp:5229
clang::ASTDeclWriter::VisitConstructorUsingShadowDecl
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
Definition: ASTWriterDecl.cpp:1318
clang::serialization::DECL_OBJC_TYPE_PARAM
@ DECL_OBJC_TYPE_PARAM
An ObjCTypeParamDecl record.
Definition: ASTBitCodes.h:1494
clang::EnumConstantDecl
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3077
clang::serialization::DECL_MS_GUID
@ DECL_MS_GUID
A MSGuidDecl record.
Definition: ASTBitCodes.h:1295
clang::CapturedDecl::getParam
ImplicitParamDecl * getParam(unsigned i) const
Definition: Decl.h:4444
clang::ObjCMethodDecl::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: DeclObjC.cpp:1012
clang::ObjCAtDefsFieldDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:2020
clang::ASTDeclWriter::VisitFriendTemplateDecl
void VisitFriendTemplateDecl(FriendTemplateDecl *D)
Definition: ASTWriterDecl.cpp:1488
clang::Redeclarable::getPreviousDecl
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Definition: Redeclarable.h:204
clang::ObjCMethodDecl::getReturnTypeSourceInfo
TypeSourceInfo * getReturnTypeSourceInfo() const
Definition: DeclObjC.h:346
clang::serialization::DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK
@ DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack.
Definition: ASTBitCodes.h:1466
clang::OMPDeclareReductionDecl::getCombinerIn
Expr * getCombinerIn()
Get In variable of the combiner.
Definition: DeclOpenMP.h:224
clang::EnumDecl::isScopedUsingClassTag
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3838
clang::BlockVarCopyInit
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
Definition: Expr.h:6016
clang::ASTWriter
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:85
clang::ClassTemplateSpecializationDecl::getTemplateInstantiationArgs
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
Definition: DeclTemplate.h:2003
clang::RecordDecl::isParamDestroyedInCallee
bool isParamDestroyedInCallee() const
Definition: Decl.h:4070
clang::UnresolvedUsingValueDecl
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3746
clang::ObjCPropertyDecl::getType
QualType getType() const
Definition: DeclObjC.h:800
clang::Redeclarable::isFirstDecl
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Definition: Redeclarable.h:223
clang::TagDecl::isCompleteDefinition
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3460
clang::ObjCImplementationDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2690
clang::ASTDeclWriter::VisitObjCMethodDecl
void VisitObjCMethodDecl(ObjCMethodDecl *D)
Definition: ASTWriterDecl.cpp:684
clang::ASTDeclWriter::VisitIndirectFieldDecl
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
Definition: ASTWriterDecl.cpp:983
clang::NamespaceDecl::isOriginalNamespace
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2905
clang::ASTDeclWriter::VisitEnumConstantDecl
void VisitEnumConstantDecl(EnumConstantDecl *D)
Definition: ASTWriterDecl.cpp:517
clang::serialization::EXPR_DECL_REF
@ EXPR_DECL_REF
A DeclRefExpr record.
Definition: ASTBitCodes.h:1602
clang::TemplateTypeParmDecl
Declaration of a template type parameter.
Definition: DeclTemplate.h:1196
clang::ParmVarDecl::getFunctionScopeDepth
unsigned getFunctionScopeDepth() const
Definition: Decl.h:1730
clang::RecordDecl::isAnonymousStructOrUnion
bool isAnonymousStructOrUnion() const
Whether this is an anonymous struct or union.
Definition: Decl.h:3981
clang::ClassTemplateSpecializationDecl::getSpecializedTemplateOrPartial
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this.
Definition: DeclTemplate.h:1984
clang::Decl::isImplicit
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:565
clang::TemplateParamObjectDecl
A template parameter object.
Definition: DeclTemplate.h:3305
clang::ASTContext::getInstantiatedFromUsingDecl
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of another (possibly unresolved) using decl,...
Definition: ASTContext.cpp:1559
clang::ObjCImplementationDecl::getSuperClass
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2683
clang::Decl::getOwningModule
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:797
clang::FieldDecl::isMutable
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:2937
clang::MemberSpecializationInfo::getPointOfInstantiation
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
Definition: DeclTemplate.h:660
clang::StaticAssertDecl::isFailed
bool isFailed() const
Definition: DeclCXX.h:3972
clang::RecordDecl::isNonTrivialToPrimitiveCopy
bool isNonTrivialToPrimitiveCopy() const
Definition: Decl.h:4015
clang::FieldDecl::getCapturedVLAType
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
Definition: Decl.h:3040
clang::serialization::DECL_OBJC_IMPLEMENTATION
@ DECL_OBJC_IMPLEMENTATION
A ObjCImplementationDecl record.
Definition: ASTBitCodes.h:1277
clang::TemplateDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:419
clang::UsingDecl
Represents a C++ using-declaration.
Definition: DeclCXX.h:3412
clang::GVA_Internal
@ GVA_Internal
Definition: Linkage.h:74
clang::NamedDecl::getMostRecentDecl
NamedDecl * getMostRecentDecl()
Definition: Decl.h:471
clang::ObjCCategoryDecl
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2276
clang::serialization::DECL_FRIEND
@ DECL_FRIEND
A FriendDecl record.
Definition: ASTBitCodes.h:1404
clang::VarDecl::getDescribedVarTemplate
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
Definition: Decl.cpp:2683
clang::ClassTemplateSpecializationDecl::getTypeAsWritten
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
Definition: DeclTemplate.h:2042
clang::serialization::DECL_OBJC_PROTOCOL
@ DECL_OBJC_PROTOCOL
A ObjCProtocolDecl record.
Definition: ASTBitCodes.h:1262
clang::VarTemplateSpecializationDecl::getPointOfInstantiation
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
Definition: DeclTemplate.h:2810
clang::CXXDeductionGuideDecl::getExplicitSpecifier
ExplicitSpecifier getExplicitSpecifier()
Definition: DeclCXX.h:1916
clang::serialization::DECL_BLOCK
@ DECL_BLOCK
A BlockDecl record.
Definition: ASTBitCodes.h:1319
clang::serialization::DECL_OMP_DECLARE_REDUCTION
@ DECL_OMP_DECLARE_REDUCTION
An OMPDeclareReductionDecl record.
Definition: ASTBitCodes.h:1509
clang::ExplicitSpecifier::getExpr
const Expr * getExpr() const
Definition: DeclCXX.h:1837
clang::VarDecl::isThisDeclarationADemotedDefinition
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
Definition: Decl.h:1384
clang::VarTemplateDecl::getCanonicalDecl
VarTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
Definition: DeclTemplate.h:3172
clang::TemplateTypeParmDecl::wasDeclaredWithTypename
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
Definition: DeclTemplate.h:1258
clang::RedeclarableTemplateDecl::SpecEntryTraits::getDecl
static DeclType * getDecl(EntryType *D)
Definition: DeclTemplate.h:775
clang::ParmVarDecl::getUninstantiatedDefaultArg
Expr * getUninstantiatedDefaultArg()
Definition: Decl.cpp:2907
clang::UnresolvedUsingValueDecl::getEllipsisLoc
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Definition: DeclCXX.h:3805
clang::ASTDeclWriter::VisitObjCPropertyImplDecl
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
Definition: ASTWriterDecl.cpp:904
clang::ASTDeclWriter::VisitObjCAtDefsFieldDecl
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
Definition: ASTWriterDecl.cpp:830
clang::FriendTemplateDecl::getFriendType
TypeSourceInfo * getFriendType() const
If this friend declaration names a templated type (or a dependent member type of a templated type),...
Definition: DeclTemplate.h:2501
clang::ObjCMethodDecl::getObjCDeclQualifier
ObjCDeclQualifier getObjCDeclQualifier() const
Definition: DeclObjC.h:249
clang::StaticAssertDecl::getAssertExpr
Expr * getAssertExpr()
Definition: DeclCXX.h:3966
clang::NamespaceAliasDecl::getNamespace
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
Definition: DeclCXX.h:3092
clang::serialization::DeclCode
DeclCode
Record codes for each kind of declaration.
Definition: ASTBitCodes.h:1236
clang::ASTDeclWriter::ASTDeclWriter
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, ASTWriter::RecordDataImpl &Record)
Definition: ASTWriterDecl.cpp:43
clang::UsingEnumDecl
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3612
clang::UsingPackDecl::getInstantiatedFromUsingDecl
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
Definition: DeclCXX.h:3709
clang::TemplateTemplateParmDecl::defaultArgumentWasInherited
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
Definition: DeclTemplate.h:1749
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
clang::serialization::UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION
@ UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION
Definition: ASTCommon.h:26
clang::LinkageSpecDecl::getLanguage
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2859
clang::serialization::DECL_EXPORT
@ DECL_EXPORT
An ExportDecl record.
Definition: ASTBitCodes.h:1380
clang::DeclContext::getRedeclContext
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
Definition: DeclBase.cpp:1797
clang::ObjCCategoryImplDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2523
clang::ASTDeclWriter::VisitOMPAllocateDecl
void VisitOMPAllocateDecl(OMPAllocateDecl *D)
Definition: ASTWriterDecl.cpp:1870
clang::declvisitor::Base< std::add_pointer, ImplClass, void >::Visit
void Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::ObjCContainerDecl::getAtStartLoc
SourceLocation getAtStartLoc() const
Definition: DeclObjC.h:1093
clang::TypedefNameDecl::getAnonDeclWithTypedefName
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes,...
Definition: Decl.cpp:5077
clang::ClassTemplatePartialSpecializationDecl::getTemplateArgsAsWritten
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
Definition: DeclTemplate.h:2168
clang::ASTDeclWriter::VisitObjCInterfaceDecl
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
Definition: ASTWriterDecl.cpp:749
clang::serialization::DECL_OBJC_METHOD
@ DECL_OBJC_METHOD
A ObjCMethodDecl record.
Definition: ASTBitCodes.h:1256
clang::FunctionDecl::usesSEHTry
bool usesSEHTry() const
Indicates the function uses __try.
Definition: Decl.h:2339
clang::ASTDeclWriter::VisitEmptyDecl
void VisitEmptyDecl(EmptyDecl *D)
Definition: ASTWriterDecl.cpp:1165
clang::ASTDeclWriter::VisitTemplateParamObjectDecl
void VisitTemplateParamObjectDecl(TemplateParamObjectDecl *D)
Definition: ASTWriterDecl.cpp:977
clang::Decl::getPreviousDecl
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
Definition: DeclBase.h:1013
clang::ObjCPropertyImplDecl::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: DeclObjC.h:2814
clang::FunctionTemplateSpecializationInfo
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Definition: DeclTemplate.h:468
clang::NonTypeTemplateParmDecl::getExpansionTypeSourceInfo
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
Definition: DeclTemplate.h:1570
clang::EnumDecl::isScoped
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3835
clang::ASTDeclWriter::VisitImplicitParamDecl
void VisitImplicitParamDecl(ImplicitParamDecl *D)
Definition: ASTWriterDecl.cpp:1090
clang::ObjCCategoryDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:2366
clang::Decl::hasAttrs
bool hasAttrs() const
Definition: DeclBase.h:491
clang::TagDecl::getBraceRange
SourceRange getBraceRange() const
Definition: Decl.h:3436
clang::CXXMethodDecl::size_overridden_methods
unsigned size_overridden_methods() const
Definition: DeclCXX.cpp:2442
clang::ASTRecordWriter::append
void append(InputIterator begin, InputIterator end)
Definition: ASTRecordWriter.h:81
clang::Decl::isFromASTFile
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:740
clang::NonTypeTemplateParmDecl::getDefaultArgument
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1483
clang::TemplateTypeParmDecl::getTypeConstraint
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
Definition: DeclTemplate.h:1363
clang::ASTDeclWriter::VisitBlockDecl
void VisitBlockDecl(BlockDecl *D)
Definition: ASTWriterDecl.cpp:1181
clang::ASTDeclWriter::VisitDecompositionDecl
void VisitDecompositionDecl(DecompositionDecl *D)
Definition: ASTWriterDecl.cpp:1142
clang::ASTDeclWriter::VisitTypedefNameDecl
void VisitTypedefNameDecl(TypedefNameDecl *D)
Definition: ASTWriterDecl.cpp:378
clang::StaticAssertDecl
Represents a C++11 static_assert declaration.
Definition: DeclCXX.h:3943
clang::TagDecl::isFreeStanding
bool isFreeStanding() const
True if this tag is free standing, e.g. "struct foo;".
Definition: Decl.h:3495
clang::serialization::DECL_OMP_ALLOCATE
@ DECL_OMP_ALLOCATE
An OMPAllocateDcl record.
Definition: ASTBitCodes.h:1482
clang::ASTTemplateArgumentListInfo::LAngleLoc
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
Definition: TemplateBase.h:626
clang::ClassTemplateDecl
Declaration of a class template.
Definition: DeclTemplate.h:2264
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:674
clang::serialization::DECL_VAR
@ DECL_VAR
A VarDecl record.
Definition: ASTBitCodes.h:1301
clang::DependentFunctionTemplateSpecializationInfo::getRAngleLoc
SourceLocation getRAngleLoc() const
Definition: DeclTemplate.h:747
clang::VarDecl::getStorageClass
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1083
clang::ASTDeclWriter::VisitClassTemplateSpecializationDecl
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
Definition: ASTWriterDecl.cpp:1543
clang::serialization::DECL_ACCESS_SPEC
@ DECL_ACCESS_SPEC
An AccessSpecDecl record.
Definition: ASTBitCodes.h:1401
clang::serialization::DECL_UNRESOLVED_USING_VALUE
@ DECL_UNRESOLVED_USING_VALUE
An UnresolvedUsingValueDecl record.
Definition: ASTBitCodes.h:1371
clang::OMPCapturedExprDecl
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:383
clang::ASTDeclWriter::VisitLabelDecl
void VisitLabelDecl(LabelDecl *LD)
Definition: ASTWriterDecl.cpp:1235
clang::ObjCImplDecl
Definition: DeclObjC.h:2421
clang::FunctionDecl::isMultiVersion
bool isMultiVersion() const
True if this function is considered a multiversioned function.
Definition: Decl.h:2458
clang::OMPDeclareReductionDecl::getInitOrig
Expr * getInitOrig()
Get Orig variable of the initializer.
Definition: DeclOpenMP.h:246
clang::ObjCPropertyDecl::getLParenLoc
SourceLocation getLParenLoc() const
Definition: DeclObjC.h:795
clang::LifetimeExtendedTemporaryDecl::getValue
APValue * getValue() const
Definition: DeclCXX.h:3184
clang::serialization::DECL_TEMPLATE_PARAM_OBJECT
@ DECL_TEMPLATE_PARAM_OBJECT
A TemplateParamObjectDecl record.
Definition: ASTBitCodes.h:1298
clang::serialization::LOCAL_REDECLARATIONS
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
Definition: ASTBitCodes.h:1228
clang::DeclContext::getParent
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1902
clang::ObjCCategoryDecl::protocols
protocol_range protocols() const
Definition: DeclObjC.h:2352
clang::ObjCCompatibleAliasDecl::getClassInterface
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2741
clang::serialization::DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK
@ DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack.
Definition: ASTBitCodes.h:1462
clang::ObjCInterfaceDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:1373
clang::ParmVarDecl::isObjCMethodParameter
bool isObjCMethodParameter() const
Definition: Decl.h:1723
clang::TemplateDecl
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:400
clang::NonTypeTemplateParmDecl::isExpandedParameterPack
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
Definition: DeclTemplate.h:1550
clang::VarTemplatePartialSpecializationDecl
Definition: DeclTemplate.h:2943
clang::ObjCMethodDecl::isSynthesizedAccessorStub
bool isSynthesizedAccessorStub() const
Definition: DeclObjC.h:449
llvm::ArrayRef
Definition: LLVM.h:34
DeclVisitor.h
Value
Value
Definition: UninitializedValues.cpp:102
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::MSGuidDeclParts::Part2
uint16_t Part2
...-89ab-...
Definition: DeclCXX.h:4153
clang::PrettyDeclStackTraceEntry
PrettyDeclStackTraceEntry - If a crash occurs in the parser while parsing something related to a decl...
Definition: PrettyDeclStackTrace.h:29
clang::ASTDeclWriter::VisitNamespaceAliasDecl
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
Definition: ASTWriterDecl.cpp:1268
clang::ObjCPropertyDecl::getPropertyIvarDecl
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:920
clang::ParmVarDecl::getFunctionScopeIndex
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
Definition: Decl.h:1740
OpenMPClause.h
clang::DeclaratorDecl
Represents a ValueDecl that came out of a declarator.
Definition: Decl.h:726
clang::FunctionDecl::isPure
bool isPure() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2206
clang::NamespaceAliasDecl::getTargetNameLoc
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
Definition: DeclCXX.h:3111
clang::ObjCPropertyDecl
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:732
clang::UsingDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Definition: DeclCXX.h:3446
clang::ASTDeclWriter::VisitAccessSpecDecl
void VisitAccessSpecDecl(AccessSpecDecl *D)
Definition: ASTWriterDecl.cpp:1463
clang::CXXConstructorDecl::getInheritedConstructor
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
Definition: DeclCXX.h:2674
clang::ObjCMethodDecl::isInstanceMethod
bool isInstanceMethod() const
Definition: DeclObjC.h:431
clang::ASTDeclWriter::VisitClassTemplateDecl
void VisitClassTemplateDecl(ClassTemplateDecl *D)
Definition: ASTWriterDecl.cpp:1535
clang::FunctionDecl::isTrivialForCall
bool isTrivialForCall() const
Definition: Decl.h:2226
clang::ClassScopeFunctionSpecializationDecl::getSpecialization
CXXMethodDecl * getSpecialization() const
Definition: DeclTemplate.h:2640
clang::ASTDeclWriter::VisitCXXMethodDecl
void VisitCXXMethodDecl(CXXMethodDecl *D)
Definition: ASTWriterDecl.cpp:1392
clang::CapturedDecl::isNothrow
bool isNothrow() const
Definition: Decl.cpp:5017
clang::FunctionDecl::TK_NonTemplate
@ TK_NonTemplate
Definition: Decl.h:1881
clang::SD_Static
@ SD_Static
Static storage duration.
Definition: Specifiers.h:312
clang::NamedDecl::getLinkageInternal
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
Definition: Decl.cpp:1147
clang::UnresolvedUsingValueDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Definition: DeclCXX.h:3788
clang::ObjCTypeParamList::size
unsigned size() const
Determine the number of type parameters in this list.
Definition: DeclObjC.h:688
clang::NonTypeTemplateParmDecl::getDepth
unsigned getDepth() const
Get the nesting depth of the template parameter.
Definition: DeclTemplate.h:1171
clang::NamespaceAliasDecl::getQualifierLoc
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Definition: DeclCXX.h:3083
clang::CXXRecordDecl::getPreviousDecl
CXXRecordDecl * getPreviousDecl()
Definition: DeclCXX.h:509
clang::ObjCPropertyDecl::getGetterNameLoc
SourceLocation getGetterNameLoc() const
Definition: DeclObjC.h:882
clang::ASTDeclWriter::VisitStaticAssertDecl
void VisitStaticAssertDecl(StaticAssertDecl *D)
Definition: ASTWriterDecl.cpp:1773
clang::ClassTemplateDecl::getCanonicalDecl
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
Definition: DeclTemplate.h:2341
clang::DependentFunctionTemplateSpecializationInfo::getTemplate
FunctionTemplateDecl * getTemplate(unsigned I) const
Returns the i'th template candidate.
Definition: DeclTemplate.h:720
clang::ObjCCategoryDecl::getIvarLBraceLoc
SourceLocation getIvarLBraceLoc() const
Definition: DeclObjC.h:2413
clang::serialization::DECL_ENUM_CONSTANT
@ DECL_ENUM_CONSTANT
An EnumConstantDecl record.
Definition: ASTBitCodes.h:1250
clang::PragmaCommentDecl
Represents a #pragma comment line.
Definition: Decl.h:138
clang::CXXConversionDecl::getExplicitSpecifier
ExplicitSpecifier getExplicitSpecifier()
Definition: DeclCXX.h:2791
clang::ASTDeclWriter::RegisterTemplateSpecialization
void RegisterTemplateSpecialization(const Decl *Template, const Decl *Specialization)
Ensure that this template specialization is associated with the specified template on reload.
Definition: ASTWriterDecl.cpp:250
clang::serialization::DECL_MS_PROPERTY
@ DECL_MS_PROPERTY
A MSPropertyDecl record.
Definition: ASTBitCodes.h:1292
clang::CapturedDecl::getContextParamPosition
unsigned getContextParamPosition() const
Definition: Decl.h:4471
clang::UsingDirectiveDecl::getCommonAncestor
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
Definition: DeclCXX.h:2982
clang::serialization::DECL_OBJC_CATEGORY_IMPL
@ DECL_OBJC_CATEGORY_IMPL
A ObjCCategoryImplDecl record.
Definition: ASTBitCodes.h:1274
clang::ASTDeclWriter::VisitObjCCompatibleAliasDecl
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
Definition: ASTWriterDecl.cpp:850
clang::serialization::DECL_CONCEPT
@ DECL_CONCEPT
A ConceptDecl record.
Definition: ASTBitCodes.h:1443
clang::RecordDecl::hasObjectMember
bool hasObjectMember() const
Definition: Decl.h:3989
clang::ASTRecordWriter
An object for streaming information to a record.
Definition: ASTRecordWriter.h:27
clang::ObjCImplementationDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2692
clang::Redeclarable::getMostRecentDecl
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
Definition: Redeclarable.h:226
clang::ObjCImplementationDecl::hasNonZeroConstructors
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
Definition: DeclObjC.h:2650
clang::ObjCAtDefsFieldDecl
Represents a field declaration created by an @defs(...).
Definition: DeclObjC.h:2000
clang::VarDecl::getInit
const Expr * getInit() const
Definition: Decl.h:1283
clang::VarTemplateSpecializationDecl::getExternLoc
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
Definition: DeclTemplate.h:2900
clang::ASTDeclWriter::VisitOMPRequiresDecl
void VisitOMPRequiresDecl(OMPRequiresDecl *D)
Definition: ASTWriterDecl.cpp:1876
clang::RecordDecl::hasNonTrivialToPrimitiveDefaultInitializeCUnion
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
Definition: Decl.h:4031
clang::ASTDeclWriter::VisitObjCPropertyDecl
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
Definition: ASTWriterDecl.cpp:856
clang::serialization::DECL_TYPEDEF
@ DECL_TYPEDEF
A TypedefDecl record.
Definition: ASTBitCodes.h:1238
clang::TypedefDecl
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3309
clang::LinkageSpecDecl::getRBraceLoc
SourceLocation getRBraceLoc() const
Definition: DeclCXX.h:2874
clang::serialization::isRedeclarableDeclKind
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
Definition: ASTCommon.cpp:347
ASTRecordWriter.h
clang::ASTDeclWriter::VisitParmVarDecl
void VisitParmVarDecl(ParmVarDecl *D)
Definition: ASTWriterDecl.cpp:1095
clang::OMPDeclareReductionDecl::getCombiner
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:221
clang::ObjCPropertyImplDecl::getPropertyDecl
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2817
clang::MemberSpecializationInfo::getInstantiatedFrom
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
Definition: DeclTemplate.h:639
clang::VarDecl::isPreviousDeclInSameBlockScope
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
Definition: Decl.h:1500
clang::VarTemplateSpecializationDecl::getSpecializedTemplateOrPartial
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
Definition: DeclTemplate.h:2837
clang::VarDecl::getTSCSpec
ThreadStorageClassSpecifier getTSCSpec() const
Definition: Decl.h:1092
clang::ObjCPropertyDecl::getPropertyAttributesAsWritten
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
Definition: DeclObjC.h:823
clang::ObjCPropertyAttribute::Kind
Kind
Definition: DeclObjCCommon.h:22
clang::LifetimeExtendedTemporaryDecl::getTemporaryExpr
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
Definition: DeclCXX.h:3175
clang::LinkageSpecDecl::getExternLoc
SourceLocation getExternLoc() const
Definition: DeclCXX.h:2873
clang::ObjCTypeParamDecl
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:582
clang::ObjCPropertyDecl::getGetterName
Selector getGetterName() const
Definition: DeclObjC.h:881
clang::ObjCPropertyDecl::getSetterNameLoc
SourceLocation getSetterNameLoc() const
Definition: DeclObjC.h:890
clang::VarDecl::isARCPseudoStrong
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
Definition: Decl.h:1455
clang::ObjCMethodDecl::getBody
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
Definition: DeclObjC.cpp:874
clang::ASTDeclWriter::VisitObjCProtocolDecl
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
Definition: ASTWriterDecl.cpp:814
clang::VarDecl::isCXXForRangeDecl
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement.
Definition: Decl.h:1430
clang::ASTRecordWriter::AddDeclRef
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
Definition: ASTRecordWriter.h:226
clang::NamespaceDecl::isAnonymousNamespace
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
Definition: Decl.h:596
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::ASTDeclWriter::VisitConceptDecl
void VisitConceptDecl(ConceptDecl *D)
Definition: ASTWriterDecl.cpp:1509
clang::serialization::DECL_FUNCTION
@ DECL_FUNCTION
A FunctionDecl record.
Definition: ASTBitCodes.h:1253
clang::CXXDeductionGuideDecl
Represents a C++ deduction guide declaration.
Definition: DeclCXX.h:1883
clang::serialization::DECL_INDIRECTFIELD
@ DECL_INDIRECTFIELD
A IndirectFieldDecl record.
Definition: ASTBitCodes.h:1458
clang::OMPDeclareReductionDecl::getInitializerKind
InitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:242
clang::FileScopeAsmDecl
Definition: Decl.h:4173
clang::ObjCInterfaceDecl::getEndOfDefinitionLoc
SourceLocation getEndOfDefinitionLoc() const
Definition: DeclObjC.h:1856
clang::FunctionDecl::isLateTemplateParsed
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
Definition: Decl.h:2210
clang::ObjCMethodDecl::getCmdDecl
ImplicitParamDecl * getCmdDecl() const
Definition: DeclObjC.h:425
clang::VarDecl::CInit
@ CInit
C-style initialization with assignment.
Definition: Decl.h:879
clang::UnresolvedUsingValueDecl::getUsingLoc
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
Definition: DeclCXX.h:3778
clang::DeclarationName::getNameKind
NameKind getNameKind() const
Determine what kind of name this is.
Definition: DeclarationName.h:393
clang::ASTDeclWriter::VisitUnnamedGlobalConstantDecl
void VisitUnnamedGlobalConstantDecl(UnnamedGlobalConstantDecl *D)
Definition: ASTWriterDecl.cpp:970
clang::ASTDeclWriter::VisitOMPDeclareMapperDecl
void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D)
Definition: ASTWriterDecl.cpp:1896
clang::Builtin::ID
ID
Definition: Builtins.h:52
clang::ObjCTypeParamList
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Definition: DeclObjC.h:660
clang::TemplateTemplateParmDecl::getDefaultArgument
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
Definition: DeclTemplate.h:1739
clang
Definition: CalledOnceCheck.h:17
clang::IndirectFieldDecl
Represents a field injected from an anonymous union/struct into the parent scope.
Definition: Decl.h:3116
clang::TemplateTypeParmDecl::getNumExpansionParameters
unsigned getNumExpansionParameters() const
Retrieves the number of parameters in an expanded parameter pack.
Definition: DeclTemplate.h:1356
clang::GVA_StrongExternal
@ GVA_StrongExternal
Definition: Linkage.h:77
clang::ASTRecordWriter::Emit
uint64_t Emit(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, followed by its substatements, and return its offset.
Definition: ASTRecordWriter.h:92
clang::UnnamedGlobalConstantDecl::getValue
const APValue & getValue() const
Definition: DeclCXX.h:4255
clang::ObjCPropertyDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: DeclObjC.h:798
clang::MSGuidDeclParts::Part4And5
uint8_t Part4And5[8]
...-0123-456789abcdef}
Definition: DeclCXX.h:4157
clang::serialization::DECL_TEMPLATE_TYPE_PARM
@ DECL_TEMPLATE_TYPE_PARM
A TemplateTypeParmDecl record.
Definition: ASTBitCodes.h:1431
clang::FileScopeAsmDecl::getAsmString
const StringLiteral * getAsmString() const
Definition: Decl.h:4197
clang::ASTDeclWriter::getPartialSpecializations
ArrayRef< Decl > getPartialSpecializations(FunctionTemplateDecl::Common *)
Definition: ASTWriterDecl.cpp:205
clang::TypeAliasDecl::getDescribedAliasTemplate
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
Definition: Decl.h:3346
clang::GVA_AvailableExternally
@ GVA_AvailableExternally
Definition: Linkage.h:75
clang::ObjCInterfaceDecl::getSuperClassTInfo
TypeSourceInfo * getSuperClassTInfo() const
Definition: DeclObjC.h:1551
clang::NonTypeTemplateParmDecl::isParameterPack
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
Definition: DeclTemplate.h:1515
clang::EnumDecl::getNumNegativeBits
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
Definition: Decl.h:3832
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1923
clang::ParmVarDecl::isKNRPromoted
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion:
Definition: Decl.h:1761
clang::VarDecl::isConstexpr
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1477
ASTReader.h
clang::ObjCCategoryDecl::getIvarRBraceLoc
SourceLocation getIvarRBraceLoc() const
Definition: DeclObjC.h:2415
clang::MSPropertyDecl
An instance of this class represents the declaration of a property member.
Definition: DeclCXX.h:4120
clang::UsingDecl::hasTypename
bool hasTypename() const
Return true if the using declaration has 'typename'.
Definition: DeclCXX.h:3461
clang::ParmVarDecl::hasUninstantiatedDefaultArg
bool hasUninstantiatedDefaultArg() const
Definition: Decl.h:1801
clang::DeclVisitor
A simple visitor class that helps create declaration visitors.
Definition: DeclVisitor.h:66
clang::ASTDeclWriter::VisitRecordDecl
void VisitRecordDecl(RecordDecl *D)
Definition: ASTWriterDecl.cpp:477
clang::serialization::DECL_LIFETIME_EXTENDED_TEMPORARY
@ DECL_LIFETIME_EXTENDED_TEMPORARY
An LifetimeExtendedTemporaryDecl record.
Definition: ASTBitCodes.h:1488
clang::ASTDeclWriter::VisitTemplateTemplateParmDecl
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
Definition: ASTWriterDecl.cpp:1739
clang::TemplateTemplateParmDecl::isExpandedParameterPack
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
Definition: DeclTemplate.h:1716
clang::EnumDecl::getIntegerType
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3795
clang::ASTDeclWriter::VisitUsingDirectiveDecl
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
Definition: ASTWriterDecl.cpp:1327
clang::TagDecl::isCompleteDefinitionRequired
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
Definition: Decl.h:3469
clang::RecordDecl::isNonTrivialToPrimitiveDefaultInitialize
bool isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C structs.
Definition: Decl.h:4007
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2052
clang::CXXMethodDecl::getMostRecentDecl
CXXMethodDecl * getMostRecentDecl()
Definition: DeclCXX.h:2073
clang::RecordDecl::getMostRecentDecl
RecordDecl * getMostRecentDecl()
Definition: Decl.h:3955
clang::serialization::DECL_CXX_CONSTRUCTOR
@ DECL_CXX_CONSTRUCTOR
A CXXConstructorDecl record.
Definition: ASTBitCodes.h:1392
clang::SourceLocation::isValid
bool isValid() const
Return true if this is a valid SourceLocation object.
Definition: SourceLocation.h:110
clang::MSGuidDeclParts::Part3
uint16_t Part3
...-cdef-...
Definition: DeclCXX.h:4155
clang::NamedDecl::getDeclName
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:311
clang::UsingDirectiveDecl::getUsingLoc
SourceLocation getUsingLoc() const
Return the location of the using keyword.
Definition: DeclCXX.h:2986
clang::ClassTemplatePartialSpecializationDecl::isMemberSpecialization
bool isMemberSpecialization()
Determines whether this class template partial specialization template was a specialization of a memb...
Definition: DeclTemplate.h:2224
clang::OMPRequiresDecl
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:416
clang::RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or nullptr if this template w...
Definition: DeclTemplate.h:937
clang::PragmaDetectMismatchDecl::getName
StringRef getName() const
Definition: Decl.h:195
clang::ObjCProtocolDecl::protocol_locs
protocol_loc_range protocol_locs() const
Definition: DeclObjC.h:2138
clang::DeclContext::isDependentContext
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
Definition: DeclBase.cpp:1152
clang::ASTDeclWriter::VisitPragmaDetectMismatchDecl
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
Definition: ASTWriterDecl.cpp:348
clang::ASTDeclWriter::VisitCXXDestructorDecl
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
Definition: ASTWriterDecl.cpp:1429
clang::serialization::DECL_OMP_CAPTUREDEXPR
@ DECL_OMP_CAPTUREDEXPR
An OMPCapturedExprDecl record.
Definition: ASTBitCodes.h:1497
clang::NonTypeTemplateParmDecl::getPlaceholderTypeConstraint
Expr * getPlaceholderTypeConstraint() const
Return the constraint introduced by the placeholder type of this non-type template parameter (if any)...
Definition: DeclTemplate.h:1579
clang::ClassTemplateSpecializationDecl::getTemplateKeywordLoc
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
Definition: DeclTemplate.h:2066
clang::ASTDeclWriter::VisitUnresolvedUsingIfExistsDecl
void VisitUnresolvedUsingIfExistsDecl(UnresolvedUsingIfExistsDecl *D)
Definition: ASTWriterDecl.cpp:1355
clang::FunctionDecl::hasInheritedPrototype
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
Definition: Decl.h:2295
clang::FunctionDecl::isExplicitlyDefaulted
bool isExplicitlyDefaulted() const
Whether this function is explicitly defaulted.
Definition: Decl.h:2235
clang::UnresolvedUsingIfExistsDecl
This node is generated when a using-declaration that was annotated with attribute((using_if_exists)) ...
Definition: DeclCXX.h:3925
clang::BlockDecl::canAvoidCopyToHeap
bool canAvoidCopyToHeap() const
Definition: Decl.h:4362
clang::LifetimeExtendedTemporaryDecl::getExtendingDecl
ValueDecl * getExtendingDecl()
Definition: DeclCXX.h:3164
clang::ASTDeclWriter::VisitOMPCapturedExprDecl
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
Definition: ASTWriterDecl.cpp:1904
clang::TagDecl::getTagKind
TagKind getTagKind() const
Definition: Decl.h:3552
clang::ASTDeclWriter::VisitNonTypeTemplateParmDecl
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
Definition: ASTWriterDecl.cpp:1704
clang::TypedefNameDecl
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:3207
clang::RedeclarableTemplateDecl::SpecEntryTraits::DeclType
EntryType DeclType
Definition: DeclTemplate.h:773
clang::Decl::getAttrs
AttrVec & getAttrs()
Definition: DeclBase.h:497
clang::VarTemplateSpecializationDecl::getSpecializedTemplate
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
Definition: DeclTemplate.cpp:1329
clang::ASTDeclWriter::VisitTemplateDecl
void VisitTemplateDecl(TemplateDecl *D)
Definition: ASTWriterDecl.cpp:1502
clang::ExplicitSpecifier::getKind
ExplicitSpecKind getKind() const
Definition: DeclCXX.h:1836
clang::ObjCContainerDecl
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:944
clang::FunctionTemplateSpecializationInfo::TemplateArgumentsAsWritten
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Definition: DeclTemplate.h:489
clang::ObjCCategoryDecl::getCategoryNameLoc
SourceLocation getCategoryNameLoc() const
Definition: DeclObjC.h:2409
clang::TypeAliasTemplateDecl
Declaration of an alias template.
Definition: DeclTemplate.h:2537
clang::ASTDeclWriter::VisitObjCTypeParamDecl
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
Definition: ASTWriterDecl.cpp:732
clang::FunctionDecl::getDependentSpecializationInfo
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
Definition: Decl.cpp:3949
clang::BlockDecl::getSignatureAsWritten
TypeSourceInfo * getSignatureAsWritten() const
Definition: Decl.h:4291
clang::ASTDeclWriter::VisitTypedefDecl
void VisitTypedefDecl(TypedefDecl *D)
Definition: ASTWriterDecl.cpp:388
clang::ObjCMethodDecl::isPropertyAccessor
bool isPropertyAccessor() const
Definition: DeclObjC.h:441
clang::serialization::DECL_NAMESPACE_ALIAS
@ DECL_NAMESPACE_ALIAS
A NamespaceAliasDecl record.
Definition: ASTBitCodes.h:1350
clang::ConceptReference::getNestedNameSpecifierLoc
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
Definition: ASTConcept.h:136
clang::LifetimeExtendedTemporaryDecl
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition: DeclCXX.h:3127
clang::ObjCIvarDecl::classofKind
static bool classofKind(Kind K)
Definition: DeclObjC.h:1987
clang::BindingDecl::getBinding
Expr * getBinding() const
Get the expression to which this declaration is bound.
Definition: DeclCXX.h:4016
clang::ObjCMethodDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:376
clang::interp::DeclTy
unsigned llvm::PointerUnion< const Decl *, const Expr * > DeclTy
Definition: Descriptor.h:26
clang::FunctionTemplateSpecializationInfo::getTemplateSpecializationKind
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
Definition: DeclTemplate.h:530
Parent
NodeId Parent
Definition: ASTDiff.cpp:192
clang::ASTDeclWriter::Emit
uint64_t Emit(Decl *D)
Definition: ASTWriterDecl.cpp:48
clang::serialization::DECL_IMPORT
@ DECL_IMPORT
An ImportDecl recording a module import.
Definition: ASTBitCodes.h:1473
clang::ObjCMethodDecl::isRedeclaration
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
Definition: DeclObjC.h:269
clang::ConceptReference::getConceptNameInfo
const DeclarationNameInfo & getConceptNameInfo() const
Definition: ASTConcept.h:140
clang::ObjCPropertyDecl::getAtLoc
SourceLocation getAtLoc() const
Definition: DeclObjC.h:792
clang::ASTReader::getOwningModuleFile
ModuleFile * getOwningModuleFile(const Decl *D)
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a mo...
Definition: ASTReader.cpp:7363
clang::ASTDeclWriter::VisitLinkageSpecDecl
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
Definition: ASTWriterDecl.cpp:1221
clang::PragmaDetectMismatchDecl
Represents a #pragma detect_mismatch line.
Definition: Decl.h:172
clang::serialization::DECL_LABEL
@ DECL_LABEL
A LabelDecl record.
Definition: ASTBitCodes.h:1344
clang::UsingEnumDecl::getEnumLoc
SourceLocation getEnumLoc() const
The source location of the 'enum' keyword.
Definition: DeclCXX.h:3638
clang::DependentFunctionTemplateSpecializationInfo::getLAngleLoc
SourceLocation getLAngleLoc() const
Definition: DeclTemplate.h:743
llvm::SmallVectorImpl
Definition: Randstruct.h:18
clang::VarDecl::getInitStyle
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1374
clang::TypeAliasDecl
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3329
clang::NonTypeTemplateParmDecl::getPosition
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
Definition: DeclTemplate.h:1179
clang::ValueDecl::getType
QualType getType() const
Definition: Decl.h:685
clang::MemberSpecializationInfo::getTemplateSpecializationKind
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
Definition: DeclTemplate.h:642
clang::ASTDeclWriter::VisitBindingDecl
void VisitBindingDecl(BindingDecl *D)
Definition: ASTWriterDecl.cpp:1152
clang::VarTemplateDecl
Declaration of a variable template.
Definition: DeclTemplate.h:3097
clang::serialization::DECL_PRAGMA_DETECT_MISMATCH
@ DECL_PRAGMA_DETECT_MISMATCH
A PragmaDetectMismatchDecl record.
Definition: ASTBitCodes.h:1503
clang::ImportDecl::getImportedModule
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4571
clang::RedeclarableTemplateDecl::isMemberSpecialization
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
Definition: DeclTemplate.h:890
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::IndirectFieldDecl::chain
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:3138
clang::PragmaDetectMismatchDecl::getValue
StringRef getValue() const
Definition: Decl.h:196
clang::FunctionDecl::getDescribedFunctionTemplate
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
Definition: Decl.cpp:3776
SM
#define SM(sm)
Definition: Cuda.cpp:81
clang::ASTDeclWriter::VisitVarTemplateDecl
void VisitVarTemplateDecl(VarTemplateDecl *D)
Definition: ASTWriterDecl.cpp:1595
clang::ConstructorUsingShadowDecl
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3498
clang::ObjCInterfaceDecl::getTypeForDecl
const Type * getTypeForDecl() const
Definition: DeclObjC.h:1897
clang::serialization::DeclID
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
Definition: ASTBitCodes.h:68
clang::ASTContext::getInstantiatedFromUnnamedFieldDecl
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
Definition: ASTContext.cpp:1613
clang::BlockDecl::param_size
size_t param_size() const
Definition: Decl.h:4310
clang::serialization::UPD_CXX_ADDED_ANONYMOUS_NAMESPACE
@ UPD_CXX_ADDED_ANONYMOUS_NAMESPACE
Definition: ASTCommon.h:27
clang::TemplateParamObjectDecl::getValue
const APValue & getValue() const
Definition: DeclTemplate.h:3341
clang::UsingPackDecl::expansions
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
Definition: DeclCXX.h:3713
clang::FriendTemplateDecl::getNumTemplateParameters
unsigned getNumTemplateParameters() const
Definition: DeclTemplate.h:2522
clang::ObjCContainerDecl::getAtEndRange
SourceRange getAtEndRange() const
Definition: DeclObjC.h:1100
clang::ASTDeclWriter::AddFirstDeclFromEachModule
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D.
Definition: ASTWriterDecl.cpp:180
clang::ClassTemplateSpecializationDecl
Represents a class template specialization, which refers to a class template with a given set of temp...
Definition: DeclTemplate.h:1820
clang::ObjCPropertyDecl::getPropertyAttributes
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:811
clang::ASTDeclWriter
Definition: ASTWriterDecl.cpp:34
clang::serialization::DECL_CONTEXT_VISIBLE
@ DECL_CONTEXT_VISIBLE
A record that stores the set of declarations that are visible from a given DeclContext.
Definition: ASTBitCodes.h:1341
clang::ASTContext::DeclMustBeEmitted
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
Definition: ASTContext.cpp:11489
clang::FunctionDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:2510
clang::TemplateTemplateParmDecl::getDepth
unsigned getDepth() const
Get the nesting depth of the template parameter.
Definition: DeclTemplate.h:1171
clang::VarDecl::isExceptionVariable
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
Definition: Decl.h:1402
clang::Decl::getLocation
SourceLocation getLocation() const
Definition: DeclBase.h:432
clang::serialization::DECL_OBJC_IVAR
@ DECL_OBJC_IVAR
A ObjCIvarDecl record.
Definition: ASTBitCodes.h:1265
clang::FriendDecl::getFriendTypeTemplateParameterList
TemplateParameterList * getFriendTypeTemplateParameterList(unsigned N) const
Definition: DeclFriend.h:131
addExplicitSpecifier
static void addExplicitSpecifier(ExplicitSpecifier ES, ASTRecordWriter &Record)
Definition: ASTWriterDecl.cpp:666
clang::Decl::isCanonicalDecl
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
Definition: DeclBase.h:936
clang::NamespaceDecl
Represent a C++ namespace.
Definition: Decl.h:540
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1872
clang::ASTDeclWriter::VisitObjCContainerDecl
void VisitObjCContainerDecl(ObjCContainerDecl *D)
Definition: ASTWriterDecl.cpp:742
clang::ASTTemplateArgumentListInfo::RAngleLoc
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
Definition: TemplateBase.h:629
clang::BlockDecl::capturesCXXThis
bool capturesCXXThis() const
Definition: Decl.h:4340
clang::RecordDecl
Represents a struct/union/class.
Definition: Decl.h:3908
clang::ASTContext::getInstantiatedFromUsingShadowDecl
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
Definition: ASTContext.cpp:1597
clang::ObjCList
ObjCList - This is a simple template class used to hold various lists of decls etc,...
Definition: DeclObjC.h:83
clang::ASTDeclWriter::VisitUsingDecl
void VisitUsingDecl(UsingDecl *D)
Definition: ASTWriterDecl.cpp:1278
clang::ObjCProtocolDecl::isThisDeclarationADefinition
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
Definition: DeclObjC.h:2217
clang::FunctionDecl::getStorageClass
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2607
clang::serialization::DECL_NON_TYPE_TEMPLATE_PARM
@ DECL_NON_TYPE_TEMPLATE_PARM
A NonTypeTemplateParmDecl record.
Definition: ASTBitCodes.h:1434
clang::NamespaceDecl::isInline
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:601
clang::TypeConstraint
Definition: ASTConcept.h:167
clang::VarTemplateSpecializationDecl::getSpecializationKind
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
Definition: DeclTemplate.h:2784
clang::ASTDeclWriter::VisitUsingShadowDecl
void VisitUsingShadowDecl(UsingShadowDecl *D)
Definition: ASTWriterDecl.cpp:1308
clang::serialization::DECL_BINDING
@ DECL_BINDING
A BindingDecl record.
Definition: ASTBitCodes.h:1313
clang::ObjCCategoryDecl::protocol_size
unsigned protocol_size() const
Definition: DeclObjC.h:2361
clang::UsingDirectiveDecl::getNominatedNamespace
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2860
clang::UnnamedGlobalConstantDecl
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
Definition: DeclCXX.h:4228
clang::DeclaratorDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:755
clang::ParmVarDecl::hasInheritedDefaultArg
bool hasInheritedDefaultArg() const
Definition: Decl.h:1813
clang::ObjCMethodDecl::isVariadic
bool isVariadic() const
Definition: DeclObjC.h:436
clang::NamespaceDecl::getAnonymousNamespace
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
Definition: Decl.h:635
clang::ASTDeclWriter::VisitCXXConstructorDecl
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
Definition: ASTWriterDecl.cpp:1417
clang::BlockDecl::isConversionFromLambda
bool isConversionFromLambda() const
Definition: Decl.h:4351
clang::OMPDeclarativeDirective::Data
OMPChildren * Data
Data, associated with the directive.
Definition: DeclOpenMP.h:43
clang::VarTemplateSpecializationDecl::getTypeAsWritten
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
Definition: DeclTemplate.h:2895
clang::serialization::DECL_CONTEXT_LEXICAL
@ DECL_CONTEXT_LEXICAL
A record that stores the set of declarations that are lexically stored within a given DeclContext.
Definition: ASTBitCodes.h:1332
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::UsingEnumDecl::getEnumDecl
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3642
clang::ObjCMethodDecl::param_size
unsigned param_size() const
Definition: DeclObjC.h:350
clang::Decl::getMostRecentDecl
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
Definition: DeclBase.h:1028
clang::Decl::getDeclKindName
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
clang::FunctionTemplateSpecializationInfo::getMemberSpecializationInfo
MemberSpecializationInfo * getMemberSpecializationInfo() const
Get the specialization info if this function template specialization is also a member specialization:
Definition: DeclTemplate.h:598
clang::TemplateTemplateParmDecl::isParameterPack
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
Definition: DeclTemplate.h:1687
clang::BlockDecl::blockMissingReturnType
bool blockMissingReturnType() const
Definition: Decl.h:4343
clang::BlockDecl::getNumCaptures
unsigned getNumCaptures() const
Returns the number of captured variables.
Definition: Decl.h:4331
clang::CXXMethodDecl
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1981
clang::Decl::getDeclContext
DeclContext * getDeclContext()
Definition: DeclBase.h:441
clang::ObjCMethodDecl::getImplementationControl
ImplementationControl getImplementationControl() const
Definition: DeclObjC.h:505
clang::CXXDestructorDecl::getOperatorDeleteThisArg
Expr * getOperatorDeleteThisArg() const
Definition: DeclCXX.h:2738
clang::FunctionDecl::TK_DependentFunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
Definition: Decl.h:1893