24 #include "llvm/Bitstream/BitstreamWriter.h" 25 #include "llvm/Support/ErrorHandling.h" 26 using namespace clang;
27 using namespace serialization;
45 : Writer(Writer), Context(Context), Record(Writer, Record),
46 Code((serialization::
DeclCode)0), AbbrevToUse(0) {}
50 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
52 return Record.
Emit(Code, AbbrevToUse);
57 void VisitDecl(
Decl *D);
75 void VisitClassTemplateSpecializationDecl(
77 void VisitClassTemplatePartialSpecializationDecl(
80 void VisitVarTemplatePartialSpecializationDecl(
82 void VisitClassScopeFunctionSpecializationDecl(
163 for (
auto typeParam : *typeParams) {
174 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
177 if (R->isFromASTFile())
179 else if (IncludeLocal)
182 for (
const auto &F : Firsts)
187 template <
typename EntryType>
196 return Common->PartialSpecializations;
202 template<
typename DeclTy>
204 auto *Common = D->getCommonPtr();
210 Common->LazySpecializations) {
211 D->LoadLazySpecializations();
212 assert(!Common->LazySpecializations);
216 if (
auto *LS = Common->LazySpecializations)
217 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
220 unsigned I = Record.
size();
226 for (
auto &Entry : Common->Specializations)
227 Specs.push_back(getSpecializationDecl(Entry));
228 for (
auto &Entry : getPartialSpecializations(Common))
229 Specs.push_back(getSpecializationDecl(Entry));
231 for (
auto *D : Specs) {
232 assert(D->isCanonicalDecl() &&
"non-canonical decl in set");
233 AddFirstDeclFromEachModule(D,
true);
235 Record.
append(LazySpecializations.begin(), LazySpecializations.end());
238 Record[I] = Record.
size() - I - 1;
244 const Decl *Specialization) {
259 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
272 if (
auto *TInfo = DD->getTypeSourceInfo())
273 Record.AddTypeLoc(TInfo->getTypeLoc());
280 Record.push_back(FD->doesThisDeclarationHaveABody());
281 if (FD->doesThisDeclarationHaveABody())
282 Record.AddFunctionDefinition(FD);
289 VisitDeclContext(DC);
301 Record.AddAttributes(D->
getAttrs());
303 Record.push_back(D->
isUsed(
false));
320 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
321 if (!NS->isFromASTFile())
323 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
324 if (!NS->isInlineNamespace())
332 StringRef Arg = D->
getArg();
333 Record.push_back(Arg.size());
337 Record.AddString(Arg);
345 Record.push_back(Name.size() + 1 + Value.size());
348 Record.AddString(Name);
349 Record.AddString(Value);
354 llvm_unreachable(
"Translation units aren't directly serialized");
361 ? Writer.getAnonymousDeclarationNumber(D)
372 VisitRedeclarable(D);
375 Record.push_back(D->
isModed());
382 VisitTypedefNameDecl(D);
392 AbbrevToUse = Writer.getDeclTypedefAbbrev();
398 VisitTypedefNameDecl(D);
404 VisitRedeclarable(D);
408 if (!isa<CXXRecordDecl>(D))
415 if (D->hasExtInfo()) {
417 Record.AddQualifierInfo(*D->getExtInfo());
420 Record.AddDeclRef(TD);
421 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
437 Record.push_back(D->
isFixed());
441 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
442 Record.push_back(MemberInfo->getTemplateSpecializationKind());
443 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
445 Record.AddDeclRef(
nullptr);
465 AbbrevToUse = Writer.getDeclEnumAbbrev();
500 AbbrevToUse = Writer.getDeclRecordAbbrev();
507 Record.AddTypeRef(D->
getType());
523 Record.push_back(D->hasExtInfo());
525 Record.AddQualifierInfo(*D->getExtInfo());
532 VisitRedeclarable(D);
533 VisitDeclaratorDecl(D);
534 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
543 Record.push_back(D->
isPure());
546 Record.push_back(D->isDeletedBit());
558 Record.AddSourceLocation(D->
getEndLoc());
580 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
594 Record.AddTemplateArgumentLoc(
605 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
606 Record.push_back(MemberInfo->getTemplateSpecializationKind());
607 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
640 Record.AddDeclRef(
P);
646 uint64_t
Kind =
static_cast<uint64_t
>(ES.
getKind());
656 VisitFunctionDecl(D);
665 bool HasBodyStuff = D->
getBody() !=
nullptr ||
667 Record.push_back(HasBodyStuff);
694 Record.AddSourceLocation(D->
getEndLoc());
697 Record.AddDeclRef(
P);
699 Record.push_back(D->getSelLocsKind());
700 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
702 Record.push_back(NumStoredSelLocs);
703 for (
unsigned i = 0;
i != NumStoredSelLocs; ++
i)
704 Record.AddSourceLocation(SelLocs[
i]);
710 VisitTypedefNameDecl(D);
711 Record.push_back(D->Variance);
712 Record.push_back(D->Index);
713 Record.AddSourceLocation(D->VarianceLoc);
714 Record.AddSourceLocation(D->ColonLoc);
727 VisitRedeclarable(D);
728 VisitObjCContainerDecl(D);
730 AddObjCTypeParamList(D->TypeParamList);
735 ObjCInterfaceDecl::DefinitionData &Data = D->data();
739 Record.push_back(Data.HasDesignatedInitializers);
742 Record.push_back(Data.ReferencedProtocols.size());
744 Record.AddDeclRef(
P);
746 Record.AddSourceLocation(PL);
749 Record.push_back(Data.AllReferencedProtocols.size());
751 P = Data.AllReferencedProtocols.begin(),
752 PEnd = Data.AllReferencedProtocols.end();
754 Record.AddDeclRef(*
P);
759 Writer.ObjCClassesWithCategories.insert(D);
762 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
763 (
void)Writer.GetDeclRef(Cat);
786 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
792 VisitRedeclarable(D);
793 VisitObjCContainerDecl(D);
799 Record.AddDeclRef(I);
801 Record.AddSourceLocation(PL);
813 VisitObjCContainerDecl(D);
818 AddObjCTypeParamList(D->TypeParamList);
821 Record.AddDeclRef(I);
823 Record.AddSourceLocation(PL);
835 Record.AddSourceLocation(D->
getAtLoc());
837 Record.AddTypeRef(D->
getType());
855 VisitObjCContainerDecl(D);
861 VisitObjCImplDecl(D);
867 VisitObjCImplDecl(D);
874 Record.push_back(D->NumIvarInitializers);
875 if (D->NumIvarInitializers)
876 Record.AddCXXCtorInitializers(
893 VisitDeclaratorDecl(D);
896 FieldDecl::InitStorageKind ISK = D->InitStorage.getInt();
897 Record.push_back(ISK);
898 if (ISK == FieldDecl::ISK_CapturedVLAType)
923 AbbrevToUse = Writer.getDeclFieldAbbrev();
929 VisitDeclaratorDecl(D);
939 for (
const auto *
P : D->
chain())
940 Record.AddDeclRef(
P);
945 VisitRedeclarable(D);
946 VisitDeclaratorDecl(D);
951 if (!isa<ParmVarDecl>(D)) {
962 if (
const auto *IPD = dyn_cast<ImplicitParamDecl>(D))
963 Record.push_back(static_cast<unsigned>(IPD->getParameterKind()));
985 bool ModulesCodegen =
false;
986 if (Writer.WritingModule &&
988 !isa<VarTemplateSpecializationDecl>(D)) {
997 Record.push_back(ModulesCodegen);
999 Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D));
1003 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1006 Record.push_back(VarTemplate);
1007 Record.AddDeclRef(TemplD);
1010 Record.push_back(StaticDataMemberSpecialization);
1011 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1012 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1013 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1015 Record.push_back(VarNotTemplate);
1040 AbbrevToUse = Writer.getDeclVarAbbrev();
1085 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1089 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
1091 &&
"PARM_VAR_DECL can't be demoted definition.");
1092 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
1094 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
1096 "PARM_VAR_DECL can't be static data member");
1101 Record.push_back(D->
bindings().size());
1105 Record.AddDeclRef(B);
1133 Record.AddDeclRef(
P);
1141 for (
const auto &capture : D->
captures()) {
1142 Record.AddDeclRef(capture.getVariable());
1145 if (capture.isByRef()) flags |= 1;
1146 if (capture.isNested()) flags |= 2;
1147 if (capture.hasCopyExpr()) flags |= 4;
1148 Record.push_back(flags);
1150 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1160 Record.push_back(CD->
isNothrow() ? 1 : 0);
1163 Record.AddDeclRef(CD->
getParam(I));
1189 VisitRedeclarable(D);
1208 Writer.DeclUpdates[
Parent].push_back(
1215 VisitRedeclarable(D);
1228 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1229 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1236 Record.push_back(D->NumExpansions);
1240 Record.AddDeclRef(E);
1245 VisitRedeclarable(D);
1249 Record.AddDeclRef(D->UsingOrNextShadow);
1256 VisitUsingShadowDecl(D);
1257 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1258 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1259 Record.push_back(D->IsVirtual);
1277 Record.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName());
1295 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1298 Record.push_back(CXXRecTemplate);
1299 Record.AddDeclRef(TemplD);
1302 Record.push_back(CXXRecMemberSpecialization);
1303 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1304 Record.push_back(MSInfo->getTemplateSpecializationKind());
1305 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1307 Record.push_back(CXXRecNotTemplate);
1312 Record.AddCXXDefinitionData(D);
1323 VisitFunctionDecl(D);
1327 Record.AddDeclRef(MD);
1330 Record.push_back(0);
1342 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1348 Record.push_back(D->getTraillingAllocKind());
1351 Record.AddDeclRef(Inherited.getShadowDecl());
1352 Record.AddDeclRef(Inherited.getConstructor());
1355 VisitCXXMethodDecl(D);
1360 VisitCXXMethodDecl(D);
1371 VisitCXXMethodDecl(D);
1379 Record.push_back(!IdentifierLocs.empty());
1380 if (IdentifierLocs.empty()) {
1381 Record.AddSourceLocation(D->
getEndLoc());
1382 Record.push_back(1);
1384 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1385 Record.AddSourceLocation(IdentifierLocs[I]);
1386 Record.push_back(IdentifierLocs.size());
1402 Record.push_back(D->NumTPLists);
1404 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1405 Record.push_back(hasFriendDecl);
1410 for (
unsigned i = 0;
i < D->NumTPLists; ++
i)
1412 Record.AddDeclRef(D->getNextFriend());
1413 Record.push_back(D->UnsupportedFriend);
1414 Record.AddSourceLocation(D->FriendLoc);
1440 VisitTemplateDecl(D);
1446 VisitRedeclarable(D);
1457 VisitTemplateDecl(D);
1462 VisitRedeclarableTemplateDecl(D);
1465 AddTemplateSpecializations(D);
1473 VisitCXXRecordDecl(D);
1478 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1479 Record.AddDeclRef(InstFromD);
1507 VisitClassTemplateSpecializationDecl(D);
1522 VisitRedeclarableTemplateDecl(D);
1525 AddTemplateSpecializations(D);
1535 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1538 Record.AddDeclRef(InstFromD);
1554 Record.push_back(D->IsCompleteDefinition);
1567 VisitVarTemplateSpecializationDecl(D);
1593 VisitRedeclarableTemplateDecl(D);
1596 AddTemplateSpecializations(D);
1607 Record.push_back(OwnsDefaultArg);
1621 VisitDeclaratorDecl(D);
1638 Record.push_back(OwnsDefaultArg);
1652 VisitTemplateDecl(D);
1667 Record.push_back(OwnsDefaultArg);
1675 VisitRedeclarableTemplateDecl(D);
1690 Record.AddOffset(Writer.WriteDeclContextLexicalBlock(Context, DC));
1691 Record.AddOffset(Writer.WriteDeclContextVisibleBlock(Context, DC));
1695 assert(IsLocalDecl(D) &&
"expected a local declaration");
1698 if (IsLocalDecl(Canon))
1701 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1706 if (IsLocalDecl(Redecl))
1708 return CacheEntry = D;
1711 template <
typename T>
1714 T *MostRecent = First->getMostRecentDecl();
1715 T *DAsT =
static_cast<T *
>(D);
1716 if (MostRecent != First) {
1718 "Not considered redeclarable?");
1720 Record.AddDeclRef(First);
1724 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1725 if (DAsT == FirstLocal) {
1729 unsigned I = Record.size();
1730 Record.push_back(0);
1732 AddFirstDeclFromEachModule(DAsT,
false);
1734 Record[I] = Record.size() - I;
1742 if (!Prev->isFromASTFile())
1747 if (LocalRedecls.empty())
1748 Record.push_back(0);
1752 Record.push_back(0);
1753 Record.AddDeclRef(FirstLocal);
1763 (void)Writer.GetDeclRef(MostRecent);
1766 Record.push_back(0);
1835 void ASTWriter::WriteDeclAbbrevs() {
1836 using namespace llvm;
1838 std::shared_ptr<BitCodeAbbrev> Abv;
1841 Abv = std::make_shared<BitCodeAbbrev>();
1844 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1845 Abv->Add(BitCodeAbbrevOp(0));
1846 Abv->Add(BitCodeAbbrevOp(0));
1847 Abv->Add(BitCodeAbbrevOp(0));
1848 Abv->Add(BitCodeAbbrevOp(0));
1849 Abv->Add(BitCodeAbbrevOp(0));
1850 Abv->Add(BitCodeAbbrevOp(0));
1851 Abv->Add(BitCodeAbbrevOp(0));
1852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1853 Abv->Add(BitCodeAbbrevOp(0));
1854 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1856 Abv->Add(BitCodeAbbrevOp(0));
1857 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1858 Abv->Add(BitCodeAbbrevOp(0));
1860 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1862 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1863 Abv->Add(BitCodeAbbrevOp(0));
1864 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1867 Abv->Add(BitCodeAbbrevOp(0));
1869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1870 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1871 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
1874 Abv = std::make_shared<BitCodeAbbrev>();
1877 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1878 Abv->Add(BitCodeAbbrevOp(0));
1879 Abv->Add(BitCodeAbbrevOp(0));
1880 Abv->Add(BitCodeAbbrevOp(0));
1881 Abv->Add(BitCodeAbbrevOp(0));
1882 Abv->Add(BitCodeAbbrevOp(0));
1883 Abv->Add(BitCodeAbbrevOp(0));
1884 Abv->Add(BitCodeAbbrevOp(0));
1885 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1886 Abv->Add(BitCodeAbbrevOp(0));
1887 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1889 Abv->Add(BitCodeAbbrevOp(0));
1890 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1891 Abv->Add(BitCodeAbbrevOp(0));
1893 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1895 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1896 Abv->Add(BitCodeAbbrevOp(0));
1897 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1899 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1900 Abv->Add(BitCodeAbbrevOp(0));
1902 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1903 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1907 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
1910 Abv = std::make_shared<BitCodeAbbrev>();
1913 Abv->Add(BitCodeAbbrevOp(0));
1915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1916 Abv->Add(BitCodeAbbrevOp(0));
1917 Abv->Add(BitCodeAbbrevOp(0));
1918 Abv->Add(BitCodeAbbrevOp(0));
1919 Abv->Add(BitCodeAbbrevOp(0));
1920 Abv->Add(BitCodeAbbrevOp(0));
1921 Abv->Add(BitCodeAbbrevOp(0));
1922 Abv->Add(BitCodeAbbrevOp(0));
1923 Abv->Add(BitCodeAbbrevOp(
AS_none));
1924 Abv->Add(BitCodeAbbrevOp(0));
1925 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1927 Abv->Add(BitCodeAbbrevOp(0));
1928 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1929 Abv->Add(BitCodeAbbrevOp(0));
1931 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1932 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1934 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1935 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1936 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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::VBR, 6));
1941 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1942 Abv->Add(BitCodeAbbrevOp(0));
1944 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1945 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1947 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1948 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1951 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
1953 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1955 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1956 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1957 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
1960 Abv = std::make_shared<BitCodeAbbrev>();
1963 Abv->Add(BitCodeAbbrevOp(0));
1965 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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(0));
1973 Abv->Add(BitCodeAbbrevOp(
AS_none));
1974 Abv->Add(BitCodeAbbrevOp(0));
1975 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1977 Abv->Add(BitCodeAbbrevOp(0));
1978 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1979 Abv->Add(BitCodeAbbrevOp(0));
1981 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1982 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1984 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1985 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1986 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1987 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1988 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1989 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1990 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1991 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1992 Abv->Add(BitCodeAbbrevOp(0));
1994 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1995 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1997 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2000 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2002 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2004 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2006 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2008 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2010 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2012 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2014 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2017 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2018 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2019 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2022 Abv = std::make_shared<BitCodeAbbrev>();
2025 Abv->Add(BitCodeAbbrevOp(0));
2027 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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(0));
2035 Abv->Add(BitCodeAbbrevOp(
AS_none));
2036 Abv->Add(BitCodeAbbrevOp(0));
2037 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2039 Abv->Add(BitCodeAbbrevOp(0));
2040 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2041 Abv->Add(BitCodeAbbrevOp(0));
2043 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2045 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2046 Abv->Add(BitCodeAbbrevOp(0));
2047 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2049 Abv->Add(BitCodeAbbrevOp(0));
2050 Abv->Add(BitCodeAbbrevOp(0));
2051 Abv->Add(BitCodeAbbrevOp(0));
2052 Abv->Add(BitCodeAbbrevOp(0));
2053 Abv->Add(BitCodeAbbrevOp(0));
2054 Abv->Add(BitCodeAbbrevOp(0));
2055 Abv->Add(BitCodeAbbrevOp(0));
2057 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2058 Abv->Add(BitCodeAbbrevOp(0));
2059 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2060 Abv->Add(BitCodeAbbrevOp(0));
2061 Abv->Add(BitCodeAbbrevOp(0));
2062 Abv->Add(BitCodeAbbrevOp(0));
2063 Abv->Add(BitCodeAbbrevOp(0));
2065 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2066 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2067 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2070 Abv = std::make_shared<BitCodeAbbrev>();
2073 Abv->Add(BitCodeAbbrevOp(0));
2075 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2076 Abv->Add(BitCodeAbbrevOp(0));
2077 Abv->Add(BitCodeAbbrevOp(0));
2078 Abv->Add(BitCodeAbbrevOp(0));
2079 Abv->Add(BitCodeAbbrevOp(0));
2080 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2081 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2082 Abv->Add(BitCodeAbbrevOp(0));
2083 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2084 Abv->Add(BitCodeAbbrevOp(0));
2085 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2087 Abv->Add(BitCodeAbbrevOp(0));
2088 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2089 Abv->Add(BitCodeAbbrevOp(0));
2091 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2092 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2094 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2095 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2096 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2099 Abv = std::make_shared<BitCodeAbbrev>();
2102 Abv->Add(BitCodeAbbrevOp(0));
2104 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2105 Abv->Add(BitCodeAbbrevOp(0));
2106 Abv->Add(BitCodeAbbrevOp(0));
2107 Abv->Add(BitCodeAbbrevOp(0));
2108 Abv->Add(BitCodeAbbrevOp(0));
2109 Abv->Add(BitCodeAbbrevOp(0));
2110 Abv->Add(BitCodeAbbrevOp(0));
2111 Abv->Add(BitCodeAbbrevOp(0));
2112 Abv->Add(BitCodeAbbrevOp(
AS_none));
2113 Abv->Add(BitCodeAbbrevOp(0));
2114 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2116 Abv->Add(BitCodeAbbrevOp(0));
2117 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2118 Abv->Add(BitCodeAbbrevOp(0));
2120 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2122 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2123 Abv->Add(BitCodeAbbrevOp(0));
2124 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2126 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2127 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2128 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
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(0));
2136 Abv->Add(BitCodeAbbrevOp(0));
2137 Abv->Add(BitCodeAbbrevOp(0));
2138 Abv->Add(BitCodeAbbrevOp(0));
2139 Abv->Add(BitCodeAbbrevOp(0));
2140 Abv->Add(BitCodeAbbrevOp(0));
2141 Abv->Add(BitCodeAbbrevOp(0));
2142 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2143 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2144 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2146 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2147 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2148 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2151 Abv = std::make_shared<BitCodeAbbrev>();
2154 Abv->Add(BitCodeAbbrevOp(0));
2156 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2157 Abv->Add(BitCodeAbbrevOp(0));
2158 Abv->Add(BitCodeAbbrevOp(0));
2159 Abv->Add(BitCodeAbbrevOp(0));
2160 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2161 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2162 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2163 Abv->Add(BitCodeAbbrevOp(0));
2164 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
2165 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2166 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2169 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2170 Abv->Add(BitCodeAbbrevOp(0));
2172 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2174 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2175 Abv->Add(BitCodeAbbrevOp(0));
2176 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2178 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2179 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
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(0));
2185 Abv->Add(BitCodeAbbrevOp(1));
2186 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2187 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2188 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2189 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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(BitCodeAbbrevOp::Fixed, 1));
2197 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2198 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2199 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2200 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2209 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2210 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2211 DeclCXXMethodAbbrev = Stream.EmitAbbrev(std::move(Abv));
2214 Abv = std::make_shared<BitCodeAbbrev>();
2217 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2219 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2220 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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(BitCodeAbbrevOp::Fixed, 3));
2225 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2227 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2228 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2229 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2230 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2231 Abv->Add(BitCodeAbbrevOp(0));
2232 Abv->Add(BitCodeAbbrevOp(0));
2233 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2234 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2235 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2238 Abv = std::make_shared<BitCodeAbbrev>();
2241 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2243 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2244 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2245 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2246 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2247 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2248 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2249 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2251 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2252 Abv->Add(BitCodeAbbrevOp(32));
2253 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2254 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2257 Abv = std::make_shared<BitCodeAbbrev>();
2260 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2262 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2263 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2264 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2265 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2266 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2267 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2268 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2270 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2271 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2272 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2273 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2276 Abv = std::make_shared<BitCodeAbbrev>();
2279 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2281 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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, 1));
2286 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2287 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2289 Abv->Add(BitCodeAbbrevOp(0));
2290 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2291 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2293 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2295 Abv = std::make_shared<BitCodeAbbrev>();
2297 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2298 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2300 Abv = std::make_shared<BitCodeAbbrev>();
2302 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2303 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2319 bool WritingModule) {
2325 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D))
2343 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2350 assert(ID >= FirstDeclID &&
"invalid decl ID");
2363 unsigned Index = ID - FirstDeclID;
2364 if (DeclOffsets.size() == Index)
2365 DeclOffsets.push_back(
DeclOffset(Loc, Offset));
2366 else if (DeclOffsets.size() < Index) {
2368 DeclOffsets.resize(Index+1);
2369 DeclOffsets[Index].setLocation(Loc);
2370 DeclOffsets[Index].BitOffset =
Offset;
2372 llvm_unreachable(
"declarations should be emitted in ID order");
2377 associateDeclWithFile(D, ID);
2382 EagerlyDeserializedDecls.push_back(ID);
2387 Writer->ClearSwitchCaseIDs();
2390 bool ModulesCodegen =
false;
2398 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2401 if (Writer->Context->getLangOpts().ModulesCodegen) {
2404 if (!FD->
hasAttr<AlwaysInlineAttr>()) {
2406 Linkage = Writer->Context->GetGVALinkageForFunction(FD);
2411 Record->push_back(ModulesCodegen);
2413 Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(FD));
2414 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
2415 Record->push_back(CD->getNumCtorInitializers());
2416 if (CD->getNumCtorInitializers())
2417 AddCXXCtorInitializers(
2418 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()
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)
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 * 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
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
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 ...
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.
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)
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.
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.
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)
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
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 ...
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.
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...
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.
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 hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
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.
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.
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...
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 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...
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
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.
This is a C++ Modules TS module interface unit.