25 #include "llvm/Bitcode/BitstreamWriter.h" 26 #include "llvm/Support/ErrorHandling.h" 27 using namespace clang;
28 using namespace serialization;
46 : Writer(Writer), Context(Context), Record(Writer, Record),
47 Code((serialization::
DeclCode)0), AbbrevToUse(0) {}
51 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
53 return Record.
Emit(Code, AbbrevToUse);
58 void VisitDecl(
Decl *D);
76 void VisitClassTemplateSpecializationDecl(
78 void VisitClassTemplatePartialSpecializationDecl(
81 void VisitVarTemplatePartialSpecializationDecl(
83 void VisitClassScopeFunctionSpecializationDecl(
161 for (
auto typeParam : *typeParams) {
172 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
175 if (R->isFromASTFile())
177 else if (IncludeLocal)
180 for (
const auto &F : Firsts)
185 template <
typename EntryType>
194 return Common->PartialSpecializations;
200 template<
typename DeclTy>
202 auto *Common = D->getCommonPtr();
208 Common->LazySpecializations) {
209 D->LoadLazySpecializations();
210 assert(!Common->LazySpecializations);
214 if (
auto *LS = Common->LazySpecializations)
215 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
218 unsigned I = Record.
size();
224 for (
auto &Entry : Common->Specializations)
225 Specs.push_back(getSpecializationDecl(Entry));
226 for (
auto &Entry : getPartialSpecializations(Common))
227 Specs.push_back(getSpecializationDecl(Entry));
229 for (
auto *D : Specs) {
230 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
231 AddFirstDeclFromEachModule(D,
true);
233 Record.
append(LazySpecializations.begin(), LazySpecializations.end());
236 Record[I] = Record.
size() - I - 1;
242 const Decl *Specialization) {
257 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
270 if (
auto *TInfo = DD->getTypeSourceInfo())
271 Record.AddTypeLoc(TInfo->getTypeLoc());
278 Record.push_back(FD->doesThisDeclarationHaveABody());
279 if (FD->doesThisDeclarationHaveABody())
280 Record.AddFunctionDefinition(FD);
287 VisitDeclContext(DC);
299 Record.AddAttributes(D->
getAttrs());
301 Record.push_back(D->
isUsed(
false));
318 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
319 if (!NS->isFromASTFile())
321 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
322 if (!NS->isInlineNamespace())
330 StringRef Arg = D->
getArg();
331 Record.push_back(Arg.size());
335 Record.AddString(Arg);
343 Record.push_back(Name.size() + 1 + Value.size());
346 Record.AddString(Name);
347 Record.AddString(Value);
352 llvm_unreachable(
"Translation units aren't directly serialized");
359 ? Writer.getAnonymousDeclarationNumber(D)
370 VisitRedeclarable(D);
373 Record.push_back(D->
isModed());
380 VisitTypedefNameDecl(D);
390 AbbrevToUse = Writer.getDeclTypedefAbbrev();
396 VisitTypedefNameDecl(D);
402 VisitRedeclarable(D);
406 if (!isa<CXXRecordDecl>(D))
413 if (D->hasExtInfo()) {
415 Record.AddQualifierInfo(*D->getExtInfo());
418 Record.AddDeclRef(TD);
419 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
435 Record.push_back(D->
isFixed());
439 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
440 Record.push_back(MemberInfo->getTemplateSpecializationKind());
441 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
443 Record.AddDeclRef(
nullptr);
463 AbbrevToUse = Writer.getDeclEnumAbbrev();
495 AbbrevToUse = Writer.getDeclRecordAbbrev();
502 Record.AddTypeRef(D->
getType());
518 Record.push_back(D->hasExtInfo());
520 Record.AddQualifierInfo(*D->getExtInfo());
527 VisitRedeclarable(D);
528 VisitDeclaratorDecl(D);
529 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
539 Record.push_back(D->
isPure());
542 Record.push_back(D->isDeletedBit());
554 Record.AddSourceLocation(D->
getEndLoc());
576 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
590 Record.AddTemplateArgumentLoc(
626 Record.AddDeclRef(
P);
631 VisitFunctionDecl(D);
640 bool HasBodyStuff = D->
getBody() !=
nullptr ||
642 Record.push_back(HasBodyStuff);
669 Record.AddSourceLocation(D->
getEndLoc());
672 Record.AddDeclRef(
P);
674 Record.push_back(D->getSelLocsKind());
675 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
677 Record.push_back(NumStoredSelLocs);
678 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
679 Record.AddSourceLocation(SelLocs[i]);
685 VisitTypedefNameDecl(D);
686 Record.push_back(D->Variance);
687 Record.push_back(D->Index);
688 Record.AddSourceLocation(D->VarianceLoc);
689 Record.AddSourceLocation(D->ColonLoc);
702 VisitRedeclarable(D);
703 VisitObjCContainerDecl(D);
705 AddObjCTypeParamList(D->TypeParamList);
710 ObjCInterfaceDecl::DefinitionData &Data = D->data();
714 Record.push_back(Data.HasDesignatedInitializers);
717 Record.push_back(Data.ReferencedProtocols.size());
719 Record.AddDeclRef(
P);
721 Record.AddSourceLocation(PL);
724 Record.push_back(Data.AllReferencedProtocols.size());
726 P = Data.AllReferencedProtocols.begin(),
727 PEnd = Data.AllReferencedProtocols.end();
729 Record.AddDeclRef(*
P);
734 Writer.ObjCClassesWithCategories.insert(D);
737 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
738 (
void)Writer.GetDeclRef(Cat);
761 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
767 VisitRedeclarable(D);
768 VisitObjCContainerDecl(D);
774 Record.AddDeclRef(I);
776 Record.AddSourceLocation(PL);
788 VisitObjCContainerDecl(D);
793 AddObjCTypeParamList(D->TypeParamList);
796 Record.AddDeclRef(I);
798 Record.AddSourceLocation(PL);
810 Record.AddSourceLocation(D->
getAtLoc());
812 Record.AddTypeRef(D->
getType());
830 VisitObjCContainerDecl(D);
836 VisitObjCImplDecl(D);
842 VisitObjCImplDecl(D);
849 Record.push_back(D->NumIvarInitializers);
850 if (D->NumIvarInitializers)
851 Record.AddCXXCtorInitializers(
868 VisitDeclaratorDecl(D);
871 FieldDecl::InitStorageKind ISK = D->InitStorage.getInt();
872 Record.push_back(ISK);
873 if (ISK == FieldDecl::ISK_CapturedVLAType)
898 AbbrevToUse = Writer.getDeclFieldAbbrev();
904 VisitDeclaratorDecl(D);
914 for (
const auto *
P : D->
chain())
915 Record.AddDeclRef(
P);
920 VisitRedeclarable(D);
921 VisitDeclaratorDecl(D);
926 if (!isa<ParmVarDecl>(D)) {
937 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
938 Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
960 bool ModulesCodegen =
false;
961 if (Writer.WritingModule &&
963 !isa<VarTemplateSpecializationDecl>(D)) {
972 Record.push_back(ModulesCodegen);
974 Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D));
978 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
981 Record.push_back(VarTemplate);
982 Record.AddDeclRef(TemplD);
985 Record.push_back(StaticDataMemberSpecialization);
986 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
987 Record.push_back(SpecInfo->getTemplateSpecializationKind());
988 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
990 Record.push_back(VarNotTemplate);
1015 AbbrevToUse = Writer.getDeclVarAbbrev();
1060 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1064 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1066 &&
"PARM_VAR_DECL can't be demoted definition.");
1067 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1069 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1071 "PARM_VAR_DECL can't be static data member");
1076 Record.push_back(D->
bindings().size());
1080 Record.AddDeclRef(B);
1108 Record.AddDeclRef(
P);
1115 for (
const auto &capture : D->
captures()) {
1116 Record.AddDeclRef(capture.getVariable());
1119 if (capture.isByRef()) flags |= 1;
1120 if (capture.isNested()) flags |= 2;
1121 if (capture.hasCopyExpr()) flags |= 4;
1122 Record.push_back(flags);
1124 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1134 Record.push_back(CD->
isNothrow() ? 1 : 0);
1137 Record.AddDeclRef(CD->
getParam(I));
1163 VisitRedeclarable(D);
1182 Writer.DeclUpdates[
Parent].push_back(
1189 VisitRedeclarable(D);
1202 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1203 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1210 Record.push_back(D->NumExpansions);
1214 Record.AddDeclRef(E);
1219 VisitRedeclarable(D);
1223 Record.AddDeclRef(D->UsingOrNextShadow);
1230 VisitUsingShadowDecl(D);
1231 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1232 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1233 Record.push_back(D->IsVirtual);
1251 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1269 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1272 Record.push_back(CXXRecTemplate);
1273 Record.AddDeclRef(TemplD);
1276 Record.push_back(CXXRecMemberSpecialization);
1277 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1278 Record.push_back(MSInfo->getTemplateSpecializationKind());
1279 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1281 Record.push_back(CXXRecNotTemplate);
1286 Record.AddCXXDefinitionData(D);
1297 VisitFunctionDecl(D);
1301 Record.AddDeclRef(MD);
1304 Record.push_back(0);
1316 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1323 Record.AddDeclRef(Inherited.getShadowDecl());
1324 Record.AddDeclRef(Inherited.getConstructor());
1330 VisitCXXMethodDecl(D);
1338 VisitCXXMethodDecl(D);
1348 VisitCXXMethodDecl(D);
1356 Record.push_back(!IdentifierLocs.empty());
1357 if (IdentifierLocs.empty()) {
1358 Record.AddSourceLocation(D->
getEndLoc());
1359 Record.push_back(1);
1361 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1362 Record.AddSourceLocation(IdentifierLocs[I]);
1363 Record.push_back(IdentifierLocs.size());
1379 Record.push_back(D->NumTPLists);
1381 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1382 Record.push_back(hasFriendDecl);
1387 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1389 Record.AddDeclRef(D->getNextFriend());
1390 Record.push_back(D->UnsupportedFriend);
1391 Record.AddSourceLocation(D->FriendLoc);
1417 VisitRedeclarable(D);
1428 VisitTemplateDecl(D);
1433 VisitRedeclarableTemplateDecl(D);
1436 AddTemplateSpecializations(D);
1444 VisitCXXRecordDecl(D);
1449 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1450 Record.AddDeclRef(InstFromD);
1478 VisitClassTemplateSpecializationDecl(D);
1493 VisitRedeclarableTemplateDecl(D);
1496 AddTemplateSpecializations(D);
1506 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1509 Record.AddDeclRef(InstFromD);
1525 Record.push_back(D->IsCompleteDefinition);
1538 VisitVarTemplateSpecializationDecl(D);
1561 VisitRedeclarableTemplateDecl(D);
1564 AddTemplateSpecializations(D);
1575 Record.push_back(OwnsDefaultArg);
1589 VisitDeclaratorDecl(D);
1606 Record.push_back(OwnsDefaultArg);
1620 VisitTemplateDecl(D);
1635 Record.push_back(OwnsDefaultArg);
1643 VisitRedeclarableTemplateDecl(D);
1658 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(Context, DC));
1659 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(Context, DC));
1663 assert(IsLocalDecl(D) &&
"expected a local declaration");
1666 if (IsLocalDecl(Canon))
1669 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1674 if (IsLocalDecl(Redecl))
1676 return CacheEntry = D;
1679 template <
typename T>
1682 T *MostRecent = First->getMostRecentDecl();
1683 T *DAsT =
static_cast<T *
>(D);
1684 if (MostRecent != First) {
1686 "Not considered redeclarable?");
1688 Record.AddDeclRef(First);
1692 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1693 if (DAsT == FirstLocal) {
1697 unsigned I = Record.size();
1698 Record.push_back(0);
1700 AddFirstDeclFromEachModule(DAsT,
false);
1702 Record[I] = Record.size() - I;
1710 if (!Prev->isFromASTFile())
1715 if (LocalRedecls.empty())
1716 Record.push_back(0);
1720 Record.push_back(0);
1721 Record.AddDeclRef(FirstLocal);
1731 (void)Writer.GetDeclRef(MostRecent);
1734 Record.push_back(0);
1778 void ASTWriter::WriteDeclAbbrevs() {
1779 using namespace llvm;
1781 std::shared_ptr<BitCodeAbbrev> Abv;
1784 Abv = std::make_shared<BitCodeAbbrev>();
1787 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1788 Abv->Add(BitCodeAbbrevOp(0));
1789 Abv->Add(BitCodeAbbrevOp(0));
1790 Abv->Add(BitCodeAbbrevOp(0));
1791 Abv->Add(BitCodeAbbrevOp(0));
1792 Abv->Add(BitCodeAbbrevOp(0));
1793 Abv->Add(BitCodeAbbrevOp(0));
1794 Abv->Add(BitCodeAbbrevOp(0));
1795 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1796 Abv->Add(BitCodeAbbrevOp(0));
1797 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1799 Abv->Add(BitCodeAbbrevOp(0));
1800 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1801 Abv->Add(BitCodeAbbrevOp(0));
1803 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1805 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1806 Abv->Add(BitCodeAbbrevOp(0));
1807 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1809 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1810 Abv->Add(BitCodeAbbrevOp(0));
1812 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1813 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1814 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1817 Abv = std::make_shared<BitCodeAbbrev>();
1820 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1821 Abv->Add(BitCodeAbbrevOp(0));
1822 Abv->Add(BitCodeAbbrevOp(0));
1823 Abv->Add(BitCodeAbbrevOp(0));
1824 Abv->Add(BitCodeAbbrevOp(0));
1825 Abv->Add(BitCodeAbbrevOp(0));
1826 Abv->Add(BitCodeAbbrevOp(0));
1827 Abv->Add(BitCodeAbbrevOp(0));
1828 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1829 Abv->Add(BitCodeAbbrevOp(0));
1830 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1832 Abv->Add(BitCodeAbbrevOp(0));
1833 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1834 Abv->Add(BitCodeAbbrevOp(0));
1836 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1838 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1839 Abv->Add(BitCodeAbbrevOp(0));
1840 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1843 Abv->Add(BitCodeAbbrevOp(0));
1845 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1846 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1848 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1849 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1850 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1853 Abv = std::make_shared<BitCodeAbbrev>();
1856 Abv->Add(BitCodeAbbrevOp(0));
1858 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1859 Abv->Add(BitCodeAbbrevOp(0));
1860 Abv->Add(BitCodeAbbrevOp(0));
1861 Abv->Add(BitCodeAbbrevOp(0));
1862 Abv->Add(BitCodeAbbrevOp(0));
1863 Abv->Add(BitCodeAbbrevOp(0));
1864 Abv->Add(BitCodeAbbrevOp(0));
1865 Abv->Add(BitCodeAbbrevOp(0));
1866 Abv->Add(BitCodeAbbrevOp(
AS_none));
1867 Abv->Add(BitCodeAbbrevOp(0));
1868 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1870 Abv->Add(BitCodeAbbrevOp(0));
1871 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1872 Abv->Add(BitCodeAbbrevOp(0));
1874 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1875 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1877 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1878 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1879 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1880 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1881 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1882 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1883 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1884 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1885 Abv->Add(BitCodeAbbrevOp(0));
1887 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1888 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1889 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1890 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1891 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1892 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1893 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1894 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1895 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
1896 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1898 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1899 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1900 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
1903 Abv = std::make_shared<BitCodeAbbrev>();
1906 Abv->Add(BitCodeAbbrevOp(0));
1908 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1909 Abv->Add(BitCodeAbbrevOp(0));
1910 Abv->Add(BitCodeAbbrevOp(0));
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(
AS_none));
1917 Abv->Add(BitCodeAbbrevOp(0));
1918 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1920 Abv->Add(BitCodeAbbrevOp(0));
1921 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1922 Abv->Add(BitCodeAbbrevOp(0));
1924 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1925 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1927 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1928 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1929 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1930 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1931 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1932 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1933 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1934 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1935 Abv->Add(BitCodeAbbrevOp(0));
1937 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1938 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1939 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1940 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1943 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1945 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1947 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1951 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1954 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1955 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1956 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
1959 Abv = std::make_shared<BitCodeAbbrev>();
1962 Abv->Add(BitCodeAbbrevOp(0));
1964 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1965 Abv->Add(BitCodeAbbrevOp(0));
1966 Abv->Add(BitCodeAbbrevOp(0));
1967 Abv->Add(BitCodeAbbrevOp(0));
1968 Abv->Add(BitCodeAbbrevOp(0));
1969 Abv->Add(BitCodeAbbrevOp(0));
1970 Abv->Add(BitCodeAbbrevOp(0));
1971 Abv->Add(BitCodeAbbrevOp(0));
1972 Abv->Add(BitCodeAbbrevOp(
AS_none));
1973 Abv->Add(BitCodeAbbrevOp(0));
1974 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1976 Abv->Add(BitCodeAbbrevOp(0));
1977 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1978 Abv->Add(BitCodeAbbrevOp(0));
1980 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1982 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1983 Abv->Add(BitCodeAbbrevOp(0));
1984 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1986 Abv->Add(BitCodeAbbrevOp(0));
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));
1994 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1995 Abv->Add(BitCodeAbbrevOp(0));
1996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1997 Abv->Add(BitCodeAbbrevOp(0));
1998 Abv->Add(BitCodeAbbrevOp(0));
1999 Abv->Add(BitCodeAbbrevOp(0));
2000 Abv->Add(BitCodeAbbrevOp(0));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2003 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2004 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2007 Abv = std::make_shared<BitCodeAbbrev>();
2010 Abv->Add(BitCodeAbbrevOp(0));
2012 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2013 Abv->Add(BitCodeAbbrevOp(0));
2014 Abv->Add(BitCodeAbbrevOp(0));
2015 Abv->Add(BitCodeAbbrevOp(0));
2016 Abv->Add(BitCodeAbbrevOp(0));
2017 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2018 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2019 Abv->Add(BitCodeAbbrevOp(0));
2020 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2021 Abv->Add(BitCodeAbbrevOp(0));
2022 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2024 Abv->Add(BitCodeAbbrevOp(0));
2025 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2026 Abv->Add(BitCodeAbbrevOp(0));
2028 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2029 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2031 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2032 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2033 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2036 Abv = std::make_shared<BitCodeAbbrev>();
2039 Abv->Add(BitCodeAbbrevOp(0));
2041 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2042 Abv->Add(BitCodeAbbrevOp(0));
2043 Abv->Add(BitCodeAbbrevOp(0));
2044 Abv->Add(BitCodeAbbrevOp(0));
2045 Abv->Add(BitCodeAbbrevOp(0));
2046 Abv->Add(BitCodeAbbrevOp(0));
2047 Abv->Add(BitCodeAbbrevOp(0));
2048 Abv->Add(BitCodeAbbrevOp(0));
2049 Abv->Add(BitCodeAbbrevOp(
AS_none));
2050 Abv->Add(BitCodeAbbrevOp(0));
2051 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2053 Abv->Add(BitCodeAbbrevOp(0));
2054 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2055 Abv->Add(BitCodeAbbrevOp(0));
2057 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2059 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2060 Abv->Add(BitCodeAbbrevOp(0));
2061 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2063 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2064 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2065 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
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(0));
2073 Abv->Add(BitCodeAbbrevOp(0));
2074 Abv->Add(BitCodeAbbrevOp(0));
2075 Abv->Add(BitCodeAbbrevOp(0));
2076 Abv->Add(BitCodeAbbrevOp(0));
2077 Abv->Add(BitCodeAbbrevOp(0));
2078 Abv->Add(BitCodeAbbrevOp(0));
2079 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2080 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2081 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2083 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2084 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2085 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2088 Abv = std::make_shared<BitCodeAbbrev>();
2091 Abv->Add(BitCodeAbbrevOp(0));
2093 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2094 Abv->Add(BitCodeAbbrevOp(0));
2095 Abv->Add(BitCodeAbbrevOp(0));
2096 Abv->Add(BitCodeAbbrevOp(0));
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(0));
2101 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2102 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2103 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2106 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2107 Abv->Add(BitCodeAbbrevOp(0));
2109 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2111 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2112 Abv->Add(BitCodeAbbrevOp(0));
2113 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2115 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2116 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2117 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2118 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2119 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2120 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2121 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2122 Abv->Add(BitCodeAbbrevOp(0));
2123 Abv->Add(BitCodeAbbrevOp(1));
2124 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2125 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2126 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2127 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2128 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2129 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2130 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2131 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2132 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2133 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2134 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2135 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2136 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2137 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2138 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2147 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2148 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2149 DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2152 Abv = std::make_shared<BitCodeAbbrev>();
2156 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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, 1));
2161 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2162 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2164 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2165 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2166 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2167 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2168 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2170 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2171 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2172 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2175 Abv = std::make_shared<BitCodeAbbrev>();
2179 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2180 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2181 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2182 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2183 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2184 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2185 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2187 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2188 Abv->Add(BitCodeAbbrevOp(32));
2189 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2190 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2193 Abv = std::make_shared<BitCodeAbbrev>();
2197 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2198 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2199 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2200 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2201 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2202 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2203 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2205 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2206 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2207 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2208 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2211 Abv = std::make_shared<BitCodeAbbrev>();
2215 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2216 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2217 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2218 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2219 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2220 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2221 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2223 Abv->Add(BitCodeAbbrevOp(0));
2224 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2225 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2227 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2229 Abv = std::make_shared<BitCodeAbbrev>();
2231 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2232 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2234 Abv = std::make_shared<BitCodeAbbrev>();
2236 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2237 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2253 bool WritingModule) {
2259 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D))
2262 if (WritingModule && (isa<VarDecl>(D) || isa<ImportDecl>(D))) {
2277 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2284 assert(ID >= FirstDeclID &&
"invalid decl ID");
2297 unsigned Index = ID - FirstDeclID;
2298 if (DeclOffsets.size() == Index)
2299 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2300 else if (DeclOffsets.size() < Index) {
2302 DeclOffsets.resize(Index+1);
2303 DeclOffsets[Index].setLocation(Loc);
2304 DeclOffsets[Index].BitOffset =
Offset;
2306 llvm_unreachable(
"declarations should be emitted in ID order");
2311 associateDeclWithFile(D, ID);
2316 EagerlyDeserializedDecls.push_back(ID);
2321 Writer->ClearSwitchCaseIDs();
2324 bool ModulesCodegen =
false;
2332 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2335 if (Writer->Context->getLangOpts().ModulesCodegen) {
2338 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2340 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2345 Record->push_back(ModulesCodegen);
2347 Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2348 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2349 Record->push_back(CD->getNumCtorInitializers());
2350 if (CD->getNumCtorInitializers())
2351 AddCXXCtorInitializers(
2352 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.
Represents 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
void VisitOMPRequiresDecl(OMPRequiresDecl *D)
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.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Defines the SourceManager interface.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
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
Returns the number of captured variables.
An ImplicitCastExpr record.
SourceLocation getBeginLoc() const LLVM_READONLY
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
Whether this function has a written prototype.
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
bool usesSEHTry() const
Indicates the function uses __try.
Declaration of a variable template.
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
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...
bool hasRedeclaration() const
True if redeclared in the same interface.
SourceLocation getEndLoc() const LLVM_READONLY
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.
An OMPRequiresDecl record.
unsigned getIdentifierNamespace() const
Represents a C++ constructor within a class.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
size_t param_size() const
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
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
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.
Represents 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
A TemplateTemplateParmDecl record.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
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.
Represents a struct/union/class.
clauselist_range clauselists()
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
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...
bool doesNotEscape() const
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.
SourceLocation getBeginLoc() const LLVM_READONLY
NameKind getNameKind() const
Determine what kind of name this is.
bool hasSkippedBody() const
True if the function was a definition but its body was skipped.
Represents a member of a struct/union/class.
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.
Expr * getCopyExpr() const
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
SourceLocation getBeginLoc() const LLVM_READONLY
A DecompositionDecl record.
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
Represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
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.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getAtStartLoc() const
ArgPassingKind getArgPassingRestrictions() const
bool isAnonymousStructOrUnion() const
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)
RecordDecl * getMostRecentDecl()
Represents the declaration of a typedef-name via a C++11 alias-declaration.
protocol_loc_range protocol_locs() const
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
Represents a ValueDecl that came out of a declarator.
QualType getPromotionType() const
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)
SourceLocation getEndLoc() const LLVM_READONLY
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)
This represents '#pragma omp requires...' directive.
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)
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
unsigned getFunctionScopeDepth() const
Pepresents a block literal declaration, which is like an unnamed FunctionDecl.
bool isMultiVersion() const
True if this function is considered a multiversioned function.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
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 isDefaulted() const
Whether this function is defaulted per C++0x.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
A ObjCPropertyImplDecl record.
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.
bool isCopyDeductionCandidate() const
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.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
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
bool isExplicitSpecified() const
Whether this function is marked as explicit explicitly.
A CXXDestructorDecl record.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
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
Expr * getInitPriv()
Get Priv variable of the initializer.
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)
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
SourceLocation getBeginLoc() const LLVM_READONLY
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.
This file defines OpenMP AST classes for clauses.
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
CXXMethodDecl * getMostRecentDecl()
PrettyDeclStackTraceEntry - If a crash occurs in the parser while parsing something related to a decl...
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)
bool isNonTrivialToPrimitiveDestroy() const
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.
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.
bool isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C structs.
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
bool isPure() const
Whether this virtual function is pure, i.e.
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.
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.
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.
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.
This is a basic class for representing single OpenMP clause.
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
bool isExplicitlyDefaulted() const
Whether this function is explicitly defaulted per C++0x.
Represents a C++11 static_assert declaration.
bool hasImplicitReturnZero() const
Whether falling off this function implicitly returns null/zero.
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...
bool isTrivialForCall() const
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...
Expr * getInitOrig()
Get Orig variable of the initializer.
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.
void writeClause(OMPClause *C)
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.
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
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)
Represents a field injected from an anonymous union/struct into the parent scope. ...
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
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
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.
bool isNonTrivialToPrimitiveCopy() const
decltype(T::PartialSpecializations) & getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
bool isEscapingByref() const
Indicates the capture is a __block variable that is captured by a block that can potentially escape (...
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
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
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
bool isObjCForDecl() const
Determine whether this variable is a for-loop declaration for a for-in statement in Objective-C...
size_t param_size() const
TypeSourceInfo * getTypeSourceInfo() 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
bool isParamDestroyedInCallee() 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 isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
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
Determines whether this field is mutable (C++ only).
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
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 clauselist_size() const
unsigned protocol_size() const
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
bool blockMissingReturnType() const
Expr * getCombinerIn()
Get In variable of the combiner.
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)
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
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
This represents a decl that may have 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.
Expr * getCombinerOut()
Get Out variable of the combiner.
void VisitObjCMethodDecl(ObjCMethodDecl *D)
bool isFreeStanding() const
True if this tag is free standing, e.g. "struct foo;".
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
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...
QualType getType() const
Return the type wrapped by this type source info.
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...