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);
163 template <
typename EntryType>
172 return Common->PartialSpecializations;
178 template<
typename Decl>
180 auto *Common = D->getCommonPtr();
185 if (Writer.Chain != Writer.Context->getExternalSource() &&
186 Common->LazySpecializations) {
187 D->LoadLazySpecializations();
188 assert(!Common->LazySpecializations);
191 auto &Specializations = Common->Specializations;
192 auto &&PartialSpecializations = getPartialSpecializations(Common);
194 if (
auto *LS = Common->LazySpecializations)
197 Record.push_back(Specializations.size() +
198 PartialSpecializations.size() +
199 LazySpecializations.size());
200 for (
auto &Entry : Specializations) {
201 auto *D = getSpecializationDecl(Entry);
203 Writer.AddDeclRef(D, Record);
205 for (
auto &Entry : PartialSpecializations) {
206 auto *D = getSpecializationDecl(Entry);
208 Writer.AddDeclRef(D, Record);
210 Record.append(LazySpecializations.begin(), LazySpecializations.end());
222 Writer.AddTypeSourceInfo(DD->getTypeSourceInfo(), Record);
229 Record.push_back(FD->doesThisDeclarationHaveABody());
230 if (FD->doesThisDeclarationHaveABody())
231 AddFunctionDefinition(FD);
236 Writer.AddDeclRef(cast_or_null<Decl>(D->
getDeclContext()), Record);
241 Writer.WriteAttributes(llvm::makeArrayRef(D->
getAttrs().begin(),
244 Record.push_back(D->
isUsed(
false));
249 Record.push_back(Writer.inferSubmoduleIDFromLocation(D->
getLocation()));
261 while (
auto *NS = dyn_cast<NamespaceDecl>(DC->getRedeclContext())) {
262 if (!NS->isFromASTFile())
264 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
265 if (!NS->isInlineNamespace())
273 llvm_unreachable(
"Translation units aren't directly serialized");
278 Writer.AddDeclarationName(D->
getDeclName(), Record);
280 ? Writer.getAnonymousDeclarationNumber(D)
286 Writer.AddSourceLocation(D->
getLocStart(), Record);
291 VisitRedeclarable(D);
294 Record.push_back(D->
isModed());
300 VisitTypedefNameDecl(D);
309 AbbrevToUse = Writer.getDeclTypedefAbbrev();
315 VisitTypedefNameDecl(D);
321 VisitRedeclarable(D);
325 if (!isa<CXXRecordDecl>(D))
332 if (D->hasExtInfo()) {
334 Writer.AddQualifierInfo(*D->getExtInfo(), Record);
337 Writer.AddDeclRef(TD, Record);
338 Writer.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo(), Record);
341 Writer.AddDeclRef(DD, Record);
357 Record.push_back(D->
isFixed());
359 Writer.AddDeclRef(MemberInfo->getInstantiatedFrom(), Record);
360 Record.push_back(MemberInfo->getTemplateSpecializationKind());
361 Writer.AddSourceLocation(MemberInfo->getPointOfInstantiation(), Record);
363 Writer.AddDeclRef(
nullptr, Record);
383 AbbrevToUse = Writer.getDeclEnumAbbrev();
410 AbbrevToUse = Writer.getDeclRecordAbbrev();
417 Writer.AddTypeRef(D->
getType(), Record);
433 Record.push_back(D->hasExtInfo());
435 Writer.AddQualifierInfo(*D->getExtInfo(), Record);
439 VisitRedeclarable(D);
440 VisitDeclaratorDecl(D);
441 Writer.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record);
447 Record.push_back((
int)D->SClass);
448 Record.push_back(D->IsInline);
449 Record.push_back(D->IsInlineSpecified);
450 Record.push_back(D->IsVirtualAsWritten);
451 Record.push_back(D->IsPure);
452 Record.push_back(D->HasInheritedPrototype);
453 Record.push_back(D->HasWrittenPrototype);
454 Record.push_back(D->IsDeleted);
455 Record.push_back(D->IsTrivial);
456 Record.push_back(D->IsDefaulted);
457 Record.push_back(D->IsExplicitlyDefaulted);
458 Record.push_back(D->HasImplicitReturnZero);
459 Record.push_back(D->IsConstexpr);
460 Record.push_back(D->HasSkippedBody);
461 Record.push_back(D->IsLateTemplateParsed);
463 Writer.AddSourceLocation(D->
getLocEnd(), Record);
518 Writer.AddDeclRef(DFTSInfo->
getTemplate(i), Record);
523 Writer.AddTemplateArgumentLoc(DFTSInfo->
getTemplateArg(i), Record);
524 Writer.AddSourceLocation(DFTSInfo->
getLAngleLoc(), Record);
525 Writer.AddSourceLocation(DFTSInfo->
getRAngleLoc(), Record);
532 Writer.AddDeclRef(
P, Record);
540 bool HasBodyStuff = D->
getBody() !=
nullptr ||
542 Record.push_back(HasBodyStuff);
552 Record.push_back(D->IsOverriding);
553 Record.push_back(D->HasSkippedBody);
555 Record.push_back(D->IsRedeclaration);
556 Record.push_back(D->HasRedeclaration);
557 if (D->HasRedeclaration) {
569 Writer.AddSourceLocation(D->
getLocEnd(), Record);
571 for (
const auto *
P : D->
params())
572 Writer.AddDeclRef(
P, Record);
574 Record.push_back(D->SelLocsKind);
575 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
577 Record.push_back(NumStoredSelLocs);
578 for (
unsigned i = 0; i != NumStoredSelLocs; ++i)
579 Writer.AddSourceLocation(SelLocs[i], Record);
585 VisitTypedefNameDecl(D);
586 Record.push_back(D->Variance);
587 Record.push_back(D->Index);
588 Writer.AddSourceLocation(D->VarianceLoc, Record);
589 Writer.AddSourceLocation(D->ColonLoc, Record);
602 VisitRedeclarable(D);
603 VisitObjCContainerDecl(D);
605 AddObjCTypeParamList(D->TypeParamList);
610 ObjCInterfaceDecl::DefinitionData &Data = D->data();
614 Record.push_back(Data.HasDesignatedInitializers);
617 Record.push_back(Data.ReferencedProtocols.size());
619 Writer.AddDeclRef(
P, Record);
621 Writer.AddSourceLocation(PL, Record);
624 Record.push_back(Data.AllReferencedProtocols.size());
626 P = Data.AllReferencedProtocols.begin(),
627 PEnd = Data.AllReferencedProtocols.end();
629 Writer.AddDeclRef(*
P, Record);
634 Writer.ObjCClassesWithCategories.insert(D);
637 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
638 (
void)Writer.GetDeclRef(Cat);
660 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
666 VisitRedeclarable(D);
667 VisitObjCContainerDecl(D);
673 Writer.AddDeclRef(I, Record);
675 Writer.AddSourceLocation(PL, Record);
687 VisitObjCContainerDecl(D);
692 AddObjCTypeParamList(D->TypeParamList);
695 Writer.AddDeclRef(I, Record);
697 Writer.AddSourceLocation(PL, Record);
709 Writer.AddSourceLocation(D->
getAtLoc(), Record);
711 Writer.AddTypeRef(D->
getType(), Record);
727 VisitObjCContainerDecl(D);
733 VisitObjCImplDecl(D);
740 VisitObjCImplDecl(D);
747 Record.push_back(D->NumIvarInitializers);
748 if (D->NumIvarInitializers)
749 Writer.AddCXXCtorInitializersRef(
756 Writer.AddSourceLocation(D->
getLocStart(), Record);
766 VisitDeclaratorDecl(D);
768 if (D->InitStorage.getInt() == FieldDecl::ISK_BitWidthOrNothing &&
769 D->InitStorage.getPointer() ==
nullptr) {
771 }
else if (D->InitStorage.getInt() == FieldDecl::ISK_CapturedVLAType) {
772 Record.push_back(D->InitStorage.getInt() + 1);
774 QualType(static_cast<Type *>(D->InitStorage.getPointer()), 0),
777 Record.push_back(D->InitStorage.getInt() + 1);
778 Writer.AddStmt(static_cast<Expr *>(D->InitStorage.getPointer()));
796 AbbrevToUse = Writer.getDeclFieldAbbrev();
802 VisitDeclaratorDecl(D);
812 for (
const auto *
P : D->
chain())
813 Writer.AddDeclRef(
P, Record);
818 VisitRedeclarable(D);
819 VisitDeclaratorDecl(D);
823 if (!isa<ParmVarDecl>(D)) {
842 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
845 Record.push_back(VarTemplate);
846 Writer.AddDeclRef(TemplD, Record);
849 Record.push_back(StaticDataMemberSpecialization);
850 Writer.AddDeclRef(SpecInfo->getInstantiatedFrom(), Record);
851 Record.push_back(SpecInfo->getTemplateSpecializationKind());
852 Writer.AddSourceLocation(SpecInfo->getPointOfInstantiation(), Record);
854 Record.push_back(VarNotTemplate);
871 !isa<ParmVarDecl>(D) &&
872 !isa<VarTemplateSpecializationDecl>(D) &&
877 AbbrevToUse = Writer.getDeclVarAbbrev();
921 AbbrevToUse = Writer.getDeclParmVarAbbrev();
925 assert(!D->
getTSCSpec() &&
"PARM_VAR_DECL can't use TLS");
926 assert(D->
getAccess() ==
AS_none &&
"PARM_VAR_DECL can't be public/private");
928 assert(D->
getPreviousDecl() ==
nullptr &&
"PARM_VAR_DECL can't be redecl");
930 "PARM_VAR_DECL can't be static data member");
952 Writer.AddDeclRef(*
P, Record);
958 for (
const auto &capture : D->
captures()) {
959 Writer.AddDeclRef(capture.getVariable(), Record);
962 if (capture.isByRef()) flags |= 1;
963 if (capture.isNested()) flags |= 2;
964 if (capture.hasCopyExpr()) flags |= 4;
965 Record.push_back(flags);
967 if (capture.hasCopyExpr()) Writer.AddStmt(capture.getCopyExpr());
977 Record.push_back(CD->
isNothrow() ? 1 : 0);
980 Writer.AddDeclRef(CD->
getParam(I), Record);
994 Writer.AddSourceLocation(D->
getLocStart(), Record);
1000 VisitRedeclarable(D);
1003 Writer.AddSourceLocation(D->
getLocStart(), Record);
1016 Decl *Parent = cast<Decl>(
1018 if (Parent->
isFromASTFile() || isa<TranslationUnitDecl>(Parent)) {
1019 Writer.DeclUpdates[Parent].push_back(
1026 VisitRedeclarable(D);
1037 Writer.AddSourceLocation(D->
getUsingLoc(), Record);
1039 Writer.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record);
1040 Writer.AddDeclRef(D->FirstUsingShadow.getPointer(), Record);
1047 VisitRedeclarable(D);
1050 Writer.AddDeclRef(D->UsingOrNextShadow, Record);
1057 Writer.AddSourceLocation(D->
getUsingLoc(), Record);
1067 Writer.AddSourceLocation(D->
getUsingLoc(), Record);
1069 Writer.AddDeclarationNameLoc(D->DNLoc, D->
getDeclName(), Record);
1085 CXXRecNotTemplate = 0, CXXRecTemplate, CXXRecMemberSpecialization
1088 Record.push_back(CXXRecTemplate);
1089 Writer.AddDeclRef(TemplD, Record);
1092 Record.push_back(CXXRecMemberSpecialization);
1093 Writer.AddDeclRef(MSInfo->getInstantiatedFrom(), Record);
1094 Record.push_back(MSInfo->getTemplateSpecializationKind());
1095 Writer.AddSourceLocation(MSInfo->getPointOfInstantiation(), Record);
1097 Record.push_back(CXXRecNotTemplate);
1102 Writer.AddCXXDefinitionData(D, Record);
1106 if (D->IsCompleteDefinition)
1113 VisitFunctionDecl(D);
1119 Writer.AddDeclRef(*I, Record);
1122 Record.push_back(0);
1133 AbbrevToUse = Writer.getDeclCXXMethodAbbrev();
1139 VisitCXXMethodDecl(D);
1142 Record.push_back(D->IsExplicitSpecified);
1148 VisitCXXMethodDecl(D);
1156 VisitCXXMethodDecl(D);
1157 Record.push_back(D->IsExplicitSpecified);
1165 Record.push_back(!IdentifierLocs.empty());
1166 if (IdentifierLocs.empty()) {
1167 Writer.AddSourceLocation(D->
getLocEnd(), Record);
1168 Record.push_back(1);
1170 for (
unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1171 Writer.AddSourceLocation(IdentifierLocs[I], Record);
1172 Record.push_back(IdentifierLocs.size());
1181 Writer.AddSourceLocation(D->
getColonLoc(), Record);
1188 Record.push_back(D->NumTPLists);
1190 bool hasFriendDecl = D->Friend.is<
NamedDecl*>();
1191 Record.push_back(hasFriendDecl);
1196 for (
unsigned i = 0; i < D->NumTPLists; ++i)
1199 Writer.AddDeclRef(D->getNextFriend(), Record);
1200 Record.push_back(D->UnsupportedFriend);
1201 Writer.AddSourceLocation(D->FriendLoc, Record);
1227 VisitRedeclarable(D);
1238 VisitTemplateDecl(D);
1243 VisitRedeclarableTemplateDecl(D);
1246 AddTemplateSpecializations(D);
1252 VisitCXXRecordDecl(D);
1257 if (
Decl *InstFromD = InstFrom.dyn_cast<ClassTemplateDecl *>()) {
1258 Writer.AddDeclRef(InstFromD, Record);
1287 VisitClassTemplateSpecializationDecl(D);
1302 VisitRedeclarableTemplateDecl(D);
1305 AddTemplateSpecializations(D);
1313 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
1316 Writer.AddDeclRef(InstFromD, Record);
1345 VisitVarTemplateSpecializationDecl(D);
1368 VisitRedeclarableTemplateDecl(D);
1371 AddTemplateSpecializations(D);
1382 Record.push_back(OwnsDefaultArg);
1396 VisitDeclaratorDecl(D);
1413 Record.push_back(OwnsDefaultArg);
1427 VisitTemplateDecl(D);
1443 Record.push_back(OwnsDefaultArg);
1451 VisitRedeclarableTemplateDecl(D);
1476 uint64_t VisibleOffset) {
1477 Record.push_back(LexicalOffset);
1478 Record.push_back(VisibleOffset);
1483 template <
typename T>
1485 assert(D && !static_cast<T*>(D)->isFromASTFile());
1488 while (D && static_cast<T*>(D)->isFromASTFile());
1492 template <
typename T>
1495 T *MostRecent = First->getMostRecentDecl();
1496 if (MostRecent != First) {
1498 "Not considered redeclarable?");
1500 Writer.AddDeclRef(First, Record);
1505 unsigned I = Record.size();
1506 Record.push_back(0);
1509 Writer.Chain->forEachImportedKeyDecl(First, [&](
const Decl *D) {
1511 Writer.AddDeclRef(D, Record);
1513 Record[I] = Record.size() - I - 1;
1516 Writer.Redeclarations.push_back(Writer.Chain->getKeyDeclaration(First));
1522 Writer.Redeclarations.push_back(First);
1532 (void)Writer.GetDeclRef(MostRecent);
1535 Record.push_back(0);
1551 void ASTWriter::WriteDeclAbbrevs() {
1552 using namespace llvm;
1557 Abv =
new BitCodeAbbrev();
1560 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1561 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1562 Abv->Add(BitCodeAbbrevOp(0));
1563 Abv->Add(BitCodeAbbrevOp(0));
1564 Abv->Add(BitCodeAbbrevOp(0));
1565 Abv->Add(BitCodeAbbrevOp(0));
1566 Abv->Add(BitCodeAbbrevOp(0));
1567 Abv->Add(BitCodeAbbrevOp(0));
1568 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1569 Abv->Add(BitCodeAbbrevOp(0));
1570 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1572 Abv->Add(BitCodeAbbrevOp(0));
1573 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1574 Abv->Add(BitCodeAbbrevOp(0));
1576 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1578 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1579 Abv->Add(BitCodeAbbrevOp(0));
1581 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1582 Abv->Add(BitCodeAbbrevOp(0));
1584 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1585 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1586 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1587 DeclFieldAbbrev = Stream.EmitAbbrev(Abv);
1590 Abv =
new BitCodeAbbrev();
1593 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1594 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1595 Abv->Add(BitCodeAbbrevOp(0));
1596 Abv->Add(BitCodeAbbrevOp(0));
1597 Abv->Add(BitCodeAbbrevOp(0));
1598 Abv->Add(BitCodeAbbrevOp(0));
1599 Abv->Add(BitCodeAbbrevOp(0));
1600 Abv->Add(BitCodeAbbrevOp(0));
1601 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1602 Abv->Add(BitCodeAbbrevOp(0));
1603 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1605 Abv->Add(BitCodeAbbrevOp(0));
1606 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1607 Abv->Add(BitCodeAbbrevOp(0));
1609 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1611 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1612 Abv->Add(BitCodeAbbrevOp(0));
1614 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1615 Abv->Add(BitCodeAbbrevOp(0));
1617 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1618 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1620 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1621 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1622 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1623 DeclObjCIvarAbbrev = Stream.EmitAbbrev(Abv);
1626 Abv =
new BitCodeAbbrev();
1629 Abv->Add(BitCodeAbbrevOp(0));
1631 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1632 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1633 Abv->Add(BitCodeAbbrevOp(0));
1634 Abv->Add(BitCodeAbbrevOp(0));
1635 Abv->Add(BitCodeAbbrevOp(0));
1636 Abv->Add(BitCodeAbbrevOp(0));
1637 Abv->Add(BitCodeAbbrevOp(0));
1638 Abv->Add(BitCodeAbbrevOp(0));
1639 Abv->Add(BitCodeAbbrevOp(
AS_none));
1640 Abv->Add(BitCodeAbbrevOp(0));
1641 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1643 Abv->Add(BitCodeAbbrevOp(0));
1644 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1645 Abv->Add(BitCodeAbbrevOp(0));
1647 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1648 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1650 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1651 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1652 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1653 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1654 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1655 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1656 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1657 Abv->Add(BitCodeAbbrevOp(0));
1659 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1660 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1661 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1662 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1663 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1664 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1665 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1666 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1667 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1669 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1670 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1671 DeclEnumAbbrev = Stream.EmitAbbrev(Abv);
1674 Abv =
new BitCodeAbbrev();
1677 Abv->Add(BitCodeAbbrevOp(0));
1679 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1680 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1681 Abv->Add(BitCodeAbbrevOp(0));
1682 Abv->Add(BitCodeAbbrevOp(0));
1683 Abv->Add(BitCodeAbbrevOp(0));
1684 Abv->Add(BitCodeAbbrevOp(0));
1685 Abv->Add(BitCodeAbbrevOp(0));
1686 Abv->Add(BitCodeAbbrevOp(0));
1687 Abv->Add(BitCodeAbbrevOp(
AS_none));
1688 Abv->Add(BitCodeAbbrevOp(0));
1689 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1691 Abv->Add(BitCodeAbbrevOp(0));
1692 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1693 Abv->Add(BitCodeAbbrevOp(0));
1695 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1696 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1698 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1699 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1700 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1701 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1703 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1704 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1705 Abv->Add(BitCodeAbbrevOp(0));
1707 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1708 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1709 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1710 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1712 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1713 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1714 DeclRecordAbbrev = Stream.EmitAbbrev(Abv);
1717 Abv =
new BitCodeAbbrev();
1720 Abv->Add(BitCodeAbbrevOp(0));
1722 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1723 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1724 Abv->Add(BitCodeAbbrevOp(0));
1725 Abv->Add(BitCodeAbbrevOp(0));
1726 Abv->Add(BitCodeAbbrevOp(0));
1727 Abv->Add(BitCodeAbbrevOp(0));
1728 Abv->Add(BitCodeAbbrevOp(0));
1729 Abv->Add(BitCodeAbbrevOp(0));
1730 Abv->Add(BitCodeAbbrevOp(
AS_none));
1731 Abv->Add(BitCodeAbbrevOp(0));
1732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1734 Abv->Add(BitCodeAbbrevOp(0));
1735 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1736 Abv->Add(BitCodeAbbrevOp(0));
1738 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1740 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1741 Abv->Add(BitCodeAbbrevOp(0));
1743 Abv->Add(BitCodeAbbrevOp(0));
1744 Abv->Add(BitCodeAbbrevOp(0));
1745 Abv->Add(BitCodeAbbrevOp(0));
1746 Abv->Add(BitCodeAbbrevOp(0));
1747 Abv->Add(BitCodeAbbrevOp(0));
1748 Abv->Add(BitCodeAbbrevOp(0));
1750 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1751 Abv->Add(BitCodeAbbrevOp(0));
1752 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1753 Abv->Add(BitCodeAbbrevOp(0));
1754 Abv->Add(BitCodeAbbrevOp(0));
1755 Abv->Add(BitCodeAbbrevOp(0));
1756 Abv->Add(BitCodeAbbrevOp(0));
1758 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1759 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1760 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1761 DeclParmVarAbbrev = Stream.EmitAbbrev(Abv);
1764 Abv =
new BitCodeAbbrev();
1767 Abv->Add(BitCodeAbbrevOp(0));
1769 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1770 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1771 Abv->Add(BitCodeAbbrevOp(0));
1772 Abv->Add(BitCodeAbbrevOp(0));
1773 Abv->Add(BitCodeAbbrevOp(0));
1774 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1775 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1776 Abv->Add(BitCodeAbbrevOp(0));
1777 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1778 Abv->Add(BitCodeAbbrevOp(0));
1779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1781 Abv->Add(BitCodeAbbrevOp(0));
1782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1783 Abv->Add(BitCodeAbbrevOp(0));
1785 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1786 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1788 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1789 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1790 DeclTypedefAbbrev = Stream.EmitAbbrev(Abv);
1793 Abv =
new BitCodeAbbrev();
1796 Abv->Add(BitCodeAbbrevOp(0));
1798 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1799 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1800 Abv->Add(BitCodeAbbrevOp(0));
1801 Abv->Add(BitCodeAbbrevOp(0));
1802 Abv->Add(BitCodeAbbrevOp(0));
1803 Abv->Add(BitCodeAbbrevOp(0));
1804 Abv->Add(BitCodeAbbrevOp(0));
1805 Abv->Add(BitCodeAbbrevOp(0));
1806 Abv->Add(BitCodeAbbrevOp(
AS_none));
1807 Abv->Add(BitCodeAbbrevOp(0));
1808 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1810 Abv->Add(BitCodeAbbrevOp(0));
1811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1812 Abv->Add(BitCodeAbbrevOp(0));
1814 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1816 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1817 Abv->Add(BitCodeAbbrevOp(0));
1819 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1820 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1821 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1822 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1823 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1825 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1826 Abv->Add(BitCodeAbbrevOp(0));
1827 Abv->Add(BitCodeAbbrevOp(0));
1828 Abv->Add(BitCodeAbbrevOp(0));
1829 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1830 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1831 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1833 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1834 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1835 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1836 DeclVarAbbrev = Stream.EmitAbbrev(Abv);
1839 Abv =
new BitCodeAbbrev();
1842 Abv->Add(BitCodeAbbrevOp(0));
1844 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1845 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1846 Abv->Add(BitCodeAbbrevOp(0));
1847 Abv->Add(BitCodeAbbrevOp(0));
1848 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1849 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1850 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1851 Abv->Add(BitCodeAbbrevOp(0));
1852 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1853 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1854 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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));
1865 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
1866 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1867 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1868 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1870 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1871 Abv->Add(BitCodeAbbrevOp(0));
1872 Abv->Add(BitCodeAbbrevOp(1));
1873 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1874 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1875 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1876 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1877 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1878 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1879 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1880 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1881 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1882 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1883 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1892 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
1893 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1894 DeclCXXMethodAbbrev = Stream.EmitAbbrev(Abv);
1897 Abv =
new BitCodeAbbrev();
1901 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1902 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1903 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1904 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1905 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1907 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1909 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1910 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1911 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1912 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1913 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
1915 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1916 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1917 DeclRefExprAbbrev = Stream.EmitAbbrev(Abv);
1920 Abv =
new BitCodeAbbrev();
1924 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1925 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1926 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1927 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1928 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1929 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1930 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1932 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1933 Abv->Add(BitCodeAbbrevOp(32));
1934 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1935 IntegerLiteralAbbrev = Stream.EmitAbbrev(Abv);
1938 Abv =
new BitCodeAbbrev();
1942 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1943 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1944 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1945 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1946 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
1947 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1948 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
1950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1951 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
1952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2));
1953 CharacterLiteralAbbrev = Stream.EmitAbbrev(Abv);
1956 Abv =
new BitCodeAbbrev();
1960 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
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::Fixed, 3));
1968 Abv->Add(BitCodeAbbrevOp(0));
1969 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 6));
1971 ExprImplicitCastAbbrev = Stream.EmitAbbrev(Abv);
1973 Abv =
new BitCodeAbbrev();
1975 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
1976 DeclContextLexicalAbbrev = Stream.EmitAbbrev(Abv);
1978 Abv =
new BitCodeAbbrev();
1980 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
1981 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
1982 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(Abv);
2004 if (isa<FileScopeAsmDecl>(D) || isa<ObjCImplDecl>(D) || isa<ImportDecl>(D))
2012 ClearSwitchCaseIDs();
2020 assert(isRewritten(D) &&
"should not be emitting imported decl");
2030 bool isReplacingADecl = ID < FirstDeclID;
2037 uint64_t LexicalOffset = 0;
2038 uint64_t VisibleOffset = 0;
2041 if (isReplacingADecl) {
2045 DC->LoadLexicalDeclsFromExternalStorage();
2047 Chain->completeVisibleDeclsMap(DC);
2049 LexicalOffset = WriteDeclContextLexicalBlock(Context, DC);
2050 VisibleOffset = WriteDeclContextVisibleBlock(Context, DC);
2053 if (isReplacingADecl) {
2055 ReplacedDecls.push_back(ReplacedDeclInfo(ID, Stream.GetCurrentBitNo(),
2058 unsigned Index = ID - FirstDeclID;
2062 if (DeclOffsets.size() == Index)
2063 DeclOffsets.push_back(
DeclOffset(Loc, Stream.GetCurrentBitNo()));
2064 else if (DeclOffsets.size() < Index) {
2065 DeclOffsets.resize(Index+1);
2066 DeclOffsets[Index].setLocation(Loc);
2067 DeclOffsets[Index].BitOffset = Stream.GetCurrentBitNo();
2072 associateDeclWithFile(D, ID);
2080 if (DC) W.VisitDeclContext(DC, LexicalOffset, VisibleOffset);
2083 llvm::report_fatal_error(StringRef(
"unexpected declaration kind '") +
2085 Stream.EmitRecord(W.Code, Record, W.AbbrevToUse);
2089 FlushPendingAfterDecl();
2094 EagerlyDeserializedDecls.push_back(ID);
2097 void ASTWriter::AddFunctionDefinition(
const FunctionDecl *FD,
2098 RecordData &Record) {
2099 ClearSwitchCaseIDs();
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
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
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)
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
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 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...
const Expr * getInitExpr() const
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
void VisitCXXRecordDecl(CXXRecordDecl *D)
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
An ImplicitCastExpr record.
chain_range chain() const
A VarTemplatePartialSpecializationDecl record.
param_iterator param_end()
Defines the C++ template declaration subclasses.
bool hasFlexibleArrayMember() const
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
Expr * getSetterCXXAssignment() const
Declaration of a redeclarable template.
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
bool capturesCXXThis() const
SourceLocation getRParenLoc() const
static bool isRequiredDecl(const Decl *D, ASTContext &Context)
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
TypeSourceInfo * getSuperClassTInfo() const
Represents a variable template specialization, which refers to a variable template with a given set o...
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack...
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
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
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
TypeSourceInfo * getTypeSourceInfo() const
TypeSourceInfo * getFriendType() 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 VisitCXXDestructorDecl(CXXDestructorDecl *D)
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
bool isCompleteDefinition() const
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
TypeSourceInfo * getFriendType() const
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
Stmt * getBody() const override
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
bool isThisDeclarationADefinition() const
SourceLocation getCategoryNameLoc() const
StorageClass getStorageClass() const
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage.
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
const LangOptions & getLangOpts() const
protocol_loc_range protocol_locs() const
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.
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()
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember()
Retrieve the member class template partial specialization from which this particular class template p...
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.
PropertyAttributeKind getPropertyAttributes() const
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
unsigned getNumParams() const
SourceRange getAtEndRange() const
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)
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
void VisitObjCContainerDecl(ObjCContainerDecl *D)
SourceLocation getLocStart() const LLVM_READONLY
RecordDecl * getMostRecentDecl()
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. Contains type source information through TypeSo...
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.
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
An ObjCTypeParamDecl record.
bool hasDestructors() const
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
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
ObjCIvarDecl * getPropertyIvarDecl() const
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs. The actual template arguments (if any) are stored a...
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.
Represents a C++ destructor within a class.
A CXXConstructorDecl record.
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
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.
Expr * getUninstantiatedDefaultArg()
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
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. This is not the linkage as defined by the standard or...
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)
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace. This is false for non-original (subsequent) namespace declarations and anonymous namespaces.
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
SourceLocation getLocStart() const LLVM_READONLY
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
bool doesThisDeclarationHaveABody() const
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. The SourceManager can decode this to get at the full include stack...
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
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
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.
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.
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.
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
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.
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
bool isInvalidDecl() const
void VisitNamedDecl(NamedDecl *D)
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. (Microsoft extension).
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.
SourceLocation LAngleLoc
The source location of the left angle bracket ('<').
unsigned getFunctionScopeDepth() const
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
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember()
Retrieve the member variable template partial specialization from which this particular variable temp...
void VisitNamespaceDecl(NamespaceDecl *D)
ObjCMethodDecl * getGetterMethodDecl() const
bool hasNonZeroConstructors() const
void VisitVarDecl(VarDecl *D)
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum. These widths include the rightmost leading 1; that is:
NamedDecl * getFriendDecl() const
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member. If the point of instantiation is an invalid...
ObjCMethodDecl * getSetterMethodDecl() const
QualType getIntegerType() const
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()
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)...
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)
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
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. A pseudo-__strong variable has a ...
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
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...
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)
DeclaratorDecl * getDeclaratorForAnonDecl() const
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 FunctionDecl * getOperatorDelete() const
TemplateParameterList * getTemplateParameterList(unsigned i) const
PropertyAttributeKind getPropertyAttributesAsWritten() const
static Decl::Kind getKind(const Decl *D)
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...
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace nested inside this namespace, if any.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization, retrieves the member specialization information.
bool isInitKnownICE() const
Determines whether it is already known whether the initializer is an integral constant expression or ...
NamedDecl * getMostRecentDecl()
DeclContext * getPrimaryContext()
A FunctionTemplateDecl record.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getInnerLocStart() const
A TypeAliasTemplateDecl record.
void VisitImportDecl(ImportDecl *D)
SourceLocation getLAngleLoc() const
static bool isFirstLocalDecl(Redeclarable< T > *D)
bool isInitICE() const
Determines whether the initializer is an integral constant expression, or in C++11, whether the initializer is a constant expression.
SourceLocation getLocation() const
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. For example, in the following, both 'a' and 'A::b' are threadprivate:
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)
bool isMutable() const
isMutable - Determines whether this field is mutable (C++ only).
bool hasInClassInitializer() const
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
const ObjCInterfaceDecl * getSuperClass() const
const StringLiteral * getAsmString() const