23 #include "llvm/Bitcode/BitstreamWriter.h" 24 #include "llvm/Support/ErrorHandling.h" 25 using namespace clang;
26 using namespace serialization;
44 : Writer(Writer), Context(Context), Record(Writer, Record),
45 Code((serialization::
DeclCode)0), AbbrevToUse(0) {}
49 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
51 return Record.
Emit(Code, AbbrevToUse);
56 void VisitDecl(
Decl *D);
74 void VisitClassTemplateSpecializationDecl(
76 void VisitClassTemplatePartialSpecializationDecl(
79 void VisitVarTemplatePartialSpecializationDecl(
81 void VisitClassScopeFunctionSpecializationDecl(
158 for (
auto typeParam : *typeParams) {
169 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
172 if (R->isFromASTFile())
174 else if (IncludeLocal)
177 for (
const auto &F : Firsts)
182 template <
typename EntryType>
191 return Common->PartialSpecializations;
197 template<
typename DeclTy>
199 auto *Common = D->getCommonPtr();
205 Common->LazySpecializations) {
206 D->LoadLazySpecializations();
207 assert(!Common->LazySpecializations);
211 if (
auto *LS = Common->LazySpecializations)
212 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
215 unsigned I = Record.
size();
221 for (
auto &Entry : Common->Specializations)
222 Specs.push_back(getSpecializationDecl(Entry));
223 for (
auto &Entry : getPartialSpecializations(Common))
224 Specs.push_back(getSpecializationDecl(Entry));
226 for (
auto *D : Specs) {
227 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
228 AddFirstDeclFromEachModule(D,
true);
230 Record.
append(LazySpecializations.begin(), LazySpecializations.end());
233 Record[I] = Record.
size() - I - 1;
239 const Decl *Specialization) {
254 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
267 Record.AddTypeSourceInfo(DD->getTypeSourceInfo());
274 Record.push_back(FD->doesThisDeclarationHaveABody());
275 if (FD->doesThisDeclarationHaveABody())
276 Record.AddFunctionDefinition(FD);
283 VisitDeclContext(DC);
295 Record.AddAttributes(D->
getAttrs());
297 Record.push_back(D->
isUsed(
false));
314 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
315 if (!NS->isFromASTFile())
317 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
318 if (!NS->isInlineNamespace())
326 StringRef Arg = D->
getArg();
327 Record.push_back(Arg.size());
331 Record.AddString(Arg);
339 Record.push_back(Name.size() + 1 + Value.size());
342 Record.AddString(Name);
343 Record.AddString(Value);
348 llvm_unreachable(
"Translation units aren't directly serialized");
355 ? Writer.getAnonymousDeclarationNumber(D)
366 VisitRedeclarable(D);
369 Record.push_back(D->
isModed());
376 VisitTypedefNameDecl(D);
386 AbbrevToUse = Writer.getDeclTypedefAbbrev();
392 VisitTypedefNameDecl(D);
398 VisitRedeclarable(D);
402 if (!isa<CXXRecordDecl>(D))
409 if (D->hasExtInfo()) {
411 Record.AddQualifierInfo(*D->getExtInfo());
414 Record.AddDeclRef(TD);
415 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
431 Record.push_back(D->
isFixed());
433 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
434 Record.push_back(MemberInfo->getTemplateSpecializationKind());
435 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
437 Record.AddDeclRef(
nullptr);
457 AbbrevToUse = Writer.getDeclEnumAbbrev();
484 AbbrevToUse = Writer.getDeclRecordAbbrev();
491 Record.AddTypeRef(D->
getType());
507 Record.push_back(D->hasExtInfo());
509 Record.AddQualifierInfo(*D->getExtInfo());
513 VisitRedeclarable(D);
514 VisitDeclaratorDecl(D);
515 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
521 Record.push_back((
int)D->SClass);
522 Record.push_back(D->IsInline);
523 Record.push_back(D->IsInlineSpecified);
525 Record.push_back(D->IsVirtualAsWritten);
526 Record.push_back(D->IsPure);
527 Record.push_back(D->HasInheritedPrototype);
528 Record.push_back(D->HasWrittenPrototype);
529 Record.push_back(D->IsDeleted);
530 Record.push_back(D->IsTrivial);
531 Record.push_back(D->IsDefaulted);
532 Record.push_back(D->IsExplicitlyDefaulted);
533 Record.push_back(D->HasImplicitReturnZero);
534 Record.push_back(D->IsConstexpr);
535 Record.push_back(D->UsesSEHTry);
536 Record.push_back(D->HasSkippedBody);
537 Record.push_back(D->IsLateTemplateParsed);
539 Record.AddSourceLocation(D->
getLocEnd());
561 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
575 Record.AddTemplateArgumentLoc(
611 Record.AddDeclRef(
P);
616 VisitFunctionDecl(D);
625 bool HasBodyStuff = D->
getBody() !=
nullptr ||
627 Record.push_back(HasBodyStuff);
637 Record.push_back(D->IsOverriding);
638 Record.push_back(D->HasSkippedBody);
640 Record.push_back(D->IsRedeclaration);
641 Record.push_back(D->HasRedeclaration);
642 if (D->HasRedeclaration) {
654 Record.AddSourceLocation(D->
getLocEnd());
657 Record.AddDeclRef(
P);
659 Record.push_back(D->SelLocsKind);
660 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
662 Record.push_back(NumStoredSelLocs);
663 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
664 Record.AddSourceLocation(SelLocs[i]);
670 VisitTypedefNameDecl(D);
671 Record.push_back(D->Variance);
672 Record.push_back(D->Index);
673 Record.AddSourceLocation(D->VarianceLoc);
674 Record.AddSourceLocation(D->ColonLoc);
687 VisitRedeclarable(D);
688 VisitObjCContainerDecl(D);
690 AddObjCTypeParamList(D->TypeParamList);
695 ObjCInterfaceDecl::DefinitionData &Data = D->data();
699 Record.push_back(Data.HasDesignatedInitializers);
702 Record.push_back(Data.ReferencedProtocols.size());
704 Record.AddDeclRef(
P);
706 Record.AddSourceLocation(PL);
709 Record.push_back(Data.AllReferencedProtocols.size());
711 P = Data.AllReferencedProtocols.begin(),
712 PEnd = Data.AllReferencedProtocols.end();
714 Record.AddDeclRef(*
P);
719 Writer.ObjCClassesWithCategories.insert(D);
722 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
723 (
void)Writer.GetDeclRef(Cat);
746 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
752 VisitRedeclarable(D);
753 VisitObjCContainerDecl(D);
759 Record.AddDeclRef(I);
761 Record.AddSourceLocation(PL);
773 VisitObjCContainerDecl(D);
778 AddObjCTypeParamList(D->TypeParamList);
781 Record.AddDeclRef(I);
783 Record.AddSourceLocation(PL);
795 Record.AddSourceLocation(D->
getAtLoc());
797 Record.AddTypeRef(D->
getType());
815 VisitObjCContainerDecl(D);
821 VisitObjCImplDecl(D);
827 VisitObjCImplDecl(D);
834 Record.push_back(D->NumIvarInitializers);
835 if (D->NumIvarInitializers)
836 Record.AddCXXCtorInitializers(
853 VisitDeclaratorDecl(D);
856 FieldDecl::InitStorageKind ISK = D->InitStorage.getInt();
857 Record.push_back(ISK);
858 if (ISK == FieldDecl::ISK_CapturedVLAType)
883 AbbrevToUse = Writer.getDeclFieldAbbrev();
889 VisitDeclaratorDecl(D);
899 for (
const auto *
P : D->
chain())
900 Record.AddDeclRef(
P);
905 VisitRedeclarable(D);
906 VisitDeclaratorDecl(D);
910 if (!isa<ParmVarDecl>(D)) {
921 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
922 Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
936 bool ModulesCodegen =
false;
937 if (Writer.WritingModule &&
939 !isa<VarTemplateSpecializationDecl>(D)) {
948 Record.push_back(ModulesCodegen);
950 Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D));
954 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
957 Record.push_back(VarTemplate);
958 Record.AddDeclRef(TemplD);
961 Record.push_back(StaticDataMemberSpecialization);
962 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
963 Record.push_back(SpecInfo->getTemplateSpecializationKind());
964 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
966 Record.push_back(VarNotTemplate);
989 AbbrevToUse = Writer.getDeclVarAbbrev();
1034 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1038 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1040 &&
"PARM_VAR_DECL can't be demoted definition.");
1041 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1043 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1045 "PARM_VAR_DECL can't be static data member");
1050 Record.push_back(D->
bindings().size());
1054 Record.AddDeclRef(B);
1082 Record.AddDeclRef(
P);
1088 for (
const auto &capture : D->
captures()) {
1089 Record.AddDeclRef(capture.getVariable());
1092 if (capture.isByRef()) flags |= 1;
1093 if (capture.isNested()) flags |= 2;
1094 if (capture.hasCopyExpr()) flags |= 4;
1095 Record.push_back(flags);
1097 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1107 Record.push_back(CD->
isNothrow() ? 1 : 0);
1110 Record.AddDeclRef(CD->
getParam(I));
1136 VisitRedeclarable(D);
1155 Writer.DeclUpdates[
Parent].push_back(
1162 VisitRedeclarable(D);
1175 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1176 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1183 Record.push_back(D->NumExpansions);
1187 Record.AddDeclRef(E);
1192 VisitRedeclarable(D);
1195 Record.AddDeclRef(D->UsingOrNextShadow);
1202 VisitUsingShadowDecl(D);
1203 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1204 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1205 Record.push_back(D->IsVirtual);
1223 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1241 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1244 Record.push_back(CXXRecTemplate);
1245 Record.AddDeclRef(TemplD);
1248 Record.push_back(CXXRecMemberSpecialization);
1249 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1250 Record.push_back(MSInfo->getTemplateSpecializationKind());
1251 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1253 Record.push_back(CXXRecNotTemplate);
1258 Record.AddCXXDefinitionData(D);
1262 if (D->IsCompleteDefinition)
1269 VisitFunctionDecl(D);
1273 Record.AddDeclRef(MD);
1276 Record.push_back(0);
1288 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1295 Record.AddDeclRef(Inherited.getShadowDecl());
1296 Record.AddDeclRef(Inherited.getConstructor());
1302 VisitCXXMethodDecl(D);
1310 VisitCXXMethodDecl(D);
1320 VisitCXXMethodDecl(D);
1328 Record.push_back(!IdentifierLocs.empty());
1329 if (IdentifierLocs.empty()) {
1330 Record.AddSourceLocation(D->
getLocEnd());
1331 Record.push_back(1);
1333 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1334 Record.AddSourceLocation(IdentifierLocs[I]);
1335 Record.push_back(IdentifierLocs.size());
1351 Record.push_back(D->NumTPLists);
1353 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1354 Record.push_back(hasFriendDecl);
1359 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1361 Record.AddDeclRef(D->getNextFriend());
1362 Record.push_back(D->UnsupportedFriend);
1363 Record.AddSourceLocation(D->FriendLoc);
1389 VisitRedeclarable(D);
1400 VisitTemplateDecl(D);
1405 VisitRedeclarableTemplateDecl(D);
1408 AddTemplateSpecializations(D);
1416 VisitCXXRecordDecl(D);
1421 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1422 Record.AddDeclRef(InstFromD);
1450 VisitClassTemplateSpecializationDecl(D);
1465 VisitRedeclarableTemplateDecl(D);
1468 AddTemplateSpecializations(D);
1478 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1481 Record.AddDeclRef(InstFromD);
1497 Record.push_back(D->IsCompleteDefinition);
1510 VisitVarTemplateSpecializationDecl(D);
1533 VisitRedeclarableTemplateDecl(D);
1536 AddTemplateSpecializations(D);
1547 Record.push_back(OwnsDefaultArg);
1561 VisitDeclaratorDecl(D);
1578 Record.push_back(OwnsDefaultArg);
1592 VisitTemplateDecl(D);
1607 Record.push_back(OwnsDefaultArg);
1615 VisitRedeclarableTemplateDecl(D);
1630 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(Context, DC));
1631 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(Context, DC));
1635 assert(IsLocalDecl(D) &&
"expected a local declaration");
1638 if (IsLocalDecl(Canon))
1641 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1646 if (IsLocalDecl(Redecl))
1648 return CacheEntry = D;
1651 template <
typename T>
1654 T *MostRecent = First->getMostRecentDecl();
1655 T *DAsT =
static_cast<T *
>(D);
1656 if (MostRecent != First) {
1658 "Not considered redeclarable?");
1660 Record.AddDeclRef(First);
1664 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1665 if (DAsT == FirstLocal) {
1669 unsigned I = Record.size();
1670 Record.push_back(0);
1672 AddFirstDeclFromEachModule(DAsT,
false);
1674 Record[I] = Record.size() - I;
1682 if (!Prev->isFromASTFile())
1687 if (LocalRedecls.empty())
1688 Record.push_back(0);
1692 Record.push_back(0);
1693 Record.AddDeclRef(FirstLocal);
1703 (void)Writer.GetDeclRef(MostRecent);
1706 Record.push_back(0);
1737 void ASTWriter::WriteDeclAbbrevs() {
1738 using namespace llvm;
1740 std::shared_ptr<BitCodeAbbrev> Abv;
1743 Abv = std::make_shared<BitCodeAbbrev>();
1746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1747 Abv->Add(BitCodeAbbrevOp(0));
1748 Abv->Add(BitCodeAbbrevOp(0));
1749 Abv->Add(BitCodeAbbrevOp(0));
1750 Abv->Add(BitCodeAbbrevOp(0));
1751 Abv->Add(BitCodeAbbrevOp(0));
1752 Abv->Add(BitCodeAbbrevOp(0));
1753 Abv->Add(BitCodeAbbrevOp(0));
1754 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1755 Abv->Add(BitCodeAbbrevOp(0));
1756 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1758 Abv->Add(BitCodeAbbrevOp(0));
1759 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1760 Abv->Add(BitCodeAbbrevOp(0));
1762 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1764 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1765 Abv->Add(BitCodeAbbrevOp(0));
1767 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1768 Abv->Add(BitCodeAbbrevOp(0));
1770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1771 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1772 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1773 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1776 Abv = std::make_shared<BitCodeAbbrev>();
1779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1780 Abv->Add(BitCodeAbbrevOp(0));
1781 Abv->Add(BitCodeAbbrevOp(0));
1782 Abv->Add(BitCodeAbbrevOp(0));
1783 Abv->Add(BitCodeAbbrevOp(0));
1784 Abv->Add(BitCodeAbbrevOp(0));
1785 Abv->Add(BitCodeAbbrevOp(0));
1786 Abv->Add(BitCodeAbbrevOp(0));
1787 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1788 Abv->Add(BitCodeAbbrevOp(0));
1789 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1791 Abv->Add(BitCodeAbbrevOp(0));
1792 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1793 Abv->Add(BitCodeAbbrevOp(0));
1795 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1797 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1798 Abv->Add(BitCodeAbbrevOp(0));
1800 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1801 Abv->Add(BitCodeAbbrevOp(0));
1803 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1804 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1806 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1807 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1808 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1809 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1812 Abv = std::make_shared<BitCodeAbbrev>();
1815 Abv->Add(BitCodeAbbrevOp(0));
1817 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1818 Abv->Add(BitCodeAbbrevOp(0));
1819 Abv->Add(BitCodeAbbrevOp(0));
1820 Abv->Add(BitCodeAbbrevOp(0));
1821 Abv->Add(BitCodeAbbrevOp(0));
1822 Abv->Add(BitCodeAbbrevOp(0));
1823 Abv->Add(BitCodeAbbrevOp(0));
1824 Abv->Add(BitCodeAbbrevOp(0));
1825 Abv->Add(BitCodeAbbrevOp(
AS_none));
1826 Abv->Add(BitCodeAbbrevOp(0));
1827 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1829 Abv->Add(BitCodeAbbrevOp(0));
1830 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1831 Abv->Add(BitCodeAbbrevOp(0));
1833 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1834 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1836 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1837 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1838 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1839 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1840 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1841 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1843 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1844 Abv->Add(BitCodeAbbrevOp(0));
1846 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1847 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1848 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1849 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1850 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1851 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1853 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1854 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1856 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1857 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1858 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
1861 Abv = std::make_shared<BitCodeAbbrev>();
1864 Abv->Add(BitCodeAbbrevOp(0));
1866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1867 Abv->Add(BitCodeAbbrevOp(0));
1868 Abv->Add(BitCodeAbbrevOp(0));
1869 Abv->Add(BitCodeAbbrevOp(0));
1870 Abv->Add(BitCodeAbbrevOp(0));
1871 Abv->Add(BitCodeAbbrevOp(0));
1872 Abv->Add(BitCodeAbbrevOp(0));
1873 Abv->Add(BitCodeAbbrevOp(0));
1874 Abv->Add(BitCodeAbbrevOp(
AS_none));
1875 Abv->Add(BitCodeAbbrevOp(0));
1876 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1878 Abv->Add(BitCodeAbbrevOp(0));
1879 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1880 Abv->Add(BitCodeAbbrevOp(0));
1882 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1883 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1885 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1886 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1887 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1888 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1889 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1890 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1891 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1892 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1893 Abv->Add(BitCodeAbbrevOp(0));
1895 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1896 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1897 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1898 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1900 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1901 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1902 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
1905 Abv = std::make_shared<BitCodeAbbrev>();
1908 Abv->Add(BitCodeAbbrevOp(0));
1910 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1911 Abv->Add(BitCodeAbbrevOp(0));
1912 Abv->Add(BitCodeAbbrevOp(0));
1913 Abv->Add(BitCodeAbbrevOp(0));
1914 Abv->Add(BitCodeAbbrevOp(0));
1915 Abv->Add(BitCodeAbbrevOp(0));
1916 Abv->Add(BitCodeAbbrevOp(0));
1917 Abv->Add(BitCodeAbbrevOp(0));
1918 Abv->Add(BitCodeAbbrevOp(
AS_none));
1919 Abv->Add(BitCodeAbbrevOp(0));
1920 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1922 Abv->Add(BitCodeAbbrevOp(0));
1923 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1924 Abv->Add(BitCodeAbbrevOp(0));
1926 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1928 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1929 Abv->Add(BitCodeAbbrevOp(0));
1931 Abv->Add(BitCodeAbbrevOp(0));
1932 Abv->Add(BitCodeAbbrevOp(0));
1933 Abv->Add(BitCodeAbbrevOp(0));
1934 Abv->Add(BitCodeAbbrevOp(0));
1935 Abv->Add(BitCodeAbbrevOp(0));
1936 Abv->Add(BitCodeAbbrevOp(0));
1938 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1939 Abv->Add(BitCodeAbbrevOp(0));
1940 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1941 Abv->Add(BitCodeAbbrevOp(0));
1942 Abv->Add(BitCodeAbbrevOp(0));
1943 Abv->Add(BitCodeAbbrevOp(0));
1944 Abv->Add(BitCodeAbbrevOp(0));
1946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1947 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1948 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1949 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1952 Abv = std::make_shared<BitCodeAbbrev>();
1955 Abv->Add(BitCodeAbbrevOp(0));
1957 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1958 Abv->Add(BitCodeAbbrevOp(0));
1959 Abv->Add(BitCodeAbbrevOp(0));
1960 Abv->Add(BitCodeAbbrevOp(0));
1961 Abv->Add(BitCodeAbbrevOp(0));
1962 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1963 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1964 Abv->Add(BitCodeAbbrevOp(0));
1965 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1966 Abv->Add(BitCodeAbbrevOp(0));
1967 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1969 Abv->Add(BitCodeAbbrevOp(0));
1970 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1971 Abv->Add(BitCodeAbbrevOp(0));
1973 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1974 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1976 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1977 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1978 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
1981 Abv = std::make_shared<BitCodeAbbrev>();
1984 Abv->Add(BitCodeAbbrevOp(0));
1986 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1987 Abv->Add(BitCodeAbbrevOp(0));
1988 Abv->Add(BitCodeAbbrevOp(0));
1989 Abv->Add(BitCodeAbbrevOp(0));
1990 Abv->Add(BitCodeAbbrevOp(0));
1991 Abv->Add(BitCodeAbbrevOp(0));
1992 Abv->Add(BitCodeAbbrevOp(0));
1993 Abv->Add(BitCodeAbbrevOp(0));
1994 Abv->Add(BitCodeAbbrevOp(
AS_none));
1995 Abv->Add(BitCodeAbbrevOp(0));
1996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1998 Abv->Add(BitCodeAbbrevOp(0));
1999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2000 Abv->Add(BitCodeAbbrevOp(0));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2004 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2005 Abv->Add(BitCodeAbbrevOp(0));
2007 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2008 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2009 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2010 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2011 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2012 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2013 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2014 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2015 Abv->Add(BitCodeAbbrevOp(0));
2016 Abv->Add(BitCodeAbbrevOp(0));
2017 Abv->Add(BitCodeAbbrevOp(0));
2018 Abv->Add(BitCodeAbbrevOp(0));
2019 Abv->Add(BitCodeAbbrevOp(0));
2020 Abv->Add(BitCodeAbbrevOp(0));
2021 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2022 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2023 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2025 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2026 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2027 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2028 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2031 Abv = std::make_shared<BitCodeAbbrev>();
2034 Abv->Add(BitCodeAbbrevOp(0));
2036 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2037 Abv->Add(BitCodeAbbrevOp(0));
2038 Abv->Add(BitCodeAbbrevOp(0));
2039 Abv->Add(BitCodeAbbrevOp(0));
2040 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2041 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2042 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2043 Abv->Add(BitCodeAbbrevOp(0));
2044 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2045 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2046 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2049 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2050 Abv->Add(BitCodeAbbrevOp(0));
2052 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2054 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2055 Abv->Add(BitCodeAbbrevOp(0));
2057 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2058 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2059 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2060 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2061 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2062 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2063 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2064 Abv->Add(BitCodeAbbrevOp(0));
2065 Abv->Add(BitCodeAbbrevOp(1));
2066 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2067 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2068 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2069 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2070 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2071 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2072 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2073 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2074 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2075 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2076 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2077 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2078 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2087 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2088 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2089 DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2092 Abv = std::make_shared<BitCodeAbbrev>();
2096 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2097 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2098 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2099 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2100 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2101 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2102 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2104 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2105 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2106 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2107 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2108 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2110 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2111 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2112 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2115 Abv = std::make_shared<BitCodeAbbrev>();
2119 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2120 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2121 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2122 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2123 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2124 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2125 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2127 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2128 Abv->Add(BitCodeAbbrevOp(32));
2129 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2130 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2133 Abv = std::make_shared<BitCodeAbbrev>();
2137 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2138 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2139 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2140 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2141 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2142 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2143 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2145 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2146 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2147 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2148 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2151 Abv = std::make_shared<BitCodeAbbrev>();
2155 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2156 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2157 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2158 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2159 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2160 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2161 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2163 Abv->Add(BitCodeAbbrevOp(0));
2164 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2166 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2168 Abv = std::make_shared<BitCodeAbbrev>();
2170 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2171 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2173 Abv = std::make_shared<BitCodeAbbrev>();
2175 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2176 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2192 bool WritingModule) {
2198 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) ||
2199 D->
hasAttr<OMPDeclareTargetDeclAttr>())
2202 if (WritingModule && (isa<VarDecl>(D) || isa<ImportDecl>(D))) {
2214 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2221 assert(ID >= FirstDeclID &&
"invalid decl ID");
2234 unsigned Index = ID - FirstDeclID;
2235 if (DeclOffsets.size() == Index)
2236 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2237 else if (DeclOffsets.size() < Index) {
2239 DeclOffsets.resize(Index+1);
2240 DeclOffsets[Index].setLocation(Loc);
2241 DeclOffsets[Index].BitOffset =
Offset;
2243 llvm_unreachable(
"declarations should be emitted in ID order");
2248 associateDeclWithFile(D, ID);
2253 EagerlyDeserializedDecls.push_back(ID);
2258 Writer->ClearSwitchCaseIDs();
2261 bool ModulesCodegen =
false;
2269 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2272 if (Writer->Context->getLangOpts().ModulesCodegen) {
2275 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2277 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2282 Record->push_back(ModulesCodegen);
2284 Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2285 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2286 Record->push_back(CD->getNumCtorInitializers());
2287 if (CD->getNumCtorInitializers())
2288 AddCXXCtorInitializers(
2289 llvm::makeArrayRef(CD->init_begin(), CD->init_end()));
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
SourceLocation getGetterNameLoc() const
A FriendTemplateDecl record.
A NonTypeTemplateParmDecl record.
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
const TemplateArgumentLoc & getTemplateArg(unsigned I) const
Returns the nth template argument.
const Type * getTypeForDecl() const
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
An instance of this class is created to represent a function declaration or definition.
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
void VisitAccessSpecDecl(AccessSpecDecl *D)
unsigned getNumTemplateArgs() const
Returns the number of explicit template arguments that were given.
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
protocol_range protocols() const
void VisitStaticAssertDecl(StaticAssertDecl *D)
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
void VisitCXXMethodDecl(CXXMethodDecl *D)
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
A (possibly-)qualified type.
const char * getDeclKindName() const
unsigned param_size() const
ObjCInterfaceDecl * getClassInterface()
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
void VisitRedeclarable(Redeclarable< T > *D)
void VisitEmptyDecl(EmptyDecl *D)
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
ObjCIvarDecl * getPropertyIvarDecl() const
bool isObjCMethodParameter() const
void RegisterTemplateSpecialization(const Decl *Template, const Decl *Specialization)
Ensure that this template specialization is associated with the specified template on reload...
void VisitTypedefNameDecl(TypedefNameDecl *D)
SourceRange getBraceRange() const
An OMPThreadPrivateDecl record.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
void VisitExportDecl(ExportDecl *D)
bool isMemberSpecialization()
Determines whether this class template partial specialization template was a specialization of a memb...
Expr * getBitWidth() const
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
void VisitCXXRecordDecl(CXXRecordDecl *D)
StorageClass getStorageClass() const
Returns the storage class as written in the source.
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
An OMPDeclareReductionDecl record.
bool hasVolatileMember() const
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
const Type * getTypeForDecl() const
bool isLocalSourceLocation(SourceLocation Loc) const
Returns true if Loc did not come from a PCH/Module.
Decl - This represents one declaration (or definition), e.g.
unsigned getNumCaptures() const
getNumCaptures - Returns the number of captured variables.
An ImplicitCastExpr record.
IdentifierInfo * getGetterId() const
A VarTemplatePartialSpecializationDecl record.
ThreadStorageClassSpecifier getTSCSpec() const
Defines the C++ template declaration subclasses.
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
bool hasWrittenPrototype() const
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
Expr * getSetterCXXAssignment() const
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
A record that stores the set of declarations that are lexically stored within a given DeclContext...
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement...
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
Represents an empty-declaration.
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, ASTWriter::RecordDataImpl &Record)
Expr * getOperatorDeleteThisArg() const
Declaration of a variable template.
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
NamespaceDecl - Represent a C++ namespace.
A ObjCPropertyDecl record.
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
TypeSourceInfo * getDefaultArgumentInfo() const
Retrieves the default argument's source information, if any.
SourceLocation getLocEnd() const LLVM_READONLY
unsigned getIdentifierNamespace() const
Represents a C++ constructor within a class.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
size_t param_size() const
ArrayRef< Decl > getPartialSpecializations(FunctionTemplateDecl::Common *)
uint64_t Emit(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, followed by its substatements, and return its offset.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
A ClassTemplateDecl record.
A PragmaDetectMismatchDecl record.
An UnresolvedUsingTypenameDecl record.
void VisitBlockDecl(BlockDecl *D)
void VisitImplicitParamDecl(ImplicitParamDecl *D)
unsigned getDepth() const
Get the nesting depth of the template parameter.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Declaration of a redeclarable template.
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
An OMPCapturedExprDecl record.
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
A UsingShadowDecl record.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
bool hasInheritedDefaultArg() const
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack...
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
bool isInvalidDecl() const
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
unsigned getContextParamPosition() const
protocol_range protocols() const
unsigned IsExplicitSpecified
A TemplateTemplateParmDecl record.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
ParmVarDecl - Represents a parameter to a function.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
A ObjCInterfaceDecl record.
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
Provides information about a dependent function-template specialization declaration.
const ObjCInterfaceDecl * getSuperClass() const
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
A CXXConstructorDecl record for an inherited constructor.
RecordDecl - Represents a struct/union/class.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
Provides common interface for the Decls that can be redeclared.
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
Represents a class template specialization, which refers to a class template with a given set of temp...
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
StringLiteral * getMessage()
SourceLocation getIvarLBraceLoc() const
Expr * getGetterCXXConstructor() const
CXXRecordDecl * getPreviousDecl()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool isInline() const
Returns true if this is an inline namespace declaration.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
const llvm::APSInt & getInitVal() const
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
StringRef getValue() const
InitKind getInitializerKind() const
Get initializer kind.
ObjCMethodDecl * getSetterMethodDecl() const
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
void VisitDecompositionDecl(DecompositionDecl *D)
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
void VisitParmVarDecl(ParmVarDecl *D)
Represents an access specifier followed by colon ':'.
Declaration of a function specialization at template class scope.
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
TypeSourceInfo * getFriendType() const
If this friend declaration names a templated type (or a dependent member type of a templated type)...
TypeSourceInfo * getSignatureAsWritten() const
A IndirectFieldDecl record.
ArrayRef< ParmVarDecl * > parameters() const
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Represents a C++ using-declaration.
const TemplateArgumentList * TemplateArguments
The template arguments used to produce the function template specialization from the function templat...
FunctionTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
SourceLocation getIvarRBraceLoc() const
ArrayRef< BindingDecl * > bindings() const
void VisitLabelDecl(LabelDecl *LD)
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
void append(InputIterator begin, InputIterator end)
void VisitClassTemplateDecl(ClassTemplateDecl *D)
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
ObjCContainerDecl - Represents a container for method declarations.
TagKind getTagKind() const
bool isReferenced() const
Whether any declaration of this entity was referenced.
void VisitTypedefDecl(TypedefDecl *D)
An AccessSpecDecl record.
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion: ...
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes, if any.
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
void VisitUsingShadowDecl(UsingShadowDecl *D)
A ConstructorUsingShadowDecl record.
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
ArrayRef< NamedDecl * > chain() const
A UsingDirecitveDecl record.
PropertyAttributeKind getPropertyAttributes() const
A DecompositionDecl record.
TypeDecl - Represents a declaration of a type.
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum...
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or nullptr if this template w...
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
void VisitBindingDecl(BindingDecl *D)
TemplateParameterList * getTemplateParameterList(unsigned i) const
const Expr * getInitExpr() const
SourceLocation getPropertyIvarDeclLoc() const
TemplateParameterList * getFriendTypeTemplateParameterList(unsigned N) const
A ClassTemplateSpecializationDecl record.
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
SourceLocation getExternLoc() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Represents an Objective-C protocol declaration.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
PropertyControl getPropertyImplementation() const
This represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
SourceLocation getLocEnd() const LLVM_READONLY
Represents a linkage specification.
QualType getReturnType() const
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
A binding in a decomposition declaration.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getAtStartLoc() const
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
SourceLocation getRParenLoc() const
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
void VisitObjCContainerDecl(ObjCContainerDecl *D)
SourceLocation getLocStart() const LLVM_READONLY
RecordDecl * getMostRecentDecl()
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
protocol_loc_range protocol_locs() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
Represents a ValueDecl that came out of a declarator.
QualType getPromotionType() const
getPromotionType - Return the integer type that enumerators should promote to.
A CXXDeductionGuideDecl record.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
bool isInlineSpecified() const
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
A StaticAssertDecl record.
TypeSourceInfo * getTypeSourceInfo() const
A VarTemplateSpecializationDecl record.
static bool classofKind(Kind K)
An ObjCTypeParamDecl record.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
unsigned getFunctionScopeDepth() const
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
A ObjCCategoryImplDecl record.
unsigned getChainingSize() const
Selector getSetterName() const
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
A ObjCPropertyImplDecl record.
const FunctionProtoType * T
TypeSourceInfo * getSuperClassTInfo() const
void VisitRecordDecl(RecordDecl *D)
Declaration of a template type parameter.
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
TypeSourceInfo * getTypeSourceInfo() const
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name...
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D...
unsigned getNumParams() const
Represents a C++ destructor within a class.
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
A CXXConstructorDecl record.
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
void VisitTemplateDecl(TemplateDecl *D)
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
overridden_method_range overridden_methods() const
DeclContext * getDeclContext()
void VisitUsingDecl(UsingDecl *D)
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
A VarTemplateDecl record.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
EnumDecl * getMostRecentDecl()
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this...
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
A CXXDestructorDecl record.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
unsigned IsCopyDeductionCandidate
[C++17] Only used by CXXDeductionGuideDecl.
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack...
IdentifierInfo * getSetterId() const
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
A NamespaceAliasDecl record.
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
FunctionTemplateDecl * getTemplate(unsigned I) const
Returns the i'th template candidate.
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
void AddObjCTypeParamList(ObjCTypeParamList *typeParams)
Add an Objective-C type parameter list to the given record.
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
bool isInstanceMethod() const
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
An ImplicitParamDecl record.
StringRef getName() const
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
Represents a C++ deduction guide declaration.
Represents a C++ conversion function within a class.
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
An EnumConstantDecl record.
ImplicitParamDecl * getSelfDecl() const
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
void VisitTagDecl(TagDecl *D)
An ImportDecl recording a module import.
A ObjCCategoryDecl record.
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
CXXMethodDecl * getMostRecentDecl()
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
static DeclType * getDecl(EntryType *D)
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
A FileScopeAsmDecl record.
void VisitMSPropertyDecl(MSPropertyDecl *D)
A ObjCCompatibleAliasDecl record.
void VisitVarTemplateDecl(VarTemplateDecl *D)
void VisitTypeAliasDecl(TypeAliasDecl *D)
void VisitDeclContext(DeclContext *DC)
Emit the DeclContext part of a declaration context decl.
protocol_loc_range protocol_locs() const
TypeSourceInfo * getReturnTypeSourceInfo() const
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
void push_back(uint64_t N)
Minimal vector-like interface.
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
SourceLocation getLocStart() const LLVM_READONLY
unsigned protocol_size() const
SourceLocation getUsingLoc() const
Return the location of the using keyword.
unsigned size_overridden_methods() const
Represents a C++ Modules TS module export declaration.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
An UnresolvedUsingValueDecl record.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Encodes a location in the source.
bool getSynthesize() const
This represents '#pragma omp declare reduction ...' directive.
A record that stores the set of declarations that are visible from a given DeclContext.
Pseudo declaration for capturing expressions.
SourceLocation getSuperClassLoc() const
void VisitObjCImplDecl(ObjCImplDecl *D)
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
SourceLocation getLocStart() const LLVM_READONLY
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
TagDecl - Represents the declaration of a struct/union/class/enum.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
SourceLocation getCategoryNameLoc() const
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
ObjCList - This is a simple template class used to hold various lists of decls etc, which is heavily used by the ObjC front-end.
LabelDecl - Represents the declaration of a label.
Represents a dependent using declaration which was not marked with typename.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set...
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
SourceLocation getRParenLoc() const
Represents a static or instance method of a struct/union/class.
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
void VisitUsingPackDecl(UsingPackDecl *D)
C-style initialization with assignment.
bool isConversionFromLambda() const
bool isMemberSpecialization()
Determines whether this variable template partial specialization was a specialization of a member par...
A TemplateTypeParmDecl record.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Data that is common to all of the declarations of a given function template.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
ObjCCategoryDecl - Represents a category declaration.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
unsigned getNumTemplates() const
Returns the number of function templates that this might be a specialization of.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
void VisitCapturedDecl(CapturedDecl *D)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Represents one property declaration in an Objective-C interface.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
A simple visitor class that helps create declaration visitors.
unsigned getODRHash()
Returns ODRHash of the function.
bool hasUninstantiatedDefaultArg() const
void AddSourceLocation(SourceLocation Loc)
Emit a source location.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D)
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
ObjCDeclQualifier getObjCDeclQualifier() const
Represents a C++11 static_assert declaration.
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
SourceLocation getRBraceLoc() const
bool hasFlexibleArrayMember() const
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
SourceLocation getIvarLBraceLoc() const
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
SourceLocation getRAngleLoc() const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
protocol_range protocols() const
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
A ObjCProtocolDecl record.
ObjCDeclQualifier getObjCDeclQualifier() const
Base class for declarations which introduce a typedef-name.
A CXXConversionDecl record.
void VisitFieldDecl(FieldDecl *D)
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
const ObjCInterfaceDecl * getClassInterface() const
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Dataflow Directional Tag Classes.
void AddTemplateSpecializations(DeclTy *D)
bool isValid() const
Return true if this is a valid SourceLocation object.
An IntegerLiteral record.
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
ArrayRef< Capture > captures() const
PropertyAttributeKind getPropertyAttributesAsWritten() const
The base class of all kinds of template declarations (e.g., class, function, etc.).
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition.
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
SourceLocation getAtLoc() const
void VisitNamedDecl(NamedDecl *D)
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
A ClassTemplatePartialSpecializationDecl record.
QualType getUnderlyingType() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
DeclCode
Record codes for each kind of declaration.
const Expr * getInit() const
AccessSpecifier getAccess() const
A decomposition declaration.
bool isEmbeddedInDeclarator() const
void VisitTypeDecl(TypeDecl *D)
unsigned getNumTemplateParameters() const
Represents a dependent using declaration which was marked with typename.
A ClassScopeFunctionSpecializationDecl record a class scope function specialization.
Represents the declaration of an Objective-C type parameter.
A CharacterLiteral record.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
A LinkageSpecDecl record.
decltype(T::PartialSpecializations) & getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
EnumDecl - Represents an enum.
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
void VisitDeclaratorDecl(DeclaratorDecl *D)
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
SourceLocation getSetterNameLoc() const
const ObjCInterfaceDecl * getClassInterface() const
void VisitEnumDecl(EnumDecl *D)
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
const FunctionDecl * getOperatorDelete() const
A PragmaCommentDecl record.
void VisitNamespaceDecl(NamespaceDecl *D)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
void VisitVarDecl(VarDecl *D)
Expr * getUninstantiatedDefaultArg()
protocol_loc_range protocol_locs() const
size_t param_size() const
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
ImplicitParamDecl * getParam(unsigned i) const
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
void VisitFunctionDecl(FunctionDecl *D)
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool hasTypename() const
Return true if the using declaration has 'typename'.
SourceManager & getSourceManager()
bool capturesCXXThis() const
ImplementationControl getImplementationControl() const
static bool classofKind(Kind K)
SourceRange getAtEndRange() const
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
static bool classofKind(Kind K)
Represents a field declaration created by an @defs(...).
SourceLocation getCategoryNameLoc() const
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
TypedefNameDecl * getTypedefNameForAnonDecl() const
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool isThisDeclarationADefinition() const
isThisDeclarationADefinition() - Return true if this declaration is a completion definition of the ty...
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...
SourceLocation getRBraceLoc() const
Represents a C++ struct/union/class.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
An object for streaming information to a record.
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCIvarDecl * getPropertyIvarDecl() const
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
Provides information a specialization of a member of a class template, which may be a member function...
A ObjCImplementationDecl record.
void VisitEnumConstantDecl(EnumConstantDecl *D)
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
A ObjCAtDefsFieldDecl record.
Declaration of a class template.
void VisitCXXConversionDecl(CXXConversionDecl *D)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
ImplicitParamDecl * getCmdDecl() const
void VisitClassScopeFunctionSpecializationDecl(ClassScopeFunctionSpecializationDecl *D)
Writes an AST file containing the contents of a translation unit.
VarTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
CXXMethodDecl * getSpecialization() const
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
unsigned protocol_size() const
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body - that is, if it is a non-delete...
bool blockMissingReturnType() const
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
unsigned varlist_size() const
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
void VisitFriendDecl(FriendDecl *D)
TranslationUnitDecl - The top declaration context.
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...
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
ArrayRef< ParmVarDecl * > parameters() const
NamedDecl * getMostRecentDecl()
ObjCPropertyDecl * getPropertyDecl() const
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
bool hasObjectMember() const
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
Expr * getBinding() const
Get the expression to which this declaration is bound.
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
A FunctionTemplateDecl record.
ModuleFile * getOwningModuleFile(const Decl *D)
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a mo...
A TypeAliasTemplateDecl record.
void VisitImportDecl(ImportDecl *D)
bool isStaticDataMember() const
Determines whether this is a static data member.
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
An instance of this class represents the declaration of a property member.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
ObjCMethodDecl * getGetterMethodDecl() const
NamedDecl - This represents a decl with a name.
SourceLocation getLAngleLoc() const
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
Represents a C++ namespace alias.
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
void VisitFriendTemplateDecl(FriendTemplateDecl *D)
bool isInline() const
Whether this variable is (C++1z) inline.
AccessControl getAccessControl() const
Declaration of a friend template.
SourceLocation getIvarRBraceLoc() const
bool isPropertyAccessor() const
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
Selector getGetterName() const
Represents C++ using-directive.
SourceLocation getLParenLoc() const
SourceLocation getEndOfDefinitionLoc() const
Represents a #pragma detect_mismatch line.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
NamedDecl * getFriendDecl() const
If this friend declaration names a templated function (or a member function of a templated type)...
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
void VisitObjCMethodDecl(ObjCMethodDecl *D)
bool isFreeStanding() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
unsigned size() const
Determine the number of type parameters in this list.
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
This class handles loading and caching of source files into memory.
void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D)
void VisitValueDecl(ValueDecl *D)
Declaration of a template function.
Source range/offset of a preprocessed entity.
SourceLocation getLocation() const
const StringLiteral * getAsmString() const
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Represents a pack of using declarations that a single using-declarator pack-expanded into...
SourceLocation getRBraceLoc() const
ArrayRef< ParmVarDecl * > parameters() const
void VisitObjCIvarDecl(ObjCIvarDecl *D)
ObjCCompatibleAliasDecl - Represents alias of a class.
This is a C++ Modules TS module interface unit.
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...