25 #include "llvm/Bitstream/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(
166 for (
auto typeParam : *typeParams) {
177 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
180 if (R->isFromASTFile())
182 else if (IncludeLocal)
185 for (
const auto &F : Firsts)
190 template <
typename EntryType>
199 return Common->PartialSpecializations;
205 template<
typename DeclTy>
207 auto *Common = D->getCommonPtr();
213 Common->LazySpecializations) {
214 D->LoadLazySpecializations();
215 assert(!Common->LazySpecializations);
219 if (
auto *LS = Common->LazySpecializations)
220 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
223 unsigned I = Record.
size();
229 for (
auto &Entry : Common->Specializations)
230 Specs.push_back(getSpecializationDecl(Entry));
231 for (
auto &Entry : getPartialSpecializations(Common))
232 Specs.push_back(getSpecializationDecl(Entry));
234 for (
auto *D : Specs) {
235 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
236 AddFirstDeclFromEachModule(D,
true);
238 Record.
append(LazySpecializations.begin(), LazySpecializations.end());
241 Record[I] = Record.
size() - I - 1;
247 const Decl *Specialization) {
262 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
275 if (
auto *TInfo = DD->getTypeSourceInfo())
276 Record.AddTypeLoc(TInfo->getTypeLoc());
283 Record.push_back(FD->doesThisDeclarationHaveABody());
284 if (FD->doesThisDeclarationHaveABody())
285 Record.AddFunctionDefinition(FD);
292 VisitDeclContext(DC);
304 Record.AddAttributes(D->
getAttrs());
306 Record.push_back(D->
isUsed(
false));
323 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
324 if (!NS->isFromASTFile())
326 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
327 if (!NS->isInlineNamespace())
335 StringRef Arg = D->
getArg();
336 Record.push_back(Arg.size());
340 Record.AddString(Arg);
348 Record.push_back(Name.size() + 1 + Value.size());
351 Record.AddString(Name);
352 Record.AddString(Value);
357 llvm_unreachable(
"Translation units aren't directly serialized");
364 ? Writer.getAnonymousDeclarationNumber(D)
375 VisitRedeclarable(D);
378 Record.push_back(D->
isModed());
385 VisitTypedefNameDecl(D);
395 AbbrevToUse = Writer.getDeclTypedefAbbrev();
401 VisitTypedefNameDecl(D);
407 VisitRedeclarable(D);
411 if (!isa<CXXRecordDecl>(D))
418 if (D->hasExtInfo()) {
420 Record.AddQualifierInfo(*D->getExtInfo());
423 Record.AddDeclRef(TD);
424 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
440 Record.push_back(D->
isFixed());
444 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
445 Record.push_back(MemberInfo->getTemplateSpecializationKind());
446 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
448 Record.AddDeclRef(
nullptr);
468 AbbrevToUse = Writer.getDeclEnumAbbrev();
503 AbbrevToUse = Writer.getDeclRecordAbbrev();
510 Record.AddTypeRef(D->
getType());
526 Record.push_back(D->hasExtInfo());
527 if (D->hasExtInfo()) {
528 DeclaratorDecl::ExtInfo *Info = D->getExtInfo();
529 Record.AddQualifierInfo(*Info);
530 Record.AddStmt(Info->TrailingRequiresClause);
538 VisitRedeclarable(D);
539 VisitDeclaratorDecl(D);
540 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
549 Record.push_back(D->
isPure());
552 Record.push_back(D->isDeletedBit());
564 Record.AddSourceLocation(D->
getEndLoc());
571 Record.push_back(FDI->getUnqualifiedLookups().size());
573 Record.AddDeclRef(
P.getDecl());
574 Record.push_back(
P.getAccess());
599 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
613 Record.AddTemplateArgumentLoc(
624 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
625 Record.push_back(MemberInfo->getTemplateSpecializationKind());
626 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
659 Record.AddDeclRef(
P);
665 uint64_t
Kind =
static_cast<uint64_t
>(ES.
getKind());
675 VisitFunctionDecl(D);
684 bool HasBodyStuff = D->
getBody() !=
nullptr;
685 Record.push_back(HasBodyStuff);
713 Record.AddSourceLocation(D->
getEndLoc());
716 Record.AddDeclRef(
P);
718 Record.push_back(D->getSelLocsKind());
719 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
721 Record.push_back(NumStoredSelLocs);
722 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
723 Record.AddSourceLocation(SelLocs[i]);
729 VisitTypedefNameDecl(D);
730 Record.push_back(D->Variance);
731 Record.push_back(D->Index);
732 Record.AddSourceLocation(D->VarianceLoc);
733 Record.AddSourceLocation(D->ColonLoc);
746 VisitRedeclarable(D);
747 VisitObjCContainerDecl(D);
749 AddObjCTypeParamList(D->TypeParamList);
754 ObjCInterfaceDecl::DefinitionData &Data = D->data();
758 Record.push_back(Data.HasDesignatedInitializers);
761 Record.push_back(Data.ReferencedProtocols.size());
763 Record.AddDeclRef(
P);
765 Record.AddSourceLocation(PL);
768 Record.push_back(Data.AllReferencedProtocols.size());
770 P = Data.AllReferencedProtocols.begin(),
771 PEnd = Data.AllReferencedProtocols.end();
773 Record.AddDeclRef(*
P);
778 Writer.ObjCClassesWithCategories.insert(D);
781 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
782 (
void)Writer.GetDeclRef(Cat);
805 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
811 VisitRedeclarable(D);
812 VisitObjCContainerDecl(D);
818 Record.AddDeclRef(I);
820 Record.AddSourceLocation(PL);
832 VisitObjCContainerDecl(D);
837 AddObjCTypeParamList(D->TypeParamList);
840 Record.AddDeclRef(I);
842 Record.AddSourceLocation(PL);
854 Record.AddSourceLocation(D->
getAtLoc());
856 Record.AddTypeRef(D->
getType());
874 VisitObjCContainerDecl(D);
880 VisitObjCImplDecl(D);
886 VisitObjCImplDecl(D);
893 Record.push_back(D->NumIvarInitializers);
894 if (D->NumIvarInitializers)
895 Record.AddCXXCtorInitializers(
914 VisitDeclaratorDecl(D);
917 FieldDecl::InitStorageKind ISK = D->InitStorage.getInt();
918 Record.push_back(ISK);
919 if (ISK == FieldDecl::ISK_CapturedVLAType)
944 AbbrevToUse = Writer.getDeclFieldAbbrev();
950 VisitDeclaratorDecl(D);
960 for (
const auto *
P : D->
chain())
961 Record.AddDeclRef(
P);
966 VisitRedeclarable(D);
967 VisitDeclaratorDecl(D);
972 if (!isa<ParmVarDecl>(D)) {
983 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
984 Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
1002 Record.push_back(0);
1013 bool ModulesCodegen =
false;
1015 !isa<VarTemplateSpecializationDecl>(D)) {
1021 (((Writer.WritingModule &&
1023 Writer.Context->getLangOpts().BuildingPCHWithObjectFile) &&
1026 Record.push_back(ModulesCodegen);
1028 Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D));
1032 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1035 Record.push_back(VarTemplate);
1036 Record.AddDeclRef(TemplD);
1039 Record.push_back(StaticDataMemberSpecialization);
1040 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1041 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1042 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1044 Record.push_back(VarNotTemplate);
1069 AbbrevToUse = Writer.getDeclVarAbbrev();
1114 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1118 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1120 &&
"PARM_VAR_DECL can't be demoted definition.");
1121 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1123 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1125 "PARM_VAR_DECL can't be static data member");
1130 Record.push_back(D->
bindings().size());
1134 Record.AddDeclRef(B);
1161 Record.push_back(static_cast<bool>(D->
getValue()));
1173 Record.AddDeclRef(
P);
1181 for (
const auto &capture : D->
captures()) {
1182 Record.AddDeclRef(capture.getVariable());
1185 if (capture.isByRef()) flags |= 1;
1186 if (capture.isNested()) flags |= 2;
1187 if (capture.hasCopyExpr()) flags |= 4;
1188 Record.push_back(flags);
1190 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1200 Record.push_back(CD->
isNothrow() ? 1 : 0);
1203 Record.AddDeclRef(CD->
getParam(I));
1229 VisitRedeclarable(D);
1248 Writer.DeclUpdates[
Parent].push_back(
1255 VisitRedeclarable(D);
1268 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1269 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1276 Record.push_back(D->NumExpansions);
1280 Record.AddDeclRef(E);
1285 VisitRedeclarable(D);
1289 Record.AddDeclRef(D->UsingOrNextShadow);
1296 VisitUsingShadowDecl(D);
1297 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1298 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1299 Record.push_back(D->IsVirtual);
1317 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1335 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1338 Record.push_back(CXXRecTemplate);
1339 Record.AddDeclRef(TemplD);
1342 Record.push_back(CXXRecMemberSpecialization);
1343 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1344 Record.push_back(MSInfo->getTemplateSpecializationKind());
1345 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1347 Record.push_back(CXXRecNotTemplate);
1352 Record.AddCXXDefinitionData(D);
1363 VisitFunctionDecl(D);
1367 Record.AddDeclRef(MD);
1370 Record.push_back(0);
1382 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1388 Record.push_back(D->getTraillingAllocKind());
1391 Record.AddDeclRef(Inherited.getShadowDecl());
1392 Record.AddDeclRef(Inherited.getConstructor());
1395 VisitCXXMethodDecl(D);
1400 VisitCXXMethodDecl(D);
1411 VisitCXXMethodDecl(D);
1419 Record.push_back(!IdentifierLocs.empty());
1420 if (IdentifierLocs.empty()) {
1421 Record.AddSourceLocation(D->
getEndLoc());
1422 Record.push_back(1);
1424 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1425 Record.AddSourceLocation(IdentifierLocs[I]);
1426 Record.push_back(IdentifierLocs.size());
1442 Record.push_back(D->NumTPLists);
1444 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1445 Record.push_back(hasFriendDecl);
1450 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1452 Record.AddDeclRef(D->getNextFriend());
1453 Record.push_back(D->UnsupportedFriend);
1454 Record.AddSourceLocation(D->FriendLoc);
1480 VisitTemplateDecl(D);
1490 VisitRedeclarable(D);
1501 VisitTemplateDecl(D);
1506 VisitRedeclarableTemplateDecl(D);
1509 AddTemplateSpecializations(D);
1517 VisitCXXRecordDecl(D);
1522 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1523 Record.AddDeclRef(InstFromD);
1554 VisitClassTemplateSpecializationDecl(D);
1566 VisitRedeclarableTemplateDecl(D);
1569 AddTemplateSpecializations(D);
1579 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1582 Record.AddDeclRef(InstFromD);
1598 Record.push_back(D->IsCompleteDefinition);
1614 VisitVarTemplateSpecializationDecl(D);
1637 VisitRedeclarableTemplateDecl(D);
1640 AddTemplateSpecializations(D);
1651 Record.push_back(TC !=
nullptr);
1667 Record.push_back(OwnsDefaultArg);
1679 Record.push_back(!!TypeConstraint);
1683 VisitDeclaratorDecl(D);
1688 Record.AddStmt(TypeConstraint);
1702 Record.push_back(OwnsDefaultArg);
1716 VisitTemplateDecl(D);
1731 Record.push_back(OwnsDefaultArg);
1739 VisitRedeclarableTemplateDecl(D);
1754 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(Context, DC));
1755 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(Context, DC));
1759 assert(IsLocalDecl(D) &&
"expected a local declaration");
1762 if (IsLocalDecl(Canon))
1765 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1770 if (IsLocalDecl(Redecl))
1772 return CacheEntry = D;
1775 template <
typename T>
1778 T *MostRecent = First->getMostRecentDecl();
1779 T *DAsT =
static_cast<T *
>(D);
1780 if (MostRecent != First) {
1782 "Not considered redeclarable?");
1784 Record.AddDeclRef(First);
1788 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1789 if (DAsT == FirstLocal) {
1793 unsigned I = Record.size();
1794 Record.push_back(0);
1796 AddFirstDeclFromEachModule(DAsT,
false);
1798 Record[I] = Record.size() - I;
1806 if (!Prev->isFromASTFile())
1811 if (LocalRedecls.empty())
1812 Record.push_back(0);
1816 Record.push_back(0);
1817 Record.AddDeclRef(FirstLocal);
1827 (void)Writer.GetDeclRef(MostRecent);
1830 Record.push_back(0);
1849 Record.writeOMPClause(C);
1857 Record.writeOMPClause(C);
1883 Record.writeOMPClause(C);
1896 void ASTWriter::WriteDeclAbbrevs() {
1897 using namespace llvm;
1899 std::shared_ptr<BitCodeAbbrev> Abv;
1902 Abv = std::make_shared<BitCodeAbbrev>();
1905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1906 Abv->Add(BitCodeAbbrevOp(0));
1907 Abv->Add(BitCodeAbbrevOp(0));
1908 Abv->Add(BitCodeAbbrevOp(0));
1909 Abv->Add(BitCodeAbbrevOp(0));
1910 Abv->Add(BitCodeAbbrevOp(0));
1911 Abv->Add(BitCodeAbbrevOp(0));
1912 Abv->Add(BitCodeAbbrevOp(0));
1913 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1914 Abv->Add(BitCodeAbbrevOp(0));
1915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1917 Abv->Add(BitCodeAbbrevOp(0));
1918 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1919 Abv->Add(BitCodeAbbrevOp(0));
1921 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1923 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1924 Abv->Add(BitCodeAbbrevOp(0));
1925 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1927 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1928 Abv->Add(BitCodeAbbrevOp(0));
1930 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1931 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1932 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1935 Abv = std::make_shared<BitCodeAbbrev>();
1938 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1939 Abv->Add(BitCodeAbbrevOp(0));
1940 Abv->Add(BitCodeAbbrevOp(0));
1941 Abv->Add(BitCodeAbbrevOp(0));
1942 Abv->Add(BitCodeAbbrevOp(0));
1943 Abv->Add(BitCodeAbbrevOp(0));
1944 Abv->Add(BitCodeAbbrevOp(0));
1945 Abv->Add(BitCodeAbbrevOp(0));
1946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1947 Abv->Add(BitCodeAbbrevOp(0));
1948 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1950 Abv->Add(BitCodeAbbrevOp(0));
1951 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1952 Abv->Add(BitCodeAbbrevOp(0));
1954 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1956 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1957 Abv->Add(BitCodeAbbrevOp(0));
1958 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1960 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1961 Abv->Add(BitCodeAbbrevOp(0));
1963 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1964 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1966 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1967 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1968 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1971 Abv = std::make_shared<BitCodeAbbrev>();
1974 Abv->Add(BitCodeAbbrevOp(0));
1976 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1977 Abv->Add(BitCodeAbbrevOp(0));
1978 Abv->Add(BitCodeAbbrevOp(0));
1979 Abv->Add(BitCodeAbbrevOp(0));
1980 Abv->Add(BitCodeAbbrevOp(0));
1981 Abv->Add(BitCodeAbbrevOp(0));
1982 Abv->Add(BitCodeAbbrevOp(0));
1983 Abv->Add(BitCodeAbbrevOp(0));
1984 Abv->Add(BitCodeAbbrevOp(
AS_none));
1985 Abv->Add(BitCodeAbbrevOp(0));
1986 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1988 Abv->Add(BitCodeAbbrevOp(0));
1989 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1990 Abv->Add(BitCodeAbbrevOp(0));
1992 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1993 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1995 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1997 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1998 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2000 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2001 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2003 Abv->Add(BitCodeAbbrevOp(0));
2005 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2006 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2007 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2008 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2009 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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, 32));
2014 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2016 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2017 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2018 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2021 Abv = std::make_shared<BitCodeAbbrev>();
2024 Abv->Add(BitCodeAbbrevOp(0));
2026 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2027 Abv->Add(BitCodeAbbrevOp(0));
2028 Abv->Add(BitCodeAbbrevOp(0));
2029 Abv->Add(BitCodeAbbrevOp(0));
2030 Abv->Add(BitCodeAbbrevOp(0));
2031 Abv->Add(BitCodeAbbrevOp(0));
2032 Abv->Add(BitCodeAbbrevOp(0));
2033 Abv->Add(BitCodeAbbrevOp(0));
2034 Abv->Add(BitCodeAbbrevOp(
AS_none));
2035 Abv->Add(BitCodeAbbrevOp(0));
2036 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2038 Abv->Add(BitCodeAbbrevOp(0));
2039 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2040 Abv->Add(BitCodeAbbrevOp(0));
2042 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2043 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2045 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2046 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2047 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2048 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2049 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2050 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2051 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2052 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2053 Abv->Add(BitCodeAbbrevOp(0));
2055 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2056 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2057 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2058 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2061 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2063 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2065 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2067 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2069 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2071 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2073 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2075 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2078 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2079 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2080 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2083 Abv = std::make_shared<BitCodeAbbrev>();
2086 Abv->Add(BitCodeAbbrevOp(0));
2088 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2089 Abv->Add(BitCodeAbbrevOp(0));
2090 Abv->Add(BitCodeAbbrevOp(0));
2091 Abv->Add(BitCodeAbbrevOp(0));
2092 Abv->Add(BitCodeAbbrevOp(0));
2093 Abv->Add(BitCodeAbbrevOp(0));
2094 Abv->Add(BitCodeAbbrevOp(0));
2095 Abv->Add(BitCodeAbbrevOp(0));
2096 Abv->Add(BitCodeAbbrevOp(
AS_none));
2097 Abv->Add(BitCodeAbbrevOp(0));
2098 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2100 Abv->Add(BitCodeAbbrevOp(0));
2101 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2102 Abv->Add(BitCodeAbbrevOp(0));
2104 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2106 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2107 Abv->Add(BitCodeAbbrevOp(0));
2108 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2110 Abv->Add(BitCodeAbbrevOp(0));
2111 Abv->Add(BitCodeAbbrevOp(0));
2112 Abv->Add(BitCodeAbbrevOp(0));
2113 Abv->Add(BitCodeAbbrevOp(0));
2114 Abv->Add(BitCodeAbbrevOp(0));
2115 Abv->Add(BitCodeAbbrevOp(0));
2116 Abv->Add(BitCodeAbbrevOp(0));
2118 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2119 Abv->Add(BitCodeAbbrevOp(0));
2120 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2121 Abv->Add(BitCodeAbbrevOp(0));
2122 Abv->Add(BitCodeAbbrevOp(0));
2123 Abv->Add(BitCodeAbbrevOp(0));
2124 Abv->Add(BitCodeAbbrevOp(0));
2126 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2127 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2128 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2131 Abv = std::make_shared<BitCodeAbbrev>();
2134 Abv->Add(BitCodeAbbrevOp(0));
2136 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2137 Abv->Add(BitCodeAbbrevOp(0));
2138 Abv->Add(BitCodeAbbrevOp(0));
2139 Abv->Add(BitCodeAbbrevOp(0));
2140 Abv->Add(BitCodeAbbrevOp(0));
2141 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2142 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2143 Abv->Add(BitCodeAbbrevOp(0));
2144 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2145 Abv->Add(BitCodeAbbrevOp(0));
2146 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2148 Abv->Add(BitCodeAbbrevOp(0));
2149 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2150 Abv->Add(BitCodeAbbrevOp(0));
2152 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2153 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2155 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2156 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2157 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2160 Abv = std::make_shared<BitCodeAbbrev>();
2163 Abv->Add(BitCodeAbbrevOp(0));
2165 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2166 Abv->Add(BitCodeAbbrevOp(0));
2167 Abv->Add(BitCodeAbbrevOp(0));
2168 Abv->Add(BitCodeAbbrevOp(0));
2169 Abv->Add(BitCodeAbbrevOp(0));
2170 Abv->Add(BitCodeAbbrevOp(0));
2171 Abv->Add(BitCodeAbbrevOp(0));
2172 Abv->Add(BitCodeAbbrevOp(0));
2173 Abv->Add(BitCodeAbbrevOp(
AS_none));
2174 Abv->Add(BitCodeAbbrevOp(0));
2175 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2177 Abv->Add(BitCodeAbbrevOp(0));
2178 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2179 Abv->Add(BitCodeAbbrevOp(0));
2181 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2183 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2184 Abv->Add(BitCodeAbbrevOp(0));
2185 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2187 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2188 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2189 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2190 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2191 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2192 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2193 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2194 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2195 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2196 Abv->Add(BitCodeAbbrevOp(0));
2197 Abv->Add(BitCodeAbbrevOp(0));
2198 Abv->Add(BitCodeAbbrevOp(0));
2199 Abv->Add(BitCodeAbbrevOp(0));
2200 Abv->Add(BitCodeAbbrevOp(0));
2201 Abv->Add(BitCodeAbbrevOp(0));
2202 Abv->Add(BitCodeAbbrevOp(0));
2203 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2204 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2205 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2207 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2208 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2209 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2212 Abv = std::make_shared<BitCodeAbbrev>();
2215 Abv->Add(BitCodeAbbrevOp(0));
2217 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2218 Abv->Add(BitCodeAbbrevOp(0));
2219 Abv->Add(BitCodeAbbrevOp(0));
2220 Abv->Add(BitCodeAbbrevOp(0));
2221 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2222 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2223 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2224 Abv->Add(BitCodeAbbrevOp(0));
2225 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2226 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2227 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2230 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2231 Abv->Add(BitCodeAbbrevOp(0));
2233 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2235 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2236 Abv->Add(BitCodeAbbrevOp(0));
2237 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2239 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2240 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2241 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2242 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2243 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2244 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2245 Abv->Add(BitCodeAbbrevOp(0));
2246 Abv->Add(BitCodeAbbrevOp(1));
2247 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2248 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2249 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2250 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2251 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2252 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2253 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2254 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2255 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2256 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2257 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2258 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2259 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2260 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2261 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2270 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2271 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2272 DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2275 Abv = std::make_shared<BitCodeAbbrev>();
2278 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2280 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2281 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2282 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2283 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2284 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2285 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2286 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2288 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2289 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2290 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2291 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2292 Abv->Add(BitCodeAbbrevOp(0));
2293 Abv->Add(BitCodeAbbrevOp(0));
2294 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2295 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2296 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2299 Abv = std::make_shared<BitCodeAbbrev>();
2302 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2304 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2305 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2306 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2307 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2308 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2309 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2310 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2312 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2313 Abv->Add(BitCodeAbbrevOp(32));
2314 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2315 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2318 Abv = std::make_shared<BitCodeAbbrev>();
2321 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2323 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2324 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2325 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2326 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2327 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2328 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2329 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2331 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2332 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2333 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2334 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2337 Abv = std::make_shared<BitCodeAbbrev>();
2340 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2342 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2343 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2344 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2345 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2346 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2347 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2348 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2350 Abv->Add(BitCodeAbbrevOp(0));
2351 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2352 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2354 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2356 Abv = std::make_shared<BitCodeAbbrev>();
2358 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2359 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2361 Abv = std::make_shared<BitCodeAbbrev>();
2363 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2364 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2380 bool WritingModule) {
2386 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D))
2404 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2411 assert(ID >= FirstDeclID &&
"invalid decl ID");
2424 unsigned Index = ID - FirstDeclID;
2425 if (DeclOffsets.size() == Index)
2426 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2427 else if (DeclOffsets.size() < Index) {
2429 DeclOffsets.resize(Index+1);
2430 DeclOffsets[Index].setLocation(Loc);
2431 DeclOffsets[Index].BitOffset =
Offset;
2433 llvm_unreachable(
"declarations should be emitted in ID order");
2438 associateDeclWithFile(D, ID);
2443 EagerlyDeserializedDecls.push_back(ID);
2448 Writer->ClearSwitchCaseIDs();
2451 bool ModulesCodegen =
false;
2454 if ((Writer->WritingModule &&
2456 Writer->Context->getLangOpts().BuildingPCHWithObjectFile) {
2461 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2464 if (Writer->Context->getLangOpts().ModulesCodegen) {
2467 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2469 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2475 Record->push_back(ModulesCodegen);
2477 Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2478 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2479 Record->push_back(CD->getNumCtorInitializers());
2480 if (CD->getNumCtorInitializers())
2481 AddCXXCtorInitializers(
2482 llvm::makeArrayRef(CD->init_begin(), CD->init_end()));
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
clauselist_range clauselists()
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint, that is - the constraint expression that is added to the associated constraints of the enclosing declaration in practice.
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.
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name...
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)
unsigned llvm::PointerUnion< const Decl *, const Expr * > DeclTy
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.
MemberSpecializationInfo * getMemberSpecializationInfo() const
Get the specialization info if this function template specialization is also a member specialization:...
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
void VisitExportDecl(ExportDecl *D)
bool isMemberSpecialization()
Determines whether this class template partial specialization template was a specialization of a memb...
Expr * getBitWidth() const
This represents '#pragma omp allocate ...' directive.
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.
unsigned clauselist_size() const
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.
ExplicitSpecifier getExplicitSpecifier()
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...
ExplicitSpecKind getKind() const
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 * getCopyExpr() const
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
Store information needed for an explicit specifier.
void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D)
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
void VisitConceptDecl(ConceptDecl *D)
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
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
ValueDecl * getExtendingDecl()
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.
ConstexprSpecKind getConstexprKind() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isExpandedParameterPack() const
Whether this parameter is a template type parameter pack that has a known list of different type-cons...
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
ObjCMethodDecl * getSetterMethodDecl() const
bool usesFPIntrin() const
Indicates the function uses Floating Point constrained intrinsics.
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 ...
Expr * getMapperVarRef()
Get the variable declared in the mapper.
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.
A RequiresExprBodyDecl record.
bool hasNonTrivialToPrimitiveCopyCUnion() const
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)
ObjCMethodDecl * getGetterMethodDecl() const
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.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (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...
ConceptDecl * getNamedConcept() const
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.
bool isPartOfPerModuleInitializer(const Decl *D)
Determine whether the given declaration will be included in the per-module initializer if it needs to...
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.
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
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].
DefaultedFunctionInfo * getDefaultedFunctionInfo() const
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)
unsigned varlist_size() const
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.
ExplicitSpecifier getExplicitSpecifier()
A CXXDeductionGuideDecl record.
DeclarationName getVarName()
Get the name of the variable declared in the mapper.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
SourceLocation getEndLoc() const LLVM_READONLY
unsigned getNumExpansionParameters() const
Retrieves the number of parameters in an expanded parameter pack.
bool canAvoidCopyToHeap() const
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
Represents 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 ...
This represents one expression.
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
Represents the body of a requires-expression.
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
Expr * getPlaceholderTypeConstraint() const
Return the constraint introduced by the placeholder type of this non-type template parameter (if any)...
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.
const Expr * getExpr() const
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.
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack...
const DeclarationNameInfo & getConceptNameInfo() const
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.
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
bool isInstanceMethod() const
clauselist_range clauselists()
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.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
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)
An LifetimeExtendedTemporaryDecl record.
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 hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
bool isSynthesizedAccessorStub() const
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
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.
bool hasTypeConstraint() const
Determine whether this template parameter has a type-constraint.
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.
APValue * getValue() const
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.
An OMPDeclareMapperDecl record.
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 hasNonTrivialToPrimitiveDestructCUnion() 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
An OMPAllocateDcl record.
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.
A POD class for pairing a NamedDecl* with an access specifier.
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.
unsigned getManglingNumber() const
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...
bool hasExplicitTemplateArgs() const
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 HasConstantDestruction
Whether this variable is known to have constant destruction.
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.
const NestedNameSpecifierLoc & getNestedNameSpecifierLoc() const
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
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...
ExplicitSpecifier getExplicitSpecifier()
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.
unsigned clauselist_size() const
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)...
static void addExplicitSpecifier(ExplicitSpecifier ES, ASTRecordWriter &Record)
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
This represents '#pragma omp declare mapper ...' directive.
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
unsigned clauselist_size() const
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
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...
void VisitOMPAllocateDecl(OMPAllocateDecl *D)
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.
Expr * getConstraintExpr() const
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.
EvaluatedStmt * ensureEvaluatedStmt() const
Convert the initializer for this declaration to the elaborated EvaluatedStmt form, which contains extra information on the evaluated value of the initializer.
This is a C++ Modules TS module interface unit.
void VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D)
void VisitRequiresExprBodyDecl(RequiresExprBodyDecl *D)