23 #include "llvm/ADT/Twine.h"
24 #include "llvm/Bitcode/BitstreamWriter.h"
25 #include "llvm/Support/ErrorHandling.h"
26 using namespace clang;
27 using namespace serialization;
46 : Writer(Writer), Context(Context), Record(Record) {
51 void VisitDecl(
Decl *D);
67 void VisitClassTemplateSpecializationDecl(
69 void VisitClassTemplatePartialSpecializationDecl(
72 void VisitVarTemplatePartialSpecializationDecl(
74 void VisitClassScopeFunctionSpecializationDecl(
113 void VisitDeclContext(
DeclContext *DC, uint64_t LexicalOffset,
114 uint64_t VisibleOffset);
143 Record.push_back(typeParams->
size());
144 for (
auto typeParam : *typeParams) {
145 Writer.AddDeclRef(typeParam, Record);
147 Writer.AddSourceLocation(typeParams->getLAngleLoc(), Record);
148 Writer.AddSourceLocation(typeParams->getRAngleLoc(), Record);
153 if (
auto *CD = dyn_cast<CXXConstructorDecl>(FD)) {
154 Record.push_back(CD->NumCtorInitializers);
155 if (CD->NumCtorInitializers)
156 Writer.AddCXXCtorInitializersRef(
157 llvm::makeArrayRef(CD->init_begin(), CD->init_end()), Record);
166 llvm::MapVector<ModuleFile*, const Decl*> Firsts;
169 if (R->isFromASTFile())
170 Firsts[Writer.Chain->getOwningModuleFile(R)] = R;
171 else if (IncludeLocal)
174 for (
const auto &F : Firsts)
175 Writer.AddDeclRef(F.second, Record);
179 template <
typename EntryType>
188 return Common->PartialSpecializations;
194 template<
typename Decl>
196 auto *Common = D->getCommonPtr();
201 if (Writer.Chain != Writer.Context->getExternalSource() &&
202 Common->LazySpecializations) {
203 D->LoadLazySpecializations();
204 assert(!Common->LazySpecializations);
207 auto &Specializations = Common->Specializations;
208 auto &&PartialSpecializations = getPartialSpecializations(Common);
210 if (
auto *LS = Common->LazySpecializations)
211 LazySpecializations = llvm::makeArrayRef(LS + 1, LS[0]);
214 unsigned I = Record.size();
217 for (
auto &Entry : Specializations) {
218 auto *D = getSpecializationDecl(Entry);
220 AddFirstDeclFromEachModule(D,
true);
222 for (
auto &Entry : PartialSpecializations) {
223 auto *D = getSpecializationDecl(Entry);
225 AddFirstDeclFromEachModule(D,
true);
227 Record.append(LazySpecializations.begin(), LazySpecializations.end());
230 Record[
I] = Record.size() - I - 1;
236 const Decl *Specialization) {
248 if (Writer.getFirstLocalDecl(Specialization) != Specialization)
251 Writer.DeclUpdates[Template].push_back(ASTWriter::DeclUpdate(
264 Writer.AddTypeSourceInfo(DD->getTypeSourceInfo(), Record);
271 Record.push_back(FD->doesThisDeclarationHaveABody());
272 if (FD->doesThisDeclarationHaveABody())
273 AddFunctionDefinition(FD);
278 Writer.AddDeclRef(cast_or_null<Decl>(D->
getDeclContext()), Record);
286 Writer.WriteAttributes(llvm::makeArrayRef(D->
getAttrs().begin(),
289 Record.push_back(D->
isUsed(
false));
294 Record.push_back(Writer.inferSubmoduleIDFromLocation(D->
getLocation()));
306 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
307 if (!NS->isFromASTFile())
309 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
310 if (!NS->isInlineNamespace())
318 llvm_unreachable(
"Translation units aren't directly serialized");
323 Writer.AddDeclarationName(D->
getDeclName(), Record);
325 ? Writer.getAnonymousDeclarationNumber(D)
331 Writer.AddSourceLocation(D->
getLocStart(), Record);
336 VisitRedeclarable(D);
339 Record.push_back(D->
isModed());
345 VisitTypedefNameDecl(D);
355 AbbrevToUse = Writer.getDeclTypedefAbbrev();
361 VisitTypedefNameDecl(D);
367 VisitRedeclarable(D);
371 if (!isa<CXXRecordDecl>(D))
378 if (D->hasExtInfo()) {
380 Writer.AddQualifierInfo(*D->getExtInfo(), Record);
383 Writer.AddDeclRef(TD, Record);
384 Writer.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo(), Record);
400 Record.push_back(D->
isFixed());
402 Writer.AddDeclRef(MemberInfo->getInstantiatedFrom(), Record);
403 Record.push_back(MemberInfo->getTemplateSpecializationKind());
404 Writer.AddSourceLocation(MemberInfo->getPointOfInstantiation(), Record);
406 Writer.AddDeclRef(
nullptr, Record);
426 AbbrevToUse = Writer.getDeclEnumAbbrev();
453 AbbrevToUse = Writer.getDeclRecordAbbrev();
460 Writer.AddTypeRef(D->
getType(), Record);
476 Record.push_back(D->hasExtInfo());
478 Writer.AddQualifierInfo(*D->getExtInfo(), Record);
482 VisitRedeclarable(D);
483 VisitDeclaratorDecl(D);
484 Writer.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record);
490 Record.push_back((
int)D->SClass);
491 Record.push_back(D->IsInline);
492 Record.push_back(D->IsInlineSpecified);
493 Record.push_back(D->IsVirtualAsWritten);
494 Record.push_back(D->IsPure);
495 Record.push_back(D->HasInheritedPrototype);
496 Record.push_back(D->HasWrittenPrototype);
497 Record.push_back(D->IsDeleted);
498 Record.push_back(D->IsTrivial);
499 Record.push_back(D->IsDefaulted);
500 Record.push_back(D->IsExplicitlyDefaulted);
501 Record.push_back(D->HasImplicitReturnZero);
502 Record.push_back(D->IsConstexpr);
503 Record.push_back(D->HasSkippedBody);
504 Record.push_back(D->IsLateTemplateParsed);
506 Writer.AddSourceLocation(D->
getLocEnd(), Record);
526 RegisterTemplateSpecialization(FTSInfo->
getTemplate(), D);
564 Writer.AddDeclRef(DFTSInfo->
getTemplate(i), Record);
569 Writer.AddTemplateArgumentLoc(DFTSInfo->
getTemplateArg(i), Record);
570 Writer.AddSourceLocation(DFTSInfo->
getLAngleLoc(), Record);
571 Writer.AddSourceLocation(DFTSInfo->
getRAngleLoc(), Record);
578 Writer.AddDeclRef(
P, Record);
586 bool HasBodyStuff = D->
getBody() !=
nullptr ||
588 Record.push_back(HasBodyStuff);
598 Record.push_back(D->IsOverriding);
599 Record.push_back(D->HasSkippedBody);
601 Record.push_back(D->IsRedeclaration);
602 Record.push_back(D->HasRedeclaration);
603 if (D->HasRedeclaration) {
615 Writer.AddSourceLocation(D->
getLocEnd(), Record);
617 for (
const auto *
P : D->
params())
618 Writer.AddDeclRef(
P, Record);
620 Record.push_back(D->SelLocsKind);
621 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
623 Record.push_back(NumStoredSelLocs);
624 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
625 Writer.AddSourceLocation(SelLocs[i], Record);
631 VisitTypedefNameDecl(D);
632 Record.push_back(D->Variance);
633 Record.push_back(D->Index);
634 Writer.AddSourceLocation(D->VarianceLoc, Record);
635 Writer.AddSourceLocation(D->ColonLoc, Record);
648 VisitRedeclarable(D);
649 VisitObjCContainerDecl(D);
651 AddObjCTypeParamList(D->TypeParamList);
656 ObjCInterfaceDecl::DefinitionData &Data = D->data();
660 Record.push_back(Data.HasDesignatedInitializers);
663 Record.push_back(Data.ReferencedProtocols.size());
665 Writer.AddDeclRef(
P, Record);
667 Writer.AddSourceLocation(PL, Record);
670 Record.push_back(Data.AllReferencedProtocols.size());
672 P = Data.AllReferencedProtocols.begin(),
673 PEnd = Data.AllReferencedProtocols.end();
675 Writer.AddDeclRef(*
P, Record);
680 Writer.ObjCClassesWithCategories.insert(D);
683 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
684 (
void)Writer.GetDeclRef(Cat);
707 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
713 VisitRedeclarable(D);
714 VisitObjCContainerDecl(D);
720 Writer.AddDeclRef(
I, Record);
722 Writer.AddSourceLocation(PL, Record);
734 VisitObjCContainerDecl(D);
739 AddObjCTypeParamList(D->TypeParamList);
742 Writer.AddDeclRef(
I, Record);
744 Writer.AddSourceLocation(PL, Record);
756 Writer.AddSourceLocation(D->
getAtLoc(), Record);
758 Writer.AddTypeRef(D->
getType(), Record);
774 VisitObjCContainerDecl(D);
780 VisitObjCImplDecl(D);
787 VisitObjCImplDecl(D);
794 Record.push_back(D->NumIvarInitializers);
795 if (D->NumIvarInitializers)
796 Writer.AddCXXCtorInitializersRef(
803 Writer.AddSourceLocation(D->
getLocStart(), Record);
813 VisitDeclaratorDecl(D);
815 if (D->InitStorage.getInt() == FieldDecl::ISK_BitWidthOrNothing &&
816 D->InitStorage.getPointer() ==
nullptr) {
818 }
else if (D->InitStorage.getInt() == FieldDecl::ISK_CapturedVLAType) {
819 Record.push_back(D->InitStorage.getInt() + 1);
821 QualType(static_cast<Type *>(D->InitStorage.getPointer()), 0),
824 Record.push_back(D->InitStorage.getInt() + 1);
825 Writer.AddStmt(static_cast<Expr *>(D->InitStorage.getPointer()));
844 AbbrevToUse = Writer.getDeclFieldAbbrev();
850 VisitDeclaratorDecl(D);
860 for (
const auto *
P : D->
chain())
861 Writer.AddDeclRef(
P, Record);
866 VisitRedeclarable(D);
867 VisitDeclaratorDecl(D);
871 if (!isa<ParmVarDecl>(D)) {
890 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
893 Record.push_back(VarTemplate);
894 Writer.AddDeclRef(TemplD, Record);
897 Record.push_back(StaticDataMemberSpecialization);
898 Writer.AddDeclRef(SpecInfo->getInstantiatedFrom(), Record);
899 Record.push_back(SpecInfo->getTemplateSpecializationKind());
900 Writer.AddSourceLocation(SpecInfo->getPointOfInstantiation(), Record);
902 Record.push_back(VarNotTemplate);
920 !isa<ParmVarDecl>(D) &&
921 !isa<VarTemplateSpecializationDecl>(D) &&
926 AbbrevToUse = Writer.getDeclVarAbbrev();
971 AbbrevToUse = Writer.getDeclParmVarAbbrev();
975 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
976 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
978 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
980 "PARM_VAR_DECL can't be static data member");
1002 Writer.AddDeclRef(*
P, Record);
1008 for (
const auto &capture : D->
captures()) {
1009 Writer.AddDeclRef(capture.getVariable(), Record);
1012 if (capture.isByRef()) flags |= 1;
1013 if (capture.isNested()) flags |= 2;
1014 if (capture.hasCopyExpr()) flags |= 4;
1015 Record.push_back(flags);
1017 if (capture.hasCopyExpr()) Writer.AddStmt(capture.getCopyExpr());
1027 Record.push_back(CD->
isNothrow() ? 1 : 0);
1030 Writer.AddDeclRef(CD->
getParam(
I), Record);
1044 Writer.AddSourceLocation(D->
getLocStart(), Record);
1050 VisitRedeclarable(D);
1053 Writer.AddSourceLocation(D->
getLocStart(), Record);
1066 Decl *Parent = cast<Decl>(
1068 if (Parent->
isFromASTFile() || isa<TranslationUnitDecl>(Parent)) {
1069 Writer.DeclUpdates[Parent].push_back(
1076 VisitRedeclarable(D);
1087 Writer.AddSourceLocation(D->
getUsingLoc(), Record);
1089 Writer.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record);
1090 Writer.AddDeclRef(D->FirstUsingShadow.getPointer(), Record);
1097 VisitRedeclarable(D);
1100 Writer.AddDeclRef(D->UsingOrNextShadow, Record);
1107 Writer.AddSourceLocation(D->
getUsingLoc(), Record);
1117 Writer.AddSourceLocation(D->
getUsingLoc(), Record);
1119 Writer.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record);
1135 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1138 Record.push_back(CXXRecTemplate);
1139 Writer.AddDeclRef(TemplD, Record);
1142 Record.push_back(CXXRecMemberSpecialization);
1143 Writer.AddDeclRef(MSInfo->getInstantiatedFrom(), Record);
1144 Record.push_back(MSInfo->getTemplateSpecializationKind());
1145 Writer.AddSourceLocation(MSInfo->getPointOfInstantiation(), Record);
1147 Record.push_back(CXXRecNotTemplate);
1152 Writer.AddCXXDefinitionData(D, Record);
1156 if (D->IsCompleteDefinition)
1163 VisitFunctionDecl(D);
1169 Writer.AddDeclRef(*
I, Record);
1172 Record.push_back(0);
1184 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1190 VisitCXXMethodDecl(D);
1193 Record.push_back(D->IsExplicitSpecified);
1199 VisitCXXMethodDecl(D);
1207 VisitCXXMethodDecl(D);
1208 Record.push_back(D->IsExplicitSpecified);
1216 Record.push_back(!IdentifierLocs.empty());
1217 if (IdentifierLocs.empty()) {
1218 Writer.AddSourceLocation(D->
getLocEnd(), Record);
1219 Record.push_back(1);
1221 for (
unsigned I = 0, N = IdentifierLocs.size();
I != N; ++
I)
1222 Writer.AddSourceLocation(IdentifierLocs[
I], Record);
1223 Record.push_back(IdentifierLocs.size());
1232 Writer.AddSourceLocation(D->
getColonLoc(), Record);
1239 Record.push_back(D->NumTPLists);
1241 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1242 Record.push_back(hasFriendDecl);
1247 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1250 Writer.AddDeclRef(D->getNextFriend(), Record);
1251 Record.push_back(D->UnsupportedFriend);
1252 Writer.AddSourceLocation(D->FriendLoc, Record);
1278 VisitRedeclarable(D);
1289 VisitTemplateDecl(D);
1294 VisitRedeclarableTemplateDecl(D);
1297 AddTemplateSpecializations(D);
1305 VisitCXXRecordDecl(D);
1310 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1311 Writer.AddDeclRef(InstFromD, Record);
1340 VisitClassTemplateSpecializationDecl(D);
1355 VisitRedeclarableTemplateDecl(D);
1358 AddTemplateSpecializations(D);
1368 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1371 Writer.AddDeclRef(InstFromD, Record);
1400 VisitVarTemplateSpecializationDecl(D);
1423 VisitRedeclarableTemplateDecl(D);
1426 AddTemplateSpecializations(D);
1437 Record.push_back(OwnsDefaultArg);
1451 VisitDeclaratorDecl(D);
1468 Record.push_back(OwnsDefaultArg);
1482 VisitTemplateDecl(D);
1498 Record.push_back(OwnsDefaultArg);
1506 VisitRedeclarableTemplateDecl(D);
1531 uint64_t VisibleOffset) {
1532 Record.push_back(LexicalOffset);
1533 Record.push_back(VisibleOffset);
1540 auto IsLocalDecl = [&](
const Decl *D) ->
bool {
1543 auto I = DeclIDs.find(D);
1547 assert(IsLocalDecl(D) &&
"expected a local declaration");
1550 if (IsLocalDecl(Canon))
1553 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
1558 if (IsLocalDecl(Redecl))
1560 return CacheEntry = D;
1563 template <
typename T>
1566 T *MostRecent = First->getMostRecentDecl();
1567 T *DAsT =
static_cast<T *
>(D);
1568 if (MostRecent != First) {
1570 "Not considered redeclarable?");
1572 Writer.AddDeclRef(First, Record);
1576 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
1577 if (DAsT == FirstLocal) {
1581 unsigned I = Record.size();
1582 Record.push_back(0);
1584 AddFirstDeclFromEachModule(DAsT,
false);
1586 Record[
I] = Record.size() -
I;
1593 if (!Prev->isFromASTFile())
1594 Writer.AddDeclRef(Prev, LocalRedecls);
1598 if (LocalRedecls.empty())
1599 Record.push_back(0);
1601 Record.push_back(Writer.Stream.GetCurrentBitNo());
1605 Record.push_back(0);
1606 Writer.AddDeclRef(FirstLocal, Record);
1616 (void)Writer.GetDeclRef(MostRecent);
1619 Record.push_back(0);
1635 void ASTWriter::WriteDeclAbbrevs() {
1636 using namespace llvm;
1641 Abv =
new BitCodeAbbrev();
1644 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1645 Abv->Add(BitCodeAbbrevOp(0));
1646 Abv->Add(BitCodeAbbrevOp(0));
1647 Abv->Add(BitCodeAbbrevOp(0));
1648 Abv->Add(BitCodeAbbrevOp(0));
1649 Abv->Add(BitCodeAbbrevOp(0));
1650 Abv->Add(BitCodeAbbrevOp(0));
1651 Abv->Add(BitCodeAbbrevOp(0));
1652 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1653 Abv->Add(BitCodeAbbrevOp(0));
1654 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1656 Abv->Add(BitCodeAbbrevOp(0));
1657 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1658 Abv->Add(BitCodeAbbrevOp(0));
1660 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1662 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1663 Abv->Add(BitCodeAbbrevOp(0));
1665 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1666 Abv->Add(BitCodeAbbrevOp(0));
1668 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1669 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1670 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1671 DeclFieldAbbrev = Stream.EmitAbbrev(Abv);
1674 Abv =
new BitCodeAbbrev();
1677 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1678 Abv->Add(BitCodeAbbrevOp(0));
1679 Abv->Add(BitCodeAbbrevOp(0));
1680 Abv->Add(BitCodeAbbrevOp(0));
1681 Abv->Add(BitCodeAbbrevOp(0));
1682 Abv->Add(BitCodeAbbrevOp(0));
1683 Abv->Add(BitCodeAbbrevOp(0));
1684 Abv->Add(BitCodeAbbrevOp(0));
1685 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1686 Abv->Add(BitCodeAbbrevOp(0));
1687 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1689 Abv->Add(BitCodeAbbrevOp(0));
1690 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1691 Abv->Add(BitCodeAbbrevOp(0));
1693 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1695 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1696 Abv->Add(BitCodeAbbrevOp(0));
1698 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1699 Abv->Add(BitCodeAbbrevOp(0));
1701 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1704 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1705 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1706 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1707 DeclObjCIvarAbbrev = Stream.EmitAbbrev(Abv);
1710 Abv =
new BitCodeAbbrev();
1713 Abv->Add(BitCodeAbbrevOp(0));
1715 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1716 Abv->Add(BitCodeAbbrevOp(0));
1717 Abv->Add(BitCodeAbbrevOp(0));
1718 Abv->Add(BitCodeAbbrevOp(0));
1719 Abv->Add(BitCodeAbbrevOp(0));
1720 Abv->Add(BitCodeAbbrevOp(0));
1721 Abv->Add(BitCodeAbbrevOp(0));
1722 Abv->Add(BitCodeAbbrevOp(0));
1723 Abv->Add(BitCodeAbbrevOp(
AS_none));
1724 Abv->Add(BitCodeAbbrevOp(0));
1725 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1727 Abv->Add(BitCodeAbbrevOp(0));
1728 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1729 Abv->Add(BitCodeAbbrevOp(0));
1731 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1734 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1735 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1736 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1737 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1738 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1739 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1740 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1741 Abv->Add(BitCodeAbbrevOp(0));
1743 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1744 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1745 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1746 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1747 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1748 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1749 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1750 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1751 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1753 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1754 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1755 DeclEnumAbbrev = Stream.EmitAbbrev(Abv);
1758 Abv =
new BitCodeAbbrev();
1761 Abv->Add(BitCodeAbbrevOp(0));
1763 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1764 Abv->Add(BitCodeAbbrevOp(0));
1765 Abv->Add(BitCodeAbbrevOp(0));
1766 Abv->Add(BitCodeAbbrevOp(0));
1767 Abv->Add(BitCodeAbbrevOp(0));
1768 Abv->Add(BitCodeAbbrevOp(0));
1769 Abv->Add(BitCodeAbbrevOp(0));
1770 Abv->Add(BitCodeAbbrevOp(0));
1771 Abv->Add(BitCodeAbbrevOp(
AS_none));
1772 Abv->Add(BitCodeAbbrevOp(0));
1773 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1775 Abv->Add(BitCodeAbbrevOp(0));
1776 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1777 Abv->Add(BitCodeAbbrevOp(0));
1779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1780 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1783 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1784 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1785 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1786 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1787 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1789 Abv->Add(BitCodeAbbrevOp(0));
1791 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1792 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1793 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1794 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1796 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1797 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1798 DeclRecordAbbrev = Stream.EmitAbbrev(Abv);
1801 Abv =
new BitCodeAbbrev();
1804 Abv->Add(BitCodeAbbrevOp(0));
1806 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1807 Abv->Add(BitCodeAbbrevOp(0));
1808 Abv->Add(BitCodeAbbrevOp(0));
1809 Abv->Add(BitCodeAbbrevOp(0));
1810 Abv->Add(BitCodeAbbrevOp(0));
1811 Abv->Add(BitCodeAbbrevOp(0));
1812 Abv->Add(BitCodeAbbrevOp(0));
1813 Abv->Add(BitCodeAbbrevOp(0));
1814 Abv->Add(BitCodeAbbrevOp(
AS_none));
1815 Abv->Add(BitCodeAbbrevOp(0));
1816 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1818 Abv->Add(BitCodeAbbrevOp(0));
1819 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1820 Abv->Add(BitCodeAbbrevOp(0));
1822 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1825 Abv->Add(BitCodeAbbrevOp(0));
1827 Abv->Add(BitCodeAbbrevOp(0));
1828 Abv->Add(BitCodeAbbrevOp(0));
1829 Abv->Add(BitCodeAbbrevOp(0));
1830 Abv->Add(BitCodeAbbrevOp(0));
1831 Abv->Add(BitCodeAbbrevOp(0));
1832 Abv->Add(BitCodeAbbrevOp(0));
1834 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1835 Abv->Add(BitCodeAbbrevOp(0));
1836 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1837 Abv->Add(BitCodeAbbrevOp(0));
1838 Abv->Add(BitCodeAbbrevOp(0));
1839 Abv->Add(BitCodeAbbrevOp(0));
1840 Abv->Add(BitCodeAbbrevOp(0));
1842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1843 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1844 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1845 DeclParmVarAbbrev = Stream.EmitAbbrev(Abv);
1848 Abv =
new BitCodeAbbrev();
1851 Abv->Add(BitCodeAbbrevOp(0));
1853 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1854 Abv->Add(BitCodeAbbrevOp(0));
1855 Abv->Add(BitCodeAbbrevOp(0));
1856 Abv->Add(BitCodeAbbrevOp(0));
1857 Abv->Add(BitCodeAbbrevOp(0));
1858 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1859 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1860 Abv->Add(BitCodeAbbrevOp(0));
1861 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1862 Abv->Add(BitCodeAbbrevOp(0));
1863 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1865 Abv->Add(BitCodeAbbrevOp(0));
1866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1867 Abv->Add(BitCodeAbbrevOp(0));
1869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1870 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1872 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1873 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1874 DeclTypedefAbbrev = Stream.EmitAbbrev(Abv);
1877 Abv =
new BitCodeAbbrev();
1880 Abv->Add(BitCodeAbbrevOp(0));
1882 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1883 Abv->Add(BitCodeAbbrevOp(0));
1884 Abv->Add(BitCodeAbbrevOp(0));
1885 Abv->Add(BitCodeAbbrevOp(0));
1886 Abv->Add(BitCodeAbbrevOp(0));
1887 Abv->Add(BitCodeAbbrevOp(0));
1888 Abv->Add(BitCodeAbbrevOp(0));
1889 Abv->Add(BitCodeAbbrevOp(0));
1890 Abv->Add(BitCodeAbbrevOp(
AS_none));
1891 Abv->Add(BitCodeAbbrevOp(0));
1892 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1894 Abv->Add(BitCodeAbbrevOp(0));
1895 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1896 Abv->Add(BitCodeAbbrevOp(0));
1898 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1900 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1901 Abv->Add(BitCodeAbbrevOp(0));
1903 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1904 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1907 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1908 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1909 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1910 Abv->Add(BitCodeAbbrevOp(0));
1911 Abv->Add(BitCodeAbbrevOp(0));
1912 Abv->Add(BitCodeAbbrevOp(0));
1913 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1914 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1917 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1918 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1919 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1920 DeclVarAbbrev = Stream.EmitAbbrev(Abv);
1923 Abv =
new BitCodeAbbrev();
1926 Abv->Add(BitCodeAbbrevOp(0));
1928 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1929 Abv->Add(BitCodeAbbrevOp(0));
1930 Abv->Add(BitCodeAbbrevOp(0));
1931 Abv->Add(BitCodeAbbrevOp(0));
1932 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1933 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1934 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1935 Abv->Add(BitCodeAbbrevOp(0));
1936 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1937 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1938 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));
1946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1947 Abv->Add(BitCodeAbbrevOp(0));
1949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
1950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1951 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1953 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1954 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1955 Abv->Add(BitCodeAbbrevOp(0));
1956 Abv->Add(BitCodeAbbrevOp(1));
1957 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1958 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1959 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1960 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1961 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1962 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1963 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1964 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1965 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1966 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1967 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1976 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1977 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1978 DeclCXXMethodAbbrev = Stream.EmitAbbrev(Abv);
1981 Abv =
new BitCodeAbbrev();
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::Fixed, 3));
1991 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1993 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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,
1999 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2000 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2001 DeclRefExprAbbrev = Stream.EmitAbbrev(Abv);
2004 Abv =
new BitCodeAbbrev();
2008 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2009 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
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, 3));
2014 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2016 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2017 Abv->Add(BitCodeAbbrevOp(32));
2018 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2019 IntegerLiteralAbbrev = Stream.EmitAbbrev(Abv);
2022 Abv =
new BitCodeAbbrev();
2026 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2027 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2028 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2029 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2030 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2031 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2032 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2034 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2035 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2036 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2037 CharacterLiteralAbbrev = Stream.EmitAbbrev(Abv);
2040 Abv =
new BitCodeAbbrev();
2044 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2045 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2046 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2047 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2048 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2049 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2050 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2052 Abv->Add(BitCodeAbbrevOp(0));
2053 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
2055 ExprImplicitCastAbbrev = Stream.EmitAbbrev(Abv);
2057 Abv =
new BitCodeAbbrev();
2059 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2060 DeclContextLexicalAbbrev = Stream.EmitAbbrev(Abv);
2062 Abv =
new BitCodeAbbrev();
2064 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2065 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(Abv);
2081 bool WritingModule) {
2086 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D))
2092 if (isa<ImportDecl>(D) && !WritingModule)
2100 ClearSwitchCaseIDs();
2107 assert(!D->
isFromASTFile() &&
"should not be emitting imported decl");
2114 bool isReplacingADecl = ID < FirstDeclID;
2121 uint64_t LexicalOffset = 0;
2122 uint64_t VisibleOffset = 0;
2125 if (isReplacingADecl) {
2129 DC->LoadLexicalDeclsFromExternalStorage();
2131 Chain->completeVisibleDeclsMap(DC);
2133 LexicalOffset = WriteDeclContextLexicalBlock(Context, DC);
2134 VisibleOffset = WriteDeclContextVisibleBlock(Context, DC);
2142 if (DC) W.VisitDeclContext(DC, LexicalOffset, VisibleOffset);
2144 if (isReplacingADecl) {
2146 ReplacedDecls.push_back(ReplacedDeclInfo(ID, Stream.GetCurrentBitNo(),
2149 unsigned Index = ID - FirstDeclID;
2153 if (DeclOffsets.size() == Index)
2154 DeclOffsets.push_back(
DeclOffset(Loc, Stream.GetCurrentBitNo()));
2155 else if (DeclOffsets.size() < Index) {
2156 DeclOffsets.resize(Index+1);
2157 DeclOffsets[Index].setLocation(Loc);
2158 DeclOffsets[Index].BitOffset = Stream.GetCurrentBitNo();
2163 associateDeclWithFile(D, ID);
2167 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
2169 Stream.EmitRecord(W.Code, Record, W.AbbrevToUse);
2173 FlushPendingAfterDecl();
2178 EagerlyDeserializedDecls.push_back(ID);
2181 void ASTWriter::AddFunctionDefinition(
const FunctionDecl *FD,
2182 RecordData &Record) {
2183 ClearSwitchCaseIDs();
A FriendTemplateDecl record.
A NonTypeTemplateParmDecl record.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
TemplateParameterList * getFriendTypeTemplateParameterList(unsigned N) const
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
void VisitAccessSpecDecl(AccessSpecDecl *D)
protocol_range protocols() const
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
void VisitStaticAssertDecl(StaticAssertDecl *D)
void VisitCXXMethodDecl(CXXMethodDecl *D)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
A (possibly-)qualified type.
ImplementationControl getImplementationControl() const
unsigned getNumTemplates() const
Returns the number of function templates that this might be a specialization of.
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
ObjCInterfaceDecl * getClassInterface()
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
unsigned param_size() const
void VisitRedeclarable(Redeclarable< T > *D)
void VisitEmptyDecl(EmptyDecl *D)
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)
An OMPThreadPrivateDecl record.
PropertyControl getPropertyImplementation() const
CXXMethodDecl * getSpecialization() const
bool isMemberSpecialization()
Determines whether this class template partial specialization template was a specialization of a memb...
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
const Expr * getInitExpr() const
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
EnumConstantDecl - An instance of this object exists for each enum constant that is defined...
void VisitCXXRecordDecl(CXXRecordDecl *D)
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
Defines the SourceManager interface.
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
QualType getUnderlyingType() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
Decl - This represents one declaration (or definition), e.g.
An ImplicitCastExpr record.
chain_range chain() const
A VarTemplatePartialSpecializationDecl record.
param_iterator param_end()
Defines the C++ template declaration subclasses.
bool hasFlexibleArrayMember() const
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration, or NULL if there is no previous declaration.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
A record that stores the set of declarations that are lexically stored within a given DeclContext...
Represents an empty-declaration.
uint32_t DeclID
An ID number that refers to a declaration in an AST file.
Declaration of a variable template.
const Expr * getInit() const
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
NamespaceDecl - Represent a C++ namespace.
A ObjCPropertyDecl record.
ObjCDeclQualifier getObjCDeclQualifier() const
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field)
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists...
protocol_range protocols() const
SourceLocation getLocEnd() const LLVM_READONLY
Represents a C++ constructor within a class.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
ArrayRef< Decl > getPartialSpecializations(FunctionTemplateDecl::Common *)
FunctionTemplateDecl * getTemplate(unsigned I) const
Returns the i'th template candidate.
void AddTemplateSpecializations(Decl *D)
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
A ClassTemplateDecl record.
An UnresolvedUsingTypenameDecl record.
void VisitBlockDecl(BlockDecl *D)
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
void VisitImplicitParamDecl(ImplicitParamDecl *D)
const Type * getTypeForDecl() const
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Expr * getSetterCXXAssignment() const
Declaration of a redeclarable template.
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
bool capturesCXXThis() const
SourceLocation getRParenLoc() const
A UsingShadowDecl record.
void VisitDeclContext(DeclContext *DC, uint64_t LexicalOffset, uint64_t VisibleOffset)
Emit the DeclContext part of a declaration context decl.
SourceLocation getIvarRBraceLoc() const
AccessSpecifier getAccess() const
const unsigned int NUM_PREDEF_DECL_IDS
The number of declaration IDs that are predefined.
TypeSourceInfo * getSuperClassTInfo() 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.
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack...
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
SourceLocation getRAngleLoc() const
unsigned param_size() const
unsigned size() const
Determine the number of type parameters in this list.
A TemplateTemplateParmDecl record.
ParmVarDecl - Represents a parameter to a function.
A ObjCInterfaceDecl record.
Provides information about a dependent function-template specialization declaration.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the category interface associated with this implementat...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
TypeSourceInfo * getTypeSourceInfo() const
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
RecordDecl - Represents a struct/union/class.
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
bool hasUninstantiatedDefaultArg() const
Provides common interface for the Decls that can be redeclared.
Represents a class template specialization, which refers to a class template with a given set of temp...
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
method_iterator end_overridden_methods() const
StringLiteral * getMessage()
CXXRecordDecl * getPreviousDecl()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, RecordData &Record)
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
protocol_loc_range protocol_locs() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
ImplicitParamDecl * getCmdDecl() const
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
bool isReferenced() const
Whether any declaration of this entity was referenced.
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
unsigned getIdentifierNamespace() const
TagKind getTagKind() const
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)...
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
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)
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
Represents an access specifier followed by colon ':'.
Declaration of a function specialization at template class scope.
unsigned getNumCaptures() const
getNumCaptures - Returns the number of captured variables.
bool isThisDeclarationADefinition() const
isThisDeclarationADefinition() - Return true if this declaration is a completion definition of the ty...
SourceLocation getCategoryNameLoc() const
StorageClass getStorageClass() const
Returns the storage class as written in the source.
A IndirectFieldDecl record.
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
Provides information about a function template specialization, which is a FunctionDecl that has been ...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Represents a C++ using-declaration.
ImplicitParamDecl * getParam(unsigned i) const
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.
void VisitLabelDecl(LabelDecl *LD)
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
SourceLocation getExternLoc() const
Gets the location of the extern keyword, if present.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
void VisitClassTemplateDecl(ClassTemplateDecl *D)
IdentifierInfo * getSetterId() const
ObjCContainerDecl - Represents a container for method declarations.
protocol_loc_range protocol_locs() const
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isInline() const
Returns true if this is an inline namespace declaration.
void VisitTypedefDecl(TypedefDecl *D)
An AccessSpecDecl record.
SourceLocation getIvarLBraceLoc() const
SourceLocation getRBraceLoc() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Get the template arguments as written.
void VisitUsingShadowDecl(UsingShadowDecl *D)
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
A UsingDirecitveDecl record.
TypeDecl - Represents a declaration of a type.
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
Expr * getGetterCXXConstructor() const
SourceLocation RAngleLoc
The source location of the right angle bracket ('>').
unsigned getNumTemplateParameters() const
Selector getSetterName() const
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
SourceLocation getRBraceLoc() const
A ClassTemplateSpecializationDecl record.
Represents an Objective-C protocol declaration.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
This represents the body of a CapturedStmt, and serves as its DeclContext.
Represents an ObjC class declaration.
SourceLocation getLocEnd() const LLVM_READONLY
Represents a linkage specification.
detail::InMemoryDirectory::const_iterator I
PropertyAttributeKind getPropertyAttributes() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getIvarLBraceLoc() const
SourceLocation getAtStartLoc() const
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
SourceLocation getAtLoc() const
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion: ...
unsigned getNumParams() const
SourceRange getAtEndRange() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
void VisitObjCContainerDecl(ObjCContainerDecl *D)
SourceLocation getLocStart() const LLVM_READONLY
RecordDecl * getMostRecentDecl()
TypeAliasDecl - Represents the declaration of a typedef-name via a C++0x alias-declaration.
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this...
bool isConversionFromLambda() const
SourceLocation getLocStart() const LLVM_READONLY
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Represents a ValueDecl that came out of a declarator.
unsigned getChainingSize() const
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
ObjCDeclQualifier getObjCDeclQualifier() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization, retrieves the member specialization information.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
A StaticAssertDecl record.
SourceLocation getSuperClassLoc() const
ID
Defines the set of possible language-specific address spaces.
A VarTemplateSpecializationDecl record.
const CXXMethodDecl *const * method_iterator
static bool classofKind(Kind K)
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
An ObjCTypeParamDecl record.
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
const Type * getTypeForDecl() const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
unsigned param_size() const
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
A ObjCCategoryImplDecl record.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
A ObjCPropertyImplDecl record.
void VisitRecordDecl(RecordDecl *D)
Declaration of a template type parameter.
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
NamedDecl * getFriendDecl() const
If this friend declaration names a templated function (or a member function of a templated type)...
ObjCIvarDecl * getPropertyIvarDecl() const
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
Expr * getBitWidth() const
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc.) that is lexically inside an objc container definition.
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D...
Represents a C++ destructor within a class.
A CXXConstructorDecl record.
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)
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
DeclContext * getDeclContext()
void VisitUsingDecl(UsingDecl *D)
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
const char * getDeclKindName() const
A VarTemplateDecl record.
ImplicitParamDecl * getSelfDecl() const
unsigned getContextParamPosition() const
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
EnumDecl * getMostRecentDecl()
bool isObjCMethodParameter() const
A CXXDestructorDecl record.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack...
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
SourceLocation getRParenLoc() const
bool isInstanceMethod() const
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
A NamespaceAliasDecl record.
Declaration of an alias template.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
void AddObjCTypeParamList(ObjCTypeParamList *typeParams)
Add an Objective-C type parameter list to the given record.
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
NamedDecl * getInstantiatedFromUsingDecl(UsingDecl *Inst)
If the given using decl Inst is an instantiation of a (possibly unresolved) using decl from a templat...
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
protocol_loc_range protocol_locs() const
An ImplicitParamDecl record.
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
Represents a C++ conversion function within a class.
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
An EnumConstantDecl record.
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
void VisitTagDecl(TagDecl *D)
An ImportDecl recording a module import.
A ObjCCategoryDecl record.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
TypedefNameDecl * getTypedefNameForAnonDecl() const
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
CXXMethodDecl * getMostRecentDecl()
TypeSourceInfo * getReturnTypeSourceInfo() const
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.
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
A FileScopeAsmDecl record.
void VisitMSPropertyDecl(MSPropertyDecl *D)
A ObjCCompatibleAliasDecl record.
void VisitVarTemplateDecl(VarTemplateDecl *D)
void VisitTypeAliasDecl(TypeAliasDecl *D)
param_iterator param_begin()
bool isEmbeddedInDeclarator() const
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
SourceLocation getLocStart() const LLVM_READONLY
bool doesThisDeclarationHaveABody() const
doesThisDeclarationHaveABody - Returns whether this specific declaration of the function has a body -...
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
An UnresolvedUsingValueDecl record.
SourceLocation getExternLoc() const
IdentifierInfo * getGetterId() const
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
TypeSourceInfo * getDefaultArgumentInfo() const
Retrieves the default argument's source information, if any.
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Encodes a location in the source.
unsigned protocol_size() const
A record that stores the set of declarations that are visible from a given DeclContext.
method_iterator begin_overridden_methods() const
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
void VisitObjCImplDecl(ObjCImplDecl *D)
const ObjCInterfaceDecl * getClassInterface() const
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
SourceLocation getLocStart() const LLVM_READONLY
bool isValid() const
Return true if this is a valid SourceLocation object.
TagDecl - Represents the declaration of a struct/union/class/enum.
ASTContext & getASTContext() const LLVM_READONLY
unsigned size_overridden_methods() const
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
ObjCList - This is a simple template class used to hold various lists of decls etc, which is heavily used by the ObjC front-end.
LabelDecl - Represents the declaration of a label.
Represents a dependent using declaration which was not marked with typename.
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or NULL if this template was ...
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
bool getSynthesize() const
Represents a static or instance method of a struct/union/class.
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
bool blockMissingReturnType() const
C-style initialization with assignment.
bool isMemberSpecialization()
Determines whether this variable template partial specialization was a specialization of a member par...
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
A TemplateTypeParmDecl record.
Data that is common to all of the declarations of a given function template.
ObjCCategoryDecl - Represents a category declaration.
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
const ObjCInterfaceDecl * getClassInterface() const
bool isPropertyAccessor() const
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
bool hasVolatileMember() const
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
void VisitCapturedDecl(CapturedDecl *D)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
ThreadStorageClassSpecifier getTSCSpec() const
Represents one property declaration in an Objective-C interface.
void AddFunctionDefinition(const FunctionDecl *FD)
A simple visitor class that helps create declaration visitors.
QualType getReturnType() const
Represents a C++11 static_assert declaration.
bool hasObjectMember() const
SourceLocation getCategoryNameLoc() const
const TemplateArgumentLoc & getTemplateArg(unsigned I) const
Returns the nth template argument.
unsigned varlist_size() const
SourceLocation getLParenLoc() const
bool isLocalSourceLocation(SourceLocation Loc) const
Returns true if Loc did not come from a PCH/Module.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
SourceLocation getUsingLoc() const
Return the location of the using keyword.
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
A ObjCProtocolDecl record.
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
Base class for declarations which introduce a typedef-name.
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
A CXXConversionDecl record.
void VisitFieldDecl(FieldDecl *D)
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
An IntegerLiteral record.
bool hasTypename() const
Return true if the using declaration has 'typename'.
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
The base class of all kinds of template declarations (e.g., class, function, etc.).
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
ObjCIvarDecl * getPropertyIvarDecl() const
QualType getPromotionType() const
getPromotionType - Return the integer type that enumerators should promote to.
bool isInvalidDecl() const
void VisitNamedDecl(NamedDecl *D)
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
bool isFreeStanding() const
A ClassTemplatePartialSpecializationDecl record.
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
DeclCode
Record codes for each kind of declaration.
const llvm::APSInt & getInitVal() const
TypeSourceInfo * getTypeAsWritten() const
Gets the type of this specialization as it was written by the user, if it was so written.
void VisitTypeDecl(TypeDecl *D)
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
bool hasWrittenPrototype() const
SourceLocation getPropertyIvarDeclLoc() 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.
Selector getGetterName() const
bool isUsed(bool CheckUsedAttr=true) const
Whether this declaration was used, meaning that a definition is required.
A LinkageSpecDecl record.
decltype(T::PartialSpecializations)& getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
EnumDecl - Represents an enum.
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
unsigned getFunctionScopeDepth() const
detail::InMemoryDirectory::const_iterator E
SourceLocation getEndOfDefinitionLoc() const
void VisitDeclaratorDecl(DeclaratorDecl *D)
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template...
void VisitEnumDecl(EnumDecl *D)
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
serialization::DeclCode Code
bool hasInheritedDefaultArg() const
void VisitNamespaceDecl(NamespaceDecl *D)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
ObjCMethodDecl * getGetterMethodDecl() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
void VisitVarDecl(VarDecl *D)
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
Expr * getUninstantiatedDefaultArg()
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
ObjCMethodDecl * getSetterMethodDecl() const
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
QualType getIntegerType() const
getIntegerType - Return the integer type this enum decl corresponds to.
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
unsigned getNumTemplateArgs() const
Returns the number of explicit template arguments that were given.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
SourceLocation getRBraceLoc() const
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
unsigned protocol_size() const
protocol_range protocols() const
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
void VisitFunctionDecl(FunctionDecl *D)
bool isStaticDataMember() const
Determines whether this is a static data member.
const CXXConstructorDecl * getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
SourceManager & getSourceManager()
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement...
static bool classofKind(Kind K)
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
ObjCPropertyDecl * getPropertyDecl() const
AccessControl getAccessControl() const
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(...).
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum...
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or NULL if there isn't one...
Represents a C++ struct/union/class.
TypeSourceInfo * getSignatureAsWritten() const
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
ObjCIvarDecl - Represents an ObjC instance variable.
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)
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...
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
void VisitClassScopeFunctionSpecializationDecl(ClassScopeFunctionSpecializationDecl *D)
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
Writes an AST file containing the contents of a translation unit.
VarTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
const FunctionDecl * getOperatorDelete() const
TemplateParameterList * getTemplateParameterList(unsigned i) const
PropertyAttributeKind getPropertyAttributesAsWritten() const
SourceLocation getIvarRBraceLoc() const
decl_type * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
void VisitFriendDecl(FriendDecl *D)
TranslationUnitDecl - The top declaration context.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
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)
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
NamedDecl * getMostRecentDecl()
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
A FunctionTemplateDecl record.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getInnerLocStart() const
getInnerLocStart - Return SourceLocation representing start of source range ignoring outer template d...
A TypeAliasTemplateDecl record.
void VisitImportDecl(ImportDecl *D)
SourceLocation getLAngleLoc() const
An instance of this class represents the declaration of a property member.
SourceLocation getLocation() const
NamedDecl - This represents a decl with a name.
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)
Declaration of a friend template.
Represents C++ using-directive.
TypeSourceInfo * getTypeSourceInfo() const
void VisitObjCMethodDecl(ObjCMethodDecl *D)
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
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.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
void VisitObjCIvarDecl(ObjCIvarDecl *D)
ObjCCompatibleAliasDecl - Represents alias of a class.
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool hasInClassInitializer() const
hasInClassInitializer - Determine whether this member has a C++11 in-class initializer.
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
const ObjCInterfaceDecl * getSuperClass() const
const StringLiteral * getAsmString() const