clang: lib/Serialization/ASTWriterDecl.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
24#include "llvm/Bitstream/BitstreamWriter.h"
25#include "llvm/Support/ErrorHandling.h"
26using namespace clang;
28
29
30
31
32
33namespace {
34
35
36
37template bool isDefinitionInDependentContext(DT *D) {
38 return D->isDependentContext() && D->isThisDeclarationADefinition();
39}
40
41}
42
43
44
45
46
51
53 unsigned AbbrevToUse;
54
55 bool GeneratingReducedBMI = false;
56
57 public:
60 : Writer(Writer), Record(Context, Writer, Record),
62 GeneratingReducedBMI(GeneratingReducedBMI) {}
63
65 if (!Code)
66 llvm::report_fatal_error(StringRef("unexpected declaration kind '") +
68 return Record.Emit(Code, AbbrevToUse);
69 }
70
72
155
156
177
180
181
183
184 if (!typeParams) {
185 Record.push_back(0);
186 return;
187 }
188
189 Record.push_back(typeParams->size());
190 for (auto *typeParam : *typeParams) {
191 Record.AddDeclRef(typeParam);
192 }
193 Record.AddSourceLocation(typeParams->getLAngleLoc());
194 Record.AddSourceLocation(typeParams->getRAngleLoc());
195 }
196
197
198
200 const Decl *D, bool IncludeLocal,
201 llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
202
203
205 if (R->isFromASTFile())
206 Firsts[Writer.Chain->getOwningModuleFile(R)] = R;
207 else if (IncludeLocal)
208 Firsts[nullptr] = R;
209 }
210 }
211
212
213
214
216 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
218
219 for (const auto &F : Firsts)
220 Record.AddDeclRef(F.second);
221 }
222
224
225
226 if (!GeneratingReducedBMI)
227 return false;
228
231
233 if (auto *CTSD = dyn_cast(Spec))
234 Args = CTSD->getTemplateArgs().asArray();
235 else if (auto *VTSD = dyn_cast(Spec))
236 Args = VTSD->getTemplateArgs().asArray();
237 else
239 ->getTemplateSpecializationArgs()
240 ->asArray();
241
242
243
244
246 switch (TA.getKind()) {
248 Linkage L = TA.getAsType()->getLinkage();
250 return true;
251 break;
252 }
254 if (!TA.getAsDecl()->isExternallyVisible())
255 return true;
256 break;
257 default:
258 break;
259 }
260 }
261
262 return false;
263 }
264
265
266
267
268
274 "Must not be called with other decls");
275 llvm::MapVector<ModuleFile *, const Decl *> Firsts;
277
278 for (const auto &F : Firsts) {
280 continue;
281
284 PartialSpecsInMap.push_back(F.second);
285 else
286 SpecsInMap.push_back(F.second);
287 }
288 }
289
290
291 template
296
297
298 template
300 return Common->PartialSpecializations;
301 }
306
307 template
309 auto *Common = D->getCommonPtr();
310
311
312
313
314 if (Writer.Chain != Record.getASTContext().getExternalSource() &&
315 Writer.Chain && Writer.Chain->haveUnloadedSpecializations(D)) {
316 D->LoadLazySpecializations();
317 assert(!Writer.Chain->haveUnloadedSpecializations(D));
318 }
319
320
321
323 for (auto &Entry : Common->Specializations)
327
330 for (auto *D : AllSpecs) {
331 assert(D->isCanonicalDecl() && "non-canonical decl in set");
333 }
334
335 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
336 D, Specs, false));
337
338
340 assert(PartialSpecs.empty());
341 return;
342 }
343
344 Record.AddOffset(Writer.WriteSpecializationInfoLookupTable(
345 D, PartialSpecs, true));
346 }
347
348
349
353
354
355
356
357
358 if (->isFromASTFile())
359 return;
360
361
362
364 return;
365
370 else
373 }
374 };
375}
376
377
378
379
380
383 return false;
384
386 return false;
387
389 if (!M)
390 return false;
391
395 (!VD->hasAttr() ||
396 !Ctx.getLangOpts().BuildingPCHWithObjectFile))
397 return false;
398
400}
401
404 return false;
405
409 (FD->hasAttr() &&
410 Ctx.getLangOpts().BuildingPCHWithObjectFile))
411
412
415 return true;
416
418 if (!M)
419 return false;
420
424 return true;
425
426 return false;
427}
428
430 if (auto *FD = dyn_cast(D)) {
431 if (FD->isInlined() || FD->isConstexpr() || FD->isConsteval())
432 return false;
433
434
435
437 return false;
438 }
439
440 if (auto *VD = dyn_cast(D)) {
441 if (VD->getDeclContext()->isDependentContext())
442 return false;
443
444
445
446
447 if (VD->hasConstantInitialization() || VD->isConstexpr())
448 return false;
449
450
451
453 return false;
454 }
455
456 return true;
457}
458
461
462
463
464
465 if (auto *DD = dyn_cast(D)) {
466 if (auto *TInfo = DD->getTypeSourceInfo())
467 Record.AddTypeLoc(TInfo->getTypeLoc());
468 }
469
470
471
472
473 if (auto *FD = dyn_cast(D)) {
475 Record.push_back(FD->doesThisDeclarationHaveABody());
476 if (FD->doesThisDeclarationHaveABody())
477 Record.AddFunctionDefinition(FD);
478 } else
479 Record.push_back(0);
480 }
481
482
483
484
485
486 if (auto *VD = dyn_cast(D)) {
488 Record.AddVarDeclInit(VD);
489 else
490 Record.push_back(0);
491 }
492
493
494
495 if (auto *FD = dyn_cast(D)) {
496 if (FD->hasInClassInitializer()) {
497 if (Expr *Init = FD->getInClassInitializer()) {
498 Record.push_back(1);
499 Record.AddStmt(Init);
500 } else {
501 Record.push_back(0);
502
503 }
504 }
505 }
506
507
508
509
510 if (auto *DC = dyn_cast(D))
512}
513
516
517
518
519
520
521
522
523
524
525
535 Record.push_back(DeclBits);
536
537 Record.AddDeclRef(cast_or_null(D->getDeclContext()));
540
542 Record.AddAttributes(D->getAttrs());
543
544 Record.push_back(Writer.getSubmoduleID(D->getOwningModule()));
545
546
547
548
549
550
551
552
553
556 while (auto *NS = dyn_cast(DC->getRedeclContext())) {
557 if (!NS->isFromASTFile())
558 break;
559 Writer.UpdatedDeclContexts.insert(NS->getPrimaryContext());
560 if (!NS->isInlineNamespace())
561 break;
562 DC = NS->getParent();
563 }
564 }
565}
566
568 StringRef Arg = D->getArg();
569 Record.push_back(Arg.size());
571 Record.AddSourceLocation(D->getBeginLoc());
573 Record.AddString(Arg);
575}
576
579 StringRef Name = D->getName();
581 Record.push_back(Name.size() + 1 + Value.size());
583 Record.AddSourceLocation(D->getBeginLoc());
584 Record.AddString(Name);
585 Record.AddString(Value);
587}
588
590 llvm_unreachable("Translation units aren't directly serialized");
591}
592
595 Record.AddDeclarationName(D->getDeclName());
597 ? Writer.getAnonymousDeclarationNumber(D)
598 : 0);
599}
600
607
612 Record.push_back(D->isModed());
616}
617
629 AbbrevToUse = Writer.getDeclTypedefAbbrev();
630
632}
633
639
642 "You need to update the serializer after you change the "
643 "TagDeclBits");
644
648
650 TagDeclBits.addBits(llvm::to_underlying(D->getTagKind()), 3);
657 2);
658 Record.push_back(TagDeclBits);
659
661
662 if (D->hasExtInfo()) {
663 Record.AddQualifierInfo(*D->getExtInfo());
665 Record.AddDeclRef(TD);
666 Record.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo());
667 }
668}
669
672 "You need to update the serializer after you change the "
673 "EnumDeclBits");
674
680
687 Record.push_back(EnumDeclBits);
688
690
692 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
693 Record.push_back(MemberInfo->getTemplateSpecializationKind());
694 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
695 } else {
696 Record.AddDeclRef(nullptr);
697 }
698
708 AbbrevToUse = Writer.getDeclEnumAbbrev();
709
711}
712
715 "You need to update the serializer after you change the "
716 "RecordDeclBits");
717
719
734 Record.push_back(RecordDeclBits);
735
736
737
740
749 AbbrevToUse = Writer.getDeclRecordAbbrev();
750
752}
753
756 Record.AddTypeRef(D->getType());
757}
758
761 Record.push_back(D->getInitExpr()? 1 : 0);
765
767}
768
772 Record.push_back(D->hasExtInfo());
773 if (D->hasExtInfo()) {
774 DeclaratorDecl::ExtInfo *Info = D->getExtInfo();
775 Record.AddQualifierInfo(*Info);
776 Record.AddStmt(
778 Record.writeUnsignedOrNone(Info->TrailingRequiresClause.ArgPackSubstIndex);
779 }
780
783}
784
787 "You need to update the serializer after you change the "
788 "FunctionDeclBits");
789
791
795 break;
798 break;
801 break;
807 break;
808 }
812
814
815 Record.AddDeclRef(FTSInfo->getTemplate());
817
818
820
821
824 Record.AddASTTemplateArgumentListInfo(
826
828
831 Record.push_back(1);
832 Record.AddDeclRef(MemberInfo->getInstantiatedFrom());
833 Record.push_back(MemberInfo->getTemplateSpecializationKind());
834 Record.AddSourceLocation(MemberInfo->getPointOfInstantiation());
835 } else {
836 Record.push_back(0);
837 }
838
840
841
843 }
844 break;
845 }
849
850
851 Record.push_back(DFTSInfo->getCandidates().size());
853 Record.AddDeclRef(FTD);
854
855
858 Record.AddASTTemplateArgumentListInfo(
860 break;
861 }
862 }
863
865 Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName());
867
868
869
870
872
882 FunctionDeclBits.addBit(D->isDeletedBit());
897 Record.push_back(FunctionDeclBits);
898
899 Record.AddSourceLocation(D->getEndLoc());
902
904
907
908
909 StringLiteral *DeletedMessage = FDI->getDeletedMessage();
910 Record.push_back(1 | (DeletedMessage ? 2 : 0));
911 if (DeletedMessage)
912 Record.AddStmt(DeletedMessage);
913
914 Record.push_back(FDI->getUnqualifiedLookups().size());
915 for (DeclAccessPair P : FDI->getUnqualifiedLookups()) {
916 Record.AddDeclRef(P.getDecl());
917 Record.push_back(P.getAccess());
918 }
919 } else {
920 Record.push_back(0);
921 }
922 }
923
925
926
927
928 if (auto *RD = dyn_cast(D->getLexicalParent());
929 RD && isDefinitionInDependentContext(RD)) {
930 Writer.RelatedDeclsMap[Writer.GetDeclRef(RD)].push_back(
931 Writer.GetDeclRef(D));
932 }
933 }
934
937 Record.AddDeclRef(P);
939}
940
943 uint64_t Kind = static_cast<uint64_t>(ES.getKind());
944 Kind = Kind << 1 | static_cast(ES.getExpr());
945 Record.push_back(Kind);
948 }
949}
950
953 Record.AddDeclRef(D->Ctor);
957 Record.push_back(
960}
961
964 "You need to update the serializer after you change the "
965 "ObjCMethodDeclBits");
966
968
969
970 bool HasBodyStuff = D->getBody() != nullptr;
971 Record.push_back(HasBodyStuff);
972 if (HasBodyStuff) {
973 Record.AddStmt(D->getBody());
974 }
981 Record.push_back(D->isDefined());
984
988 assert(Record.getASTContext().getObjCMethodRedeclaration(D));
989 Record.AddDeclRef(Record.getASTContext().getObjCMethodRedeclaration(D));
990 }
991
992
994
999 Record.AddSourceLocation(D->getEndLoc());
1001 for (const auto *P : D->parameters())
1002 Record.AddDeclRef(P);
1003
1004 Record.push_back(D->getSelLocsKind());
1005 unsigned NumStoredSelLocs = D->getNumStoredSelLocs();
1007 Record.push_back(NumStoredSelLocs);
1008 for (unsigned i = 0; i != NumStoredSelLocs; ++i)
1009 Record.AddSourceLocation(SelLocs[i]);
1010
1012}
1013
1016 Record.push_back(D->Variance);
1017 Record.push_back(D->Index);
1018 Record.AddSourceLocation(D->VarianceLoc);
1019 Record.AddSourceLocation(D->ColonLoc);
1020
1022}
1023
1026 "You need to update the serializer after you change the "
1027 "ObjCContainerDeclBits");
1028
1032
1033}
1034
1040
1043
1044 ObjCInterfaceDecl::DefinitionData &Data = D->data();
1045
1048 Record.push_back(Data.HasDesignatedInitializers);
1050
1051
1052 Record.push_back(Data.ReferencedProtocols.size());
1053 for (const auto *P : D->protocols())
1054 Record.AddDeclRef(P);
1056 Record.AddSourceLocation(PL);
1057
1058
1059 Record.push_back(Data.AllReferencedProtocols.size());
1061 P = Data.AllReferencedProtocols.begin(),
1062 PEnd = Data.AllReferencedProtocols.end();
1063 P != PEnd; ++P)
1064 Record.AddDeclRef(*P);
1065
1066
1068
1069 Writer.ObjCClassesWithCategories.insert(D);
1070
1071
1072 for (; Cat; Cat = Cat->getNextClassCategoryRaw())
1073 (void)Writer.GetDeclRef(Cat);
1074 }
1075 }
1076
1078}
1079
1082
1085
1089 !D->isUsed(false) &&
1094 !D->hasExtInfo() &&
1096 AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
1097
1099}
1100
1104
1108 for (const auto *I : D->protocols())
1109 Record.AddDeclRef(I);
1111 Record.AddSourceLocation(PL);
1113 }
1114
1116}
1117
1122
1131 for (const auto *I : D->protocols())
1132 Record.AddDeclRef(I);
1134 Record.AddSourceLocation(PL);
1136}
1137
1143
1146 Record.AddSourceLocation(D->getAtLoc());
1147 Record.AddSourceLocation(D->getLParenLoc());
1148 Record.AddTypeRef(D->getType());
1150
1153
1163}
1164
1170
1176
1185 Record.push_back(D->NumIvarInitializers);
1186 if (D->NumIvarInitializers)
1187 Record.AddCXXCtorInitializers(
1190}
1191
1204
1207 Record.push_back(D->isMutable());
1208
1209 Record.push_back((D->StorageKind << 1) | D->BitField);
1210 if (D->StorageKind == FieldDecl::ISK_CapturedVLAType)
1212 else if (D->BitField)
1214
1216 Record.AddDeclRef(
1217 Record.getASTContext().getInstantiatedFromUnnamedFieldDecl(D));
1218
1222 !D->isUsed(false) &&
1230 !D->hasExtInfo() &&
1234 AbbrevToUse = Writer.getDeclFieldAbbrev();
1235
1237}
1238
1245
1249 Record.push_back(Parts.Part1);
1250 Record.push_back(Parts.Part2);
1251 Record.push_back(Parts.Part3);
1252 Record.append(std::begin(Parts.Part4And5), std::end(Parts.Part4And5));
1254}
1255
1259 Record.AddAPValue(D->getValue());
1261}
1262
1265 Record.AddAPValue(D->getValue());
1267}
1268
1272
1273 for (const auto *P : D->chain())
1274 Record.AddDeclRef(P);
1276}
1277
1281
1282
1283
1284
1287 3);
1288
1290 VarDeclBits.addBit(ModulesCodegen);
1291
1296
1297 bool HasDeducedType = false;
1303
1309
1312 VarDeclBits.addBit(HasDeducedType);
1313
1314 if (const auto *IPD = dyn_cast(D))
1315 VarDeclBits.addBits(llvm::to_underlying(IPD->getParameterKind()),
1316 3);
1317 else
1318 VarDeclBits.addBits(0, 3);
1319
1322 }
1323
1324 Record.push_back(VarDeclBits);
1325
1326 if (ModulesCodegen)
1327 Writer.AddDeclRef(D, Writer.ModularCodegenDecls);
1328
1329 if (D->hasAttr()) {
1331 Record.AddStmt(Init.getCopyExpr());
1332 if (Init.getCopyExpr())
1333 Record.push_back(Init.canThrow());
1334 }
1335
1336 enum {
1337 VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization
1338 };
1341 Record.AddDeclRef(TemplD);
1344 Record.push_back(StaticDataMemberSpecialization);
1345 Record.AddDeclRef(SpecInfo->getInstantiatedFrom());
1346 Record.push_back(SpecInfo->getTemplateSpecializationKind());
1347 Record.AddSourceLocation(SpecInfo->getPointOfInstantiation());
1348 } else {
1349 Record.push_back(VarNotTemplate);
1350 }
1351
1364 AbbrevToUse = Writer.getDeclVarAbbrev();
1365
1367}
1368
1373
1376
1377
1378
1379
1381
1385
1391 Record.push_back(ParmVarDeclBits);
1392
1398
1399
1400
1401
1406 D->getInit() == nullptr)
1407 AbbrevToUse = Writer.getDeclParmVarAbbrev();
1408
1409
1410
1411 assert(!D->getTSCSpec() && "PARM_VAR_DECL can't use TLS");
1413 && "PARM_VAR_DECL can't be demoted definition.");
1414 assert(D->getAccess() == AS_none && "PARM_VAR_DECL can't be public/private");
1415 assert(!D->isExceptionVariable() && "PARM_VAR_DECL can't be exception var");
1416 assert(D->getPreviousDecl() == nullptr && "PARM_VAR_DECL can't be redecl");
1418 "PARM_VAR_DECL can't be static data member");
1419}
1420
1422
1423 Record.push_back(D->bindings().size());
1424
1426 for (auto *B : D->bindings())
1427 Record.AddDeclRef(B);
1429}
1430
1436
1443
1446 Record.AddStmt(D->getStmt());
1448}
1449
1454
1460 Record.push_back(static_cast<bool>(D->getValue()));
1462 Record.AddAPValue(*D->getValue());
1465}
1468 Record.AddStmt(D->getBody());
1472 Record.AddDeclRef(P);
1480 for (const auto &capture : D->captures()) {
1481 Record.AddDeclRef(capture.getVariable());
1482
1483 unsigned flags = 0;
1484 if (capture.isByRef()) flags |= 1;
1485 if (capture.isNested()) flags |= 2;
1486 if (capture.hasCopyExpr()) flags |= 4;
1487 Record.push_back(flags);
1488
1489 if (capture.hasCopyExpr()) Record.AddStmt(capture.getCopyExpr());
1490 }
1491
1493}
1494
1498 for (unsigned I = 0; I < D->getNumParams(); ++I)
1499 Record.AddDeclRef(D->getParam(I));
1500 Record.push_back(D->isNothrow() ? 1 : 0);
1501 Record.AddStmt(D->getBody());
1503}
1504
1509 Record.push_back(CD->isNothrow() ? 1 : 0);
1510
1511 for (unsigned I = 0; I < CD->getNumParams(); ++I)
1512 Record.AddDeclRef(CD->getParam(I));
1514}
1515
1518 "You need to update the serializer after you change the"
1519 "LinkageSpecDeclBits");
1520
1522 Record.push_back(llvm::to_underlying(D->getLanguage()));
1523 Record.AddSourceLocation(D->getExternLoc());
1524 Record.AddSourceLocation(D->getRBraceLoc());
1526}
1527
1533
1539
1540
1544
1548 Record.push_back(NamespaceDeclBits);
1549
1550 Record.AddSourceLocation(D->getBeginLoc());
1551 Record.AddSourceLocation(D->getRBraceLoc());
1552
1556
1559
1560
1561
1562
1566 Writer.DeclUpdates[Parent].push_back(
1568 }
1569 }
1570}
1571
1581
1584 Record.AddSourceLocation(D->getUsingLoc());
1586 Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName());
1587 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1589 Record.AddDeclRef(Record.getASTContext().getInstantiatedFromUsingDecl(D));
1591}
1592
1595 Record.AddSourceLocation(D->getUsingLoc());
1596 Record.AddSourceLocation(D->getEnumLoc());
1597 Record.AddTypeSourceInfo(D->getEnumType());
1598 Record.AddDeclRef(D->FirstUsingShadow.getPointer());
1599 Record.AddDeclRef(Record.getASTContext().getInstantiatedFromUsingEnumDecl(D));
1601}
1602
1604 Record.push_back(D->NumExpansions);
1608 Record.AddDeclRef(E);
1610}
1611
1617 Record.AddDeclRef(D->UsingOrNextShadow);
1618 Record.AddDeclRef(
1619 Record.getASTContext().getInstantiatedFromUsingShadowDecl(D));
1620
1625 AbbrevToUse = Writer.getDeclUsingShadowAbbrev();
1626
1628}
1629
1633 Record.AddDeclRef(D->NominatedBaseClassShadowDecl);
1634 Record.AddDeclRef(D->ConstructedBaseClassShadowDecl);
1635 Record.push_back(D->IsVirtual);
1637}
1638
1648
1651 Record.AddSourceLocation(D->getUsingLoc());
1653 Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName());
1656}
1657
1666
1672
1675
1676 enum {
1677 CXXRecNotTemplate = 0,
1678 CXXRecTemplate,
1679 CXXRecMemberSpecialization,
1680 CXXLambda
1681 };
1683 Record.push_back(CXXRecTemplate);
1684 Record.AddDeclRef(TemplD);
1687 Record.push_back(CXXRecMemberSpecialization);
1688 Record.AddDeclRef(MSInfo->getInstantiatedFrom());
1689 Record.push_back(MSInfo->getTemplateSpecializationKind());
1690 Record.AddSourceLocation(MSInfo->getPointOfInstantiation());
1692
1693 Record.push_back(CXXLambda);
1695 Record.AddDeclRef(Context);
1697 } else {
1698 Record.push_back(0);
1699 }
1700
1701
1702 if (auto *FD = llvm::dyn_cast_or_null(D->getDeclContext());
1703 FD && isDefinitionInDependentContext(FD)) {
1704 Writer.RelatedDeclsMap[Writer.GetDeclRef(FD)].push_back(
1706 }
1707 } else {
1708 Record.push_back(CXXRecNotTemplate);
1709 }
1710
1713 Record.AddCXXDefinitionData(D);
1714
1716 Writer.AddDeclRef(D, Writer.ModularCodegenDecls);
1717
1718
1719
1720
1721
1722
1724 Record.AddDeclRef(Record.getASTContext().getCurrentKeyFunction(D));
1725
1727}
1728
1734 Record.AddDeclRef(MD);
1735 } else {
1736
1737 Record.push_back(0);
1738 }
1739
1749 AbbrevToUse = Writer.getDeclCXXMethodAbbrev(D->getTemplatedKind());
1754
1760 AbbrevToUse = Writer.getDeclCXXMethodAbbrev(D->getTemplatedKind());
1761 }
1767 AbbrevToUse = Writer.getDeclCXXMethodAbbrev(D->getTemplatedKind());
1768 }
1769 }
1770
1772}
1773
1776 "You need to update the serializer after you change the "
1777 "CXXConstructorDeclBits");
1778
1779 Record.push_back(D->getTrailingAllocKind());
1782 Record.AddDeclRef(Inherited.getShadowDecl());
1783 Record.AddDeclRef(Inherited.getConstructor());
1784 }
1785
1788}
1789
1802
1808
1811 Record.push_back(Writer.getSubmoduleID(D->getImportedModule()));
1813 Record.push_back(!IdentifierLocs.empty());
1814 if (IdentifierLocs.empty()) {
1815 Record.AddSourceLocation(D->getEndLoc());
1816 Record.push_back(1);
1817 } else {
1818 for (unsigned I = 0, N = IdentifierLocs.size(); I != N; ++I)
1819 Record.AddSourceLocation(IdentifierLocs[I]);
1820 Record.push_back(IdentifierLocs.size());
1821 }
1822
1823
1825}
1826
1832
1834
1835
1836 Record.push_back(D->NumTPLists);
1839 Record.push_back(hasFriendDecl);
1840 if (hasFriendDecl)
1842 else
1844 for (unsigned i = 0; i < D->NumTPLists; ++i)
1846 Record.AddDeclRef(D->getNextFriend());
1847 Record.push_back(D->UnsupportedFriend);
1848 Record.AddSourceLocation(D->FriendLoc);
1849 Record.AddSourceLocation(D->EllipsisLoc);
1851}
1852
1866
1873
1879
1885 Record.AddTemplateArgument(Arg);
1887}
1888
1892
1895
1896
1897
1899
1903 }
1904
1907}
1908
1911
1914
1915
1916
1917 if (Writer.isGeneratingReducedBMI()) {
1918 auto Name =
1919 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(D);
1921 Writer.GetDeclRef(DG->getCanonicalDecl());
1922 }
1923
1925}
1926
1930
1932
1937 Record.AddDeclRef(InstFromD);
1938 } else {
1941 }
1942
1948
1950
1952 }
1953
1962 }
1963
1966 Record.push_back(!!ArgsWritten);
1967 if (ArgsWritten)
1968 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
1969
1970
1971
1972
1973
1974
1975 if (Writer.isWritingStdCXXNamedModules()) {
1976 auto Name =
1977 Record.getASTContext().DeclarationNames.getCXXDeductionGuideName(
1980 Writer.GetDeclRef(DG->getCanonicalDecl());
1981 }
1982
1984}
1985
1989
1991
1992
1996 }
1997
1999}
2000
2008
2012
2013 llvm::PointerUnion<VarTemplateDecl *, VarTemplatePartialSpecializationDecl *>
2016 Record.AddDeclRef(InstFromD);
2017 } else {
2020 }
2021
2030 }
2031
2034 Record.push_back(!!ArgsWritten);
2035 if (ArgsWritten)
2036 Record.AddASTTemplateArgumentListInfo(ArgsWritten);
2037
2041 Record.push_back(D->IsCompleteDefinition);
2042
2044
2046
2048
2050 }
2051
2053}
2054
2058
2060
2061
2065 }
2066
2068}
2069
2077
2081
2083
2086 Record.push_back(TC != nullptr);
2087 if (TC) {
2089 Record.push_back(CR != nullptr);
2090 if (CR)
2091 Record.AddConceptReference(CR);
2095 }
2096
2099 Record.push_back(OwnsDefaultArg);
2100 if (OwnsDefaultArg)
2102
2108 AbbrevToUse = Writer.getDeclTemplateTypeParmAbbrev();
2109
2111}
2112
2114
2115
2116
2120
2122
2123 Record.push_back(D->getDepth());
2125
2128
2133 }
2134
2136 } else {
2137
2141 Record.push_back(OwnsDefaultArg);
2142 if (OwnsDefaultArg)
2145 }
2146}
2147
2149
2150
2151
2154
2158
2159 Record.push_back(D->getDepth());
2161
2164 I != N; ++I)
2167 } else {
2168
2172 Record.push_back(OwnsDefaultArg);
2173 if (OwnsDefaultArg)
2176 }
2177}
2178
2183
2192
2193
2196 "You need to update the serializer after you change the "
2197 "DeclContextBits");
2199
2202
2203
2204
2206 } else {
2208 Writer.WriteDeclContextLexicalBlock(Record.getASTContext(), DC);
2209 Writer.WriteDeclContextVisibleBlock(Record.getASTContext(), DC, Offsets);
2210 }
2211
2212 Record.AddLookupOffsets(Offsets);
2213}
2214
2216 assert(IsLocalDecl(D) && "expected a local declaration");
2217
2220 return Canon;
2221
2222 const Decl *&CacheEntry = FirstLocalDeclCache[Canon];
2223 if (CacheEntry)
2224 return CacheEntry;
2225
2226 for (const Decl *Redecl = D; Redecl; Redecl = Redecl->getPreviousDecl())
2228 D = Redecl;
2229 return CacheEntry = D;
2230}
2231
2232template
2235 T *MostRecent = First->getMostRecentDecl();
2236 T *DAsT = static_cast<T *>(D);
2237 if (MostRecent != First) {
2239 "Not considered redeclarable?");
2240
2241 Record.AddDeclRef(First);
2242
2243
2244
2245 const Decl *FirstLocal = Writer.getFirstLocalDecl(DAsT);
2246 if (DAsT == FirstLocal) {
2247
2248
2249
2250 unsigned I = Record.size();
2251 Record.push_back(0);
2252 if (Writer.Chain)
2254
2255 Record[I] = Record.size() - I;
2256
2257
2258
2260 ASTRecordWriter LocalRedeclWriter(Record, LocalRedecls);
2263 if (!Prev->isFromASTFile())
2265
2266
2267
2268 if (LocalRedecls.empty())
2269 Record.push_back(0);
2270 else
2272 } else {
2273 Record.push_back(0);
2274 Record.AddDeclRef(FirstLocal);
2275 }
2276
2277
2278
2279
2280
2281
2282
2284 (void)Writer.GetDeclRef(MostRecent);
2285 } else {
2286
2287 Record.push_back(0);
2288 }
2289}
2290
2301
2303 Record.writeOMPChildren(D->Data);
2306}
2307
2309 Record.writeOMPChildren(D->Data);
2312}
2313
2315 Record.writeOMPChildren(D->Data);
2318}
2319
2322 "You need to update the serializer after you change the "
2323 "NumOMPDeclareReductionDeclBits");
2324
2326 Record.AddSourceLocation(D->getBeginLoc());
2336}
2337
2339 Record.writeOMPChildren(D->Data);
2341 Record.AddDeclarationName(D->getVarName());
2344}
2345
2350
2352 Record.writeUInt32(D->clauses().size());
2354 Record.writeEnum(D->DirKind);
2355 Record.AddSourceLocation(D->DirectiveLoc);
2356 Record.AddSourceLocation(D->EndLoc);
2357 Record.writeOpenACCClauseList(D->clauses());
2359}
2361 Record.writeUInt32(D->clauses().size());
2363 Record.writeEnum(D->DirKind);
2364 Record.AddSourceLocation(D->DirectiveLoc);
2365 Record.AddSourceLocation(D->EndLoc);
2366 Record.AddSourceRange(D->ParensLoc);
2367 Record.AddStmt(D->FuncRef);
2368 Record.writeOpenACCClauseList(D->clauses());
2370}
2371
2372
2373
2374
2375
2376namespace {
2377template <FunctionDecl::TemplatedKind Kind>
2378std::shared_ptrllvm::BitCodeAbbrev
2380 using namespace llvm;
2381
2382 auto Abv = std::make_shared();
2383 Abv->Add(BitCodeAbbrevOp(Code));
2384
2385 Abv->Add(BitCodeAbbrevOp(0));
2386 Abv->Add(BitCodeAbbrevOp(Kind));
2388
2390
2391 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2393
2394 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2396 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2397 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2398 3));
2399 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2400 } else if constexpr (Kind ==
2402 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2403 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2404 3));
2405 Abv->Add(BitCodeAbbrevOp(1));
2407 Abv->Add(
2408 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2409 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2410 Abv->Add(BitCodeAbbrevOp(0));
2411 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2412 Abv->Add(BitCodeAbbrevOp(0));
2413 Abv->Add(
2414 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2415 } else if constexpr (Kind == FunctionDecl::
2416 TK_DependentFunctionTemplateSpecialization) {
2417
2418 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2419 Abv->Add(BitCodeAbbrevOp(0));
2420 } else {
2421 llvm_unreachable("Unknown templated kind?");
2422 }
2423
2424 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2425 8));
2426
2427
2428
2429
2430
2431
2432
2433 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2434 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2435
2437 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2438 Abv->Add(BitCodeAbbrevOp(0));
2439
2440 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2441
2442 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2443 Abv->Add(BitCodeAbbrevOp(0));
2444 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2445
2446 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2447 Abv->Add(BitCodeAbbrevOp(
2448 BitCodeAbbrevOp::Fixed,
2449 28));
2450
2451
2452
2453
2454
2455
2456 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2457 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2458
2459
2460
2461
2462
2463
2464
2465
2466 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2467 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2468 return Abv;
2469}
2470
2471template <FunctionDecl::TemplatedKind Kind>
2472std::shared_ptrllvm::BitCodeAbbrev getCXXMethodAbbrev() {
2474}
2475}
2476
2477void ASTWriter::WriteDeclAbbrevs() {
2478 using namespace llvm;
2479
2480 std::shared_ptr Abv;
2481
2482
2483 Abv = std::make_shared();
2485
2486 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2487 7));
2488
2489
2490
2491
2492
2493
2494 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2495 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2496
2497 Abv->Add(BitCodeAbbrevOp(0));
2498 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2499 Abv->Add(BitCodeAbbrevOp(0));
2500
2501 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2502
2503 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2504 Abv->Add(BitCodeAbbrevOp(0));
2505 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2506
2507 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2508 Abv->Add(BitCodeAbbrevOp(0));
2509
2510 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2511 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2512 DeclFieldAbbrev = Stream.EmitAbbrev(std::move(Abv));
2513
2514
2515 Abv = std::make_shared();
2517
2518 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2519 12));
2520
2521
2522
2523 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2524 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2525
2526 Abv->Add(BitCodeAbbrevOp(0));
2527 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2528 Abv->Add(BitCodeAbbrevOp(0));
2529
2530 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2531
2532 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2533 Abv->Add(BitCodeAbbrevOp(0));
2534 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2535
2536 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2537 Abv->Add(BitCodeAbbrevOp(0));
2538
2539 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2540 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2541
2542 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2543 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2544 DeclObjCIvarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2545
2546
2547 Abv = std::make_shared();
2549
2550 Abv->Add(BitCodeAbbrevOp(0));
2551
2552 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2553 7));
2554
2555
2556
2557
2558
2559
2560 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2561 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2562
2563 Abv->Add(BitCodeAbbrevOp(0));
2564 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2565 Abv->Add(BitCodeAbbrevOp(0));
2566
2567 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2568
2569 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2570 Abv->Add(BitCodeAbbrevOp(
2571 BitCodeAbbrevOp::Fixed,
2572 9));
2573
2574
2575 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2576 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2577
2578 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2579 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2580 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2581 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 20));
2582 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
2583 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2584
2585 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2586 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2587 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2588 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2589 DeclEnumAbbrev = Stream.EmitAbbrev(std::move(Abv));
2590
2591
2592 Abv = std::make_shared();
2594
2595 Abv->Add(BitCodeAbbrevOp(0));
2596
2597 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2598 7));
2599
2600
2601
2602
2603
2604
2605 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2606 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2607
2608 Abv->Add(BitCodeAbbrevOp(0));
2609 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2610 Abv->Add(BitCodeAbbrevOp(0));
2611
2612 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2613
2614 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2615 Abv->Add(BitCodeAbbrevOp(
2616 BitCodeAbbrevOp::Fixed,
2617 9));
2618
2619
2620 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2621 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2622
2623 Abv->Add(BitCodeAbbrevOp(
2624 BitCodeAbbrevOp::Fixed,
2625 14));
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 26));
2636
2637
2638 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2639 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2640 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2641 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2642 DeclRecordAbbrev = Stream.EmitAbbrev(std::move(Abv));
2643
2644
2645 Abv = std::make_shared();
2647
2648 Abv->Add(BitCodeAbbrevOp(0));
2649
2650 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2651 8));
2652
2653
2654
2655
2656 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2657 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2658
2659 Abv->Add(BitCodeAbbrevOp(0));
2660 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2661 Abv->Add(BitCodeAbbrevOp(0));
2662
2663 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2664
2665 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2666 Abv->Add(BitCodeAbbrevOp(0));
2667 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2668
2669 Abv->Add(
2670 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2671 12));
2672
2673 Abv->Add(BitCodeAbbrevOp(0));
2674
2675 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2676 Abv->Add(BitCodeAbbrevOp(
2677 BitCodeAbbrevOp::Fixed,
2678 19));
2679
2680
2681
2682 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2683 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2684 DeclParmVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2685
2686
2687 Abv = std::make_shared();
2689
2690 Abv->Add(BitCodeAbbrevOp(0));
2691
2692 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2693 7));
2694
2695
2696
2697
2698 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2699 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2700
2701 Abv->Add(BitCodeAbbrevOp(0));
2702 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2703 Abv->Add(BitCodeAbbrevOp(0));
2704
2705 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2706 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2707
2708 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2709 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2710 DeclTypedefAbbrev = Stream.EmitAbbrev(std::move(Abv));
2711
2712
2713 Abv = std::make_shared();
2715
2716 Abv->Add(BitCodeAbbrevOp(0));
2717
2718 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2719 12));
2720
2721
2722
2723 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2724 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2725
2726 Abv->Add(BitCodeAbbrevOp(0));
2727 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2728 Abv->Add(BitCodeAbbrevOp(0));
2729
2730 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2731
2732 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2733 Abv->Add(BitCodeAbbrevOp(0));
2734 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2735
2736 Abv->Add(BitCodeAbbrevOp(
2737 BitCodeAbbrevOp::Fixed,
2738 22));
2739
2740
2741
2742
2743
2744
2745
2746 Abv->Add(BitCodeAbbrevOp(0));
2747
2748 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
2749 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2750 DeclVarAbbrev = Stream.EmitAbbrev(std::move(Abv));
2751
2752
2753 DeclCXXMethodAbbrev =
2754 Stream.EmitAbbrev(getCXXMethodAbbrevFunctionDecl::TK\_NonTemplate());
2755 DeclTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2756 getCXXMethodAbbrevFunctionDecl::TK\_FunctionTemplate());
2757 DeclDependentNonTemplateCXXMethodAbbrev = Stream.EmitAbbrev(
2758 getCXXMethodAbbrevFunctionDecl::TK\_DependentNonTemplate());
2759 DeclMemberSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2760 getCXXMethodAbbrevFunctionDecl::TK\_MemberSpecialization());
2761 DeclTemplateSpecializedCXXMethodAbbrev = Stream.EmitAbbrev(
2762 getCXXMethodAbbrevFunctionDecl::TK\_FunctionTemplateSpecialization());
2763 DeclDependentSpecializationCXXMethodAbbrev = Stream.EmitAbbrev(
2764 getCXXMethodAbbrev<
2766
2767
2768 Abv = std::make_shared();
2770 Abv->Add(BitCodeAbbrevOp(0));
2771
2772 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2773 7));
2774
2775
2776
2777
2778 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2779 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2780
2781 Abv->Add(BitCodeAbbrevOp(0));
2782 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2783 Abv->Add(BitCodeAbbrevOp(0));
2784
2785 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2786 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2787
2788 Abv->Add(
2789 BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));
2790 Abv->Add(BitCodeAbbrevOp(0));
2791 DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
2792
2793
2794 Abv = std::make_shared();
2796
2797 Abv->Add(BitCodeAbbrevOp(0));
2798
2799 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed,
2800 12));
2801
2802
2803
2804 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2805 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2806
2807 Abv->Add(BitCodeAbbrevOp(0));
2808 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2809 Abv->Add(BitCodeAbbrevOp(0));
2810
2811 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2812 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 11));
2813 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2814 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR,
2815 6));
2816 DeclUsingShadowAbbrev = Stream.EmitAbbrev(std::move(Abv));
2817
2818
2819 Abv = std::make_shared();
2821
2822
2823
2824 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
2825 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2826
2827
2828
2829
2830 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2831 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2832 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2833 DeclRefExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2834
2835
2836 Abv = std::make_shared();
2838
2839
2840
2841 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2842 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2843
2844 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2845 Abv->Add(BitCodeAbbrevOp(32));
2846 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2847 IntegerLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2848
2849
2850 Abv = std::make_shared();
2852
2853
2854
2855 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2856 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2857
2858 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2859 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2860 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3));
2861 CharacterLiteralAbbrev = Stream.EmitAbbrev(std::move(Abv));
2862
2863
2864 Abv = std::make_shared();
2866
2867
2868
2869 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2870 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2871
2872 Abv->Add(BitCodeAbbrevOp(0));
2873
2874 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 9));
2875
2876 ExprImplicitCastAbbrev = Stream.EmitAbbrev(std::move(Abv));
2877
2878
2879 Abv = std::make_shared();
2881
2882
2883
2884
2885 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2886 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2887
2888 Abv->Add(
2889 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2890 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2891 BinaryOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2892
2893
2894 Abv = std::make_shared();
2896
2897
2898
2899
2900 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5));
2901 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2902
2903
2904 Abv->Add(
2905 BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2906 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2907
2908 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2909 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2910 CompoundAssignOperatorAbbrev = Stream.EmitAbbrev(std::move(Abv));
2911
2912
2913 Abv = std::make_shared();
2915
2916
2917
2918 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2919 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2920
2921 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2922 Abv->Add(BitCodeAbbrevOp(0));
2923 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2924 CallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2925
2926
2927 Abv = std::make_shared();
2929
2930
2931
2932 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2933 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2934
2935 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2936 Abv->Add(BitCodeAbbrevOp(0));
2937 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2938
2939 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2940 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2941 CXXOperatorCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2942
2943
2944 Abv = std::make_shared();
2946
2947
2948
2949 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 10));
2950 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2951
2952 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2953 Abv->Add(BitCodeAbbrevOp(0));
2954 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2955
2956 CXXMemberCallExprAbbrev = Stream.EmitAbbrev(std::move(Abv));
2957
2958
2959 Abv = std::make_shared();
2961
2962
2963 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2964 Abv->Add(BitCodeAbbrevOp(0));
2965 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2966 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
2967 CompoundStmtAbbrev = Stream.EmitAbbrev(std::move(Abv));
2968
2969 Abv = std::make_shared();
2971 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2972 DeclContextLexicalAbbrev = Stream.EmitAbbrev(std::move(Abv));
2973
2974 Abv = std::make_shared();
2976 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2977 DeclContextVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2978
2979 Abv = std::make_shared();
2981 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2982 DeclModuleLocalVisibleLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2983
2984 Abv = std::make_shared();
2986 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2987 DeclTULocalLookupAbbrev = Stream.EmitAbbrev(std::move(Abv));
2988
2989 Abv = std::make_shared();
2991 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2992 DeclSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2993
2994 Abv = std::make_shared();
2996 Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
2997 DeclPartialSpecializationsAbbrev = Stream.EmitAbbrev(std::move(Abv));
2998}
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3013 Module *WritingModule) {
3014
3015
3016
3017 if (WritingModule && WritingModule->isNamedModule()) {
3018
3019
3020
3021
3023 return true;
3024 return false;
3025 }
3026
3027
3028
3029
3030
3031
3033 return true;
3034
3036
3037
3038 return false;
3039 }
3040
3041 return Context.DeclMustBeEmitted(D);
3042}
3043
3044void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) {
3045 PrettyDeclStackTraceEntry CrashInfo(Context, D, SourceLocation(),
3046 "serializing");
3047
3048
3049 LocalDeclID ID;
3050 assert(!D->isFromASTFile() && "should not be emitting imported decl");
3051 LocalDeclID &IDR = DeclIDs[D];
3053 IDR = NextDeclID++;
3054
3055 ID = IDR;
3056
3057 assert(ID >= FirstDeclID && "invalid decl ID");
3058
3061
3062
3063 W.Visit(D);
3064
3065
3066 uint64_t Offset = W.Emit(D);
3067
3068
3072
3073 unsigned Index = ID.getRawValue() - FirstDeclID.getRawValue();
3074 if (DeclOffsets.size() == Index)
3075 DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
3076 else if (DeclOffsets.size() < Index) {
3077
3078 DeclOffsets.resize(Index+1);
3079 DeclOffsets[Index].setRawLoc(RawLoc);
3080 DeclOffsets[Index].setBitOffset(Offset, DeclTypesBlockStartOffset);
3081 } else {
3082 llvm_unreachable("declarations should be emitted in ID order");
3083 }
3084
3086 if (Loc.isValid() && SM.isLocalSourceLocation(Loc))
3087 associateDeclWithFile(D, ID);
3088
3089
3090
3092 AddDeclRef(D, EagerlyDeserializedDecls);
3093}
3094
3096
3097 Writer->ClearSwitchCaseIDs();
3098
3101 Record->push_back(ModulesCodegen);
3102 if (ModulesCodegen)
3103 Writer->AddDeclRef(FD, Writer->ModularCodegenDecls);
3104 if (auto *CD = dyn_cast(FD)) {
3105 Record->push_back(CD->getNumCtorInitializers());
3106 if (CD->getNumCtorInitializers())
3108 }
3110}
static void addExplicitSpecifier(ExplicitSpecifier ES, ASTRecordWriter &Record)
Definition ASTWriterDecl.cpp:941
static bool shouldVarGenerateHereOnly(const VarDecl *VD)
Definition ASTWriterDecl.cpp:381
static bool shouldFunctionGenerateHereOnly(const FunctionDecl *FD)
Definition ASTWriterDecl.cpp:402
static bool isRequiredDecl(const Decl *D, ASTContext &Context, Module *WritingModule)
isRequiredDecl - Check if this is a "required" Decl, which must be seen by consumers of the AST.
Definition ASTWriterDecl.cpp:3012
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
llvm::MachO::Record Record
This file defines OpenMP AST classes for clauses.
Defines the SourceManager interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
const LangOptions & getLangOpts() const
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const
MutableArrayRef< FunctionTemplateSpecializationInfo > getPartialSpecializations(FunctionTemplateDecl::Common *)
Definition ASTWriterDecl.cpp:303
void VisitBindingDecl(BindingDecl *D)
Definition ASTWriterDecl.cpp:1431
void VisitObjCTypeParamDecl(ObjCTypeParamDecl *D)
Definition ASTWriterDecl.cpp:1014
void VisitEmptyDecl(EmptyDecl *D)
Definition ASTWriterDecl.cpp:1450
void VisitCXXMethodDecl(CXXMethodDecl *D)
Definition ASTWriterDecl.cpp:1729
void VisitPragmaDetectMismatchDecl(PragmaDetectMismatchDecl *D)
Definition ASTWriterDecl.cpp:577
void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D)
Definition ASTWriterDecl.cpp:1649
void VisitOMPRequiresDecl(OMPRequiresDecl *D)
Definition ASTWriterDecl.cpp:2314
void VisitNamedDecl(NamedDecl *D)
Definition ASTWriterDecl.cpp:593
void CollectFirstDeclFromEachModule(const Decl *D, bool IncludeLocal, llvm::MapVector< ModuleFile *, const Decl * > &Firsts)
Collect the first declaration from each module file that provides a declaration of D.
Definition ASTWriterDecl.cpp:199
RedeclarableTemplateDecl::SpecEntryTraits< EntryType >::DeclType * getSpecializationDecl(EntryType &T)
Get the specialization decl from an entry in the specialization list.
Definition ASTWriterDecl.cpp:293
void VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D)
Definition ASTWriterDecl.cpp:951
void VisitOpenACCDeclareDecl(OpenACCDeclareDecl *D)
Definition ASTWriterDecl.cpp:2351
void VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D)
Definition ASTWriterDecl.cpp:2338
void VisitNamespaceDecl(NamespaceDecl *D)
Definition ASTWriterDecl.cpp:1541
void VisitOMPAllocateDecl(OMPAllocateDecl *D)
Definition ASTWriterDecl.cpp:2308
void VisitExportDecl(ExportDecl *D)
Definition ASTWriterDecl.cpp:1528
void VisitOMPThreadPrivateDecl(OMPThreadPrivateDecl *D)
Definition ASTWriterDecl.cpp:2302
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D)
Definition ASTWriterDecl.cpp:2148
void VisitParmVarDecl(ParmVarDecl *D)
Definition ASTWriterDecl.cpp:1374
void VisitRedeclarable(Redeclarable< T > *D)
Definition ASTWriterDecl.cpp:2233
void VisitFriendDecl(FriendDecl *D)
Definition ASTWriterDecl.cpp:1833
void VisitDeclaratorDecl(DeclaratorDecl *D)
Definition ASTWriterDecl.cpp:769
void VisitTemplateParamObjectDecl(TemplateParamObjectDecl *D)
Definition ASTWriterDecl.cpp:1263
void VisitConceptDecl(ConceptDecl *D)
Definition ASTWriterDecl.cpp:1874
void AddFirstSpecializationDeclFromEachModule(const Decl *D, llvm::SmallVectorImpl< const Decl * > &SpecsInMap, llvm::SmallVectorImpl< const Decl * > &PartialSpecsInMap)
Add to the record the first template specialization from each module file that provides a declaration...
Definition ASTWriterDecl.cpp:269
void VisitObjCPropertyDecl(ObjCPropertyDecl *D)
Definition ASTWriterDecl.cpp:1144
void VisitBlockDecl(BlockDecl *D)
Definition ASTWriterDecl.cpp:1466
void VisitLabelDecl(LabelDecl *LD)
Definition ASTWriterDecl.cpp:1534
void VisitTemplateDecl(TemplateDecl *D)
Definition ASTWriterDecl.cpp:1867
void VisitImplicitConceptSpecializationDecl(ImplicitConceptSpecializationDecl *D)
Definition ASTWriterDecl.cpp:1880
void VisitCXXDestructorDecl(CXXDestructorDecl *D)
Definition ASTWriterDecl.cpp:1790
void VisitFieldDecl(FieldDecl *D)
Definition ASTWriterDecl.cpp:1205
void VisitRequiresExprBodyDecl(RequiresExprBodyDecl *D)
Definition ASTWriterDecl.cpp:1889
void VisitObjCContainerDecl(ObjCContainerDecl *D)
Definition ASTWriterDecl.cpp:1024
void RegisterTemplateSpecialization(const Decl *Template, const Decl *Specialization)
Ensure that this template specialization is associated with the specified template on reload.
Definition ASTWriterDecl.cpp:350
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D)
Definition ASTWriterDecl.cpp:1192
void VisitVarTemplatePartialSpecializationDecl(VarTemplatePartialSpecializationDecl *D)
Definition ASTWriterDecl.cpp:2055
void VisitUnnamedGlobalConstantDecl(UnnamedGlobalConstantDecl *D)
Definition ASTWriterDecl.cpp:1256
void VisitCXXConversionDecl(CXXConversionDecl *D)
Definition ASTWriterDecl.cpp:1803
void VisitUsingShadowDecl(UsingShadowDecl *D)
Definition ASTWriterDecl.cpp:1612
void VisitValueDecl(ValueDecl *D)
Definition ASTWriterDecl.cpp:754
void VisitIndirectFieldDecl(IndirectFieldDecl *D)
Definition ASTWriterDecl.cpp:1269
void VisitImplicitParamDecl(ImplicitParamDecl *D)
Definition ASTWriterDecl.cpp:1369
decltype(T::PartialSpecializations) & getPartialSpecializations(T *Common)
Get the list of partial specializations from a template's common ptr.
Definition ASTWriterDecl.cpp:299
void VisitObjCProtocolDecl(ObjCProtocolDecl *D)
Definition ASTWriterDecl.cpp:1101
void VisitUsingDirectiveDecl(UsingDirectiveDecl *D)
Definition ASTWriterDecl.cpp:1639
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D)
Definition ASTWriterDecl.cpp:2070
void Visit(Decl *D)
Definition ASTWriterDecl.cpp:459
void VisitObjCCategoryDecl(ObjCCategoryDecl *D)
Definition ASTWriterDecl.cpp:1123
void VisitTopLevelStmtDecl(TopLevelStmtDecl *D)
Definition ASTWriterDecl.cpp:1444
void VisitLinkageSpecDecl(LinkageSpecDecl *D)
Definition ASTWriterDecl.cpp:1516
void VisitAccessSpecDecl(AccessSpecDecl *D)
Definition ASTWriterDecl.cpp:1827
ASTDeclWriter(ASTWriter &Writer, ASTContext &Context, ASTWriter::RecordDataImpl &Record, bool GeneratingReducedBMI)
Definition ASTWriterDecl.cpp:58
void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D)
Definition ASTWriterDecl.cpp:2179
void VisitDecl(Decl *D)
Definition ASTWriterDecl.cpp:514
void VisitLifetimeExtendedTemporaryDecl(LifetimeExtendedTemporaryDecl *D)
Definition ASTWriterDecl.cpp:1455
void VisitMSPropertyDecl(MSPropertyDecl *D)
Definition ASTWriterDecl.cpp:1239
void VisitUsingEnumDecl(UsingEnumDecl *D)
Definition ASTWriterDecl.cpp:1593
void VisitTypeDecl(TypeDecl *D)
Definition ASTWriterDecl.cpp:601
void VisitClassTemplatePartialSpecializationDecl(ClassTemplatePartialSpecializationDecl *D)
Definition ASTWriterDecl.cpp:1986
void VisitEnumConstantDecl(EnumConstantDecl *D)
Definition ASTWriterDecl.cpp:759
void VisitObjCIvarDecl(ObjCIvarDecl *D)
Definition ASTWriterDecl.cpp:1080
void VisitCapturedDecl(CapturedDecl *D)
Definition ASTWriterDecl.cpp:1505
void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D)
Definition ASTWriterDecl.cpp:2346
void VisitPragmaCommentDecl(PragmaCommentDecl *D)
Definition ASTWriterDecl.cpp:567
void VisitRecordDecl(RecordDecl *D)
Definition ASTWriterDecl.cpp:713
void VisitUnresolvedUsingIfExistsDecl(UnresolvedUsingIfExistsDecl *D)
Definition ASTWriterDecl.cpp:1667
void VisitTypedefDecl(TypedefDecl *D)
Definition ASTWriterDecl.cpp:618
void VisitMSGuidDecl(MSGuidDecl *D)
Definition ASTWriterDecl.cpp:1246
void VisitTypedefNameDecl(TypedefNameDecl *D)
Definition ASTWriterDecl.cpp:608
void VisitVarTemplateSpecializationDecl(VarTemplateSpecializationDecl *D)
Definition ASTWriterDecl.cpp:2009
void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D)
Definition ASTWriterDecl.cpp:2113
void VisitUsingDecl(UsingDecl *D)
Definition ASTWriterDecl.cpp:1582
void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D)
Definition ASTWriterDecl.cpp:1658
void AddTemplateSpecializations(DeclTy *D)
Definition ASTWriterDecl.cpp:308
void VisitConstructorUsingShadowDecl(ConstructorUsingShadowDecl *D)
Definition ASTWriterDecl.cpp:1630
void VisitObjCImplementationDecl(ObjCImplementationDecl *D)
Definition ASTWriterDecl.cpp:1177
bool shouldSkipWritingSpecializations(T *Spec)
Definition ASTWriterDecl.cpp:223
void VisitFriendTemplateDecl(FriendTemplateDecl *D)
Definition ASTWriterDecl.cpp:1853
void VisitObjCMethodDecl(ObjCMethodDecl *D)
Definition ASTWriterDecl.cpp:962
void VisitNamespaceAliasDecl(NamespaceAliasDecl *D)
Definition ASTWriterDecl.cpp:1572
uint64_t Emit(Decl *D)
Definition ASTWriterDecl.cpp:64
void VisitVarTemplateDecl(VarTemplateDecl *D)
Definition ASTWriterDecl.cpp:2001
void VisitHLSLBufferDecl(HLSLBufferDecl *D)
Definition ASTWriterDecl.cpp:2291
void VisitObjCImplDecl(ObjCImplDecl *D)
Definition ASTWriterDecl.cpp:1165
void VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D)
Definition ASTWriterDecl.cpp:1118
void VisitVarDecl(VarDecl *D)
Definition ASTWriterDecl.cpp:1278
void VisitImportDecl(ImportDecl *D)
Definition ASTWriterDecl.cpp:1809
void VisitCXXRecordDecl(CXXRecordDecl *D)
Definition ASTWriterDecl.cpp:1673
void VisitCXXConstructorDecl(CXXConstructorDecl *D)
Definition ASTWriterDecl.cpp:1774
void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D)
Definition ASTWriterDecl.cpp:2320
void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D)
Definition ASTWriterDecl.cpp:2078
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D)
Definition ASTWriterDecl.cpp:1437
void VisitClassTemplateDecl(ClassTemplateDecl *D)
Definition ASTWriterDecl.cpp:1909
void VisitFunctionDecl(FunctionDecl *D)
Definition ASTWriterDecl.cpp:785
void VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D)
Definition ASTWriterDecl.cpp:1927
void VisitOpenACCRoutineDecl(OpenACCRoutineDecl *D)
Definition ASTWriterDecl.cpp:2360
void VisitEnumDecl(EnumDecl *D)
Definition ASTWriterDecl.cpp:670
void VisitTranslationUnitDecl(TranslationUnitDecl *D)
Definition ASTWriterDecl.cpp:589
void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D)
Definition ASTWriterDecl.cpp:1138
void VisitStaticAssertDecl(StaticAssertDecl *D)
Definition ASTWriterDecl.cpp:2184
void VisitDeclContext(DeclContext *DC)
Emit the DeclContext part of a declaration context decl.
Definition ASTWriterDecl.cpp:2194
void AddObjCTypeParamList(ObjCTypeParamList *typeParams)
Add an Objective-C type parameter list to the given record.
Definition ASTWriterDecl.cpp:182
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D)
Definition ASTWriterDecl.cpp:1035
void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D)
Definition ASTWriterDecl.cpp:1171
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal)
Add to the record the first declaration from each module file that provides a declaration of D.
Definition ASTWriterDecl.cpp:215
void VisitUsingPackDecl(UsingPackDecl *D)
Definition ASTWriterDecl.cpp:1603
void VisitDecompositionDecl(DecompositionDecl *D)
Definition ASTWriterDecl.cpp:1421
void VisitOutlinedFunctionDecl(OutlinedFunctionDecl *D)
Definition ASTWriterDecl.cpp:1495
void VisitTagDecl(TagDecl *D)
Definition ASTWriterDecl.cpp:640
void VisitTypeAliasDecl(TypeAliasDecl *D)
Definition ASTWriterDecl.cpp:634
void VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D)
Definition ASTWriterDecl.cpp:1893
An object for streaming information to a record.
void AddFunctionDefinition(const FunctionDecl *FD)
Add a definition for the given function to the queue of statements to emit.
Definition ASTWriterDecl.cpp:3095
uint64_t Emit(unsigned Code, unsigned Abbrev=0)
Emit the record to the stream, followed by its substatements, and return its offset.
void AddStmt(Stmt *S)
Add the given statement or expression to the queue of statements to emit.
void AddCXXCtorInitializers(ArrayRef< CXXCtorInitializer * > CtorInits)
Emit a CXXCtorInitializer array.
void AddDeclRef(const Decl *D)
Emit a reference to a declaration.
Writes an AST file containing the contents of a translation unit.
SmallVectorImpl< uint64_t > RecordDataImpl
bool IsLocalDecl(const Decl *D)
Is this a local declaration (that is, one that will be written to our AST file)?
SourceLocationEncoding::RawLocEncoding getRawSourceLocationEncoding(SourceLocation Loc)
Return the raw encodings for source locations.
friend class ASTDeclWriter
const Decl * getFirstLocalDecl(const Decl *D)
Find the first local declaration of a given local redeclarable decl.
Definition ASTWriterDecl.cpp:2215
SmallVector< uint64_t, 64 > RecordData
void AddDeclRef(const Decl *D, RecordDataImpl &Record)
Emit a reference to a declaration.
Represents an access specifier followed by colon ':'.
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
A binding in a decomposition declaration.
Expr * getBinding() const
Get the expression to which this declaration is bound.
A simple helper class to pack several bits in order into (a) 32 bit integer(s).
void addBits(uint32_t Value, uint32_t BitsWidth)
Represents a block literal declaration, which is like an unnamed FunctionDecl.
unsigned getNumCaptures() const
Returns the number of captured variables.
bool canAvoidCopyToHeap() const
size_t param_size() const
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
ArrayRef< Capture > captures() const
bool blockMissingReturnType() const
bool capturesCXXThis() const
bool doesNotEscape() const
bool isConversionFromLambda() const
ArrayRef< ParmVarDecl * > parameters() const
TypeSourceInfo * getSignatureAsWritten() const
Represents a C++ constructor within a class.
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
Represents a C++ conversion function within a class.
ExplicitSpecifier getExplicitSpecifier()
Represents a C++ deduction guide declaration.
const CXXDeductionGuideDecl * getSourceDeductionGuide() const
Get the deduction guide from which this deduction guide was generated, if it was generated as part of...
ExplicitSpecifier getExplicitSpecifier()
DeductionCandidate getDeductionCandidateKind() const
SourceDeductionGuideKind getSourceDeductionGuideKind() const
Represents a C++ destructor within a class.
const FunctionDecl * getOperatorGlobalDelete() const
const FunctionDecl * getGlobalArrayOperatorDelete() const
const FunctionDecl * getOperatorDelete() const
Expr * getOperatorDeleteThisArg() const
const FunctionDecl * getArrayOperatorDelete() const
Represents a static or instance method of a struct/union/class.
CXXMethodDecl * getMostRecentDecl()
overridden_method_range overridden_methods() const
unsigned size_overridden_methods() const
Represents a C++ struct/union/class.
Decl * getLambdaContextDecl() const
Retrieve the declaration that provides additional context for a lambda, when the normal declaration c...
unsigned getLambdaIndexInContext() const
Retrieve the index of this lambda within the context declaration returned by getLambdaContextDecl().
bool isLambda() const
Determine whether this class describes a lambda function object.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine whether this particular class is a specialization or instantiation of a class template or m...
ClassTemplateDecl * getDescribedClassTemplate() const
Retrieves the class template that is described by this class declaration.
static bool classofKind(Kind K)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this class is an instantiation of a member class of a class template specialization,...
CXXMethodDecl * getLambdaCallOperator() const
Retrieve the lambda call operator of the closure type if this is a closure type.
CXXRecordDecl * getPreviousDecl()
Represents the body of a CapturedStmt, and serves as its DeclContext.
unsigned getNumParams() const
unsigned getContextParamPosition() const
ImplicitParamDecl * getParam(unsigned i) const
Declaration of a class template.
ClassTemplateDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
ClassTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member class template partial specialization from which this particular class template p...
bool isMemberSpecialization() const
Determines whether this class template partial specialization template was a specialization of a memb...
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Represents a class template specialization, which refers to a class template with a given set of temp...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Retrieve the template argument list as written in the sources, if any.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
llvm::PointerUnion< ClassTemplateDecl *, ClassTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the class template or class template partial specialization which was specialized by this.
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
SourceLocation getExternKeywordLoc() const
Gets the location of the extern keyword, if present.
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate members of the class templa...
bool hasStrictPackMatch() const
Declaration of a C++20 concept.
Expr * getConstraintExpr() const
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
A POD class for pairing a NamedDecl* with an access specifier.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
@ NumOMPDeclareReductionDeclBits
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
@ NumCXXConstructorDeclBits
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
@ NumObjCContainerDeclBits
A simple visitor class that helps create declaration visitors.
Decl - This represents one declaration (or definition), e.g.
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
SourceLocation getEndLoc() const LLVM_READONLY
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
ASTContext & getASTContext() const LLVM_READONLY
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isInNamedModule() const
Whether this declaration comes from a named module.
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
bool isReferenced() const
Whether any declaration of this entity was referenced.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isInvalidDecl() const
unsigned getIdentifierNamespace() const
SourceLocation getLocation() const
const char * getDeclKindName() const
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc....
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
DeclContext * getDeclContext()
AccessSpecifier getAccess() const
SourceLocation getBeginLoc() const LLVM_READONLY
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
NameKind getNameKind() const
Determine what kind of name this is.
Represents a ValueDecl that came out of a declarator.
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
TypeSourceInfo * getTypeSourceInfo() const
A decomposition declaration.
ArrayRef< BindingDecl * > bindings() const
Provides information about a dependent function-template specialization declaration.
ArrayRef< FunctionTemplateDecl * > getCandidates() const
Returns the candidates for the primary function template.
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
Represents an empty-declaration.
An instance of this object exists for each enum constant that is defined.
llvm::APSInt getInitVal() const
const Expr * getInitExpr() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization,...
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
unsigned getNumNegativeBits() const
Returns the width in bits required to store all the negative enumerators of this enum.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists,...
EnumDecl * getMostRecentDecl()
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum.
QualType getPromotionType() const
Return the integer type that enumerators should promote to.
Store information needed for an explicit specifier.
ExplicitSpecKind getKind() const
const Expr * getExpr() const
Represents a standard C++ module export declaration.
SourceLocation getRBraceLoc() const
This represents one expression.
Represents a member of a struct/union/class.
bool isMutable() const
Determines whether this field is mutable (C++ only).
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
Expr * getBitWidth() const
Returns the expression that represents the bit width, if this field is a bit field.
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
const Expr * getAsmStringExpr() const
SourceLocation getRParenLoc() const
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
TemplateParameterList * getFriendTypeTemplateParameterList(unsigned N) const
NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Declaration of a friend template.
SourceLocation getFriendLoc() const
Retrieves the location of the 'friend' keyword.
NamedDecl * getFriendDecl() const
If this friend declaration names a templated function (or a member function of a templated type),...
TemplateParameterList * getTemplateParameterList(unsigned i) const
unsigned getNumTemplateParameters() const
TypeSourceInfo * getFriendType() const
If this friend declaration names a templated type (or a dependent member type of a templated type),...
Represents a function declaration or definition.
bool isMultiVersion() const
True if this function is considered a multiversioned function.
Stmt * getBody(const FunctionDecl *&Definition) const
Retrieve the body (definition) of the function.
bool isTrivialForCall() const
ConstexprSpecKind getConstexprKind() const
DefaultedOrDeletedFunctionInfo * getDefaultedOrDeletedInfo() const
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
bool isDestroyingOperatorDelete() const
Determine whether this is a destroying operator delete.
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
SourceLocation getDefaultLoc() const
bool usesSEHTry() const
Indicates the function uses __try.
ArrayRef< ParmVarDecl * > parameters() const
bool isExplicitlyDefaulted() const
Whether this function is explicitly defaulted.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool hasWrittenPrototype() const
Whether this function has a written prototype.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization,...
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
unsigned getODRHash()
Returns ODRHash of the function.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool FriendConstraintRefersToEnclosingTemplate() const
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
bool isDeletedAsWritten() const
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
bool hasImplicitReturnZero() const
Whether falling off this function implicitly returns null/zero.
bool hasSkippedBody() const
True if the function was a definition but its body was skipped.
bool isTypeAwareOperatorNewOrDelete() const
Determine whether this is a type aware operator new or delete.
bool isDefaulted() const
Whether this function is defaulted.
bool isIneligibleOrNotSelected() const
FunctionDecl * getInstantiatedFromDecl() const
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
size_t param_size() const
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
bool isInstantiatedFromMemberTemplate() const
Declaration of a template function.
FunctionTemplateDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
TemplateArgumentList * TemplateArguments
The template arguments used to produce the function template specialization from the function templat...
FunctionTemplateDecl * getTemplate() const
Retrieve the template from which this function was specialized.
MemberSpecializationInfo * getMemberSpecializationInfo() const
Get the specialization info if this function template specialization is also a member specialization:
const ASTTemplateArgumentListInfo * TemplateArgumentsAsWritten
The template arguments as written in the sources, if provided.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this function template specialization.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
SourceLocation getLBraceLoc() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getRBraceLoc() const
ArrayRef< TemplateArgument > getTemplateArguments() const
Describes a module import declaration, which makes the contents of the named module visible in the cu...
ArrayRef< SourceLocation > getIdentifierLocs() const
Retrieves the locations of each of the identifiers that make up the complete module name in the impor...
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Represents a field injected from an anonymous union/struct into the parent scope.
unsigned getChainingSize() const
ArrayRef< NamedDecl * > chain() const
Represents the declaration of a label.
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
unsigned getManglingNumber() const
APValue * getValue() const
Expr * getTemporaryExpr()
Retrieve the expression to which the temporary materialization conversion was applied.
ValueDecl * getExtendingDecl()
Represents a linkage specification.
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
SourceLocation getExternLoc() const
SourceLocation getRBraceLoc() const
Parts getParts() const
Get the decomposed parts of this declaration.
An instance of this class represents the declaration of a property member.
IdentifierInfo * getGetterId() const
IdentifierInfo * getSetterId() const
Provides information a specialization of a member of a class template, which may be a member function...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
SourceLocation getPointOfInstantiation() const
Retrieve the first point of instantiation of this member.
NamedDecl * getInstantiatedFrom() const
Retrieve the member declaration from which this member was instantiated.
Describes a module or submodule.
bool isInterfaceOrPartition() const
bool isNamedModule() const
Does this Module is a named module of a standard named module?
Module * getTopLevelModule()
Retrieve the top-level module for this (sub)module, which may be this module.
This represents a decl that may have a name.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
bool isPlaceholderVar(const LangOptions &LangOpts) const
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a C++ namespace alias.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
Represent a C++ namespace.
SourceLocation getRBraceLoc() const
NamespaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
SourceLocation getBeginLoc() const LLVM_READONLY
bool isAnonymousNamespace() const
Returns true if this is an anonymous namespace declaration.
bool isInline() const
Returns true if this is an inline namespace declaration.
NamespaceDecl * getAnonymousNamespace() const
Retrieve the anonymous namespace that inhabits this namespace, if any.
bool isNested() const
Returns true if this is a nested namespace declaration.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
QualType getExpansionType(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
TypeSourceInfo * getExpansionTypeSourceInfo(unsigned I) const
Retrieve a particular expansion type source info within an expanded parameter pack.
unsigned getNumExpansionTypes() const
Retrieves the number of expansion types in an expanded parameter pack.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isExpandedParameterPack() const
Whether this parameter is a non-type template parameter pack that has a known list of different types...
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
bool hasPlaceholderTypeConstraint() const
Determine whether this non-type template parameter's type has a placeholder with a type-constraint.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Expr * getPlaceholderTypeConstraint() const
Return the constraint introduced by the placeholder type of this non-type template parameter (if any)...
This represents 'pragma omp allocate ...' directive.
Pseudo declaration for capturing expressions.
OMPChildren * Data
Data, associated with the directive.
This represents 'pragma omp declare mapper ...' directive.
OMPDeclareMapperDecl * getPrevDeclInScope()
Get reference to previous declare mapper construct in the same scope with the same name.
DeclarationName getVarName()
Get the name of the variable declared in the mapper.
This represents 'pragma omp declare reduction ...' directive.
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Expr * getInitPriv()
Get Priv variable of the initializer.
Expr * getCombinerOut()
Get Out variable of the combiner.
Expr * getCombinerIn()
Get In variable of the combiner.
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
OMPDeclareReductionDecl * getPrevDeclInScope()
Get reference to previous declare reduction construct in the same scope with the same name.
Expr * getInitOrig()
Get Orig variable of the initializer.
OMPDeclareReductionInitKind getInitializerKind() const
Get initializer kind.
This represents 'pragma omp requires...' directive.
This represents 'pragma omp threadprivate ...' directive.
Represents a field declaration created by an @defs(...).
static bool classofKind(Kind K)
ObjCCategoryDecl - Represents a category declaration.
protocol_loc_range protocol_locs() const
unsigned protocol_size() const
ObjCInterfaceDecl * getClassInterface()
SourceLocation getIvarLBraceLoc() const
SourceLocation getIvarRBraceLoc() const
protocol_range protocols() const
SourceLocation getCategoryNameLoc() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
SourceLocation getCategoryNameLoc() const
ObjCCompatibleAliasDecl - Represents alias of a class.
const ObjCInterfaceDecl * getClassInterface() const
ObjCContainerDecl - Represents a container for method declarations.
SourceRange getAtEndRange() const
SourceLocation getAtStartLoc() const
const ObjCInterfaceDecl * getClassInterface() const
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
SourceLocation getIvarRBraceLoc() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
SourceLocation getSuperClassLoc() const
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
const ObjCInterfaceDecl * getSuperClass() const
SourceLocation getIvarLBraceLoc() const
Represents an ObjC class declaration.
protocol_range protocols() const
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
protocol_loc_range protocol_locs() const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
const Type * getTypeForDecl() const
SourceLocation getEndOfDefinitionLoc() const
TypeSourceInfo * getSuperClassTInfo() const
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
bool getSynthesize() const
static bool classofKind(Kind K)
ObjCMethodDecl - Represents an instance or class method declaration.
ImplicitParamDecl * getSelfDecl() const
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
ObjCDeclQualifier getObjCDeclQualifier() const
ArrayRef< ParmVarDecl * > parameters() const
unsigned param_size() const
bool isPropertyAccessor() const
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getReturnTypeSourceInfo() const
bool hasRedeclaration() const
True if redeclared in the same interface.
bool isSynthesizedAccessorStub() const
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
ImplicitParamDecl * getCmdDecl() const
bool isInstanceMethod() const
QualType getReturnType() const
ObjCImplementationControl getImplementationControl() const
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
Represents one property declaration in an Objective-C interface.
SourceLocation getGetterNameLoc() const
ObjCMethodDecl * getGetterMethodDecl() const
ObjCMethodDecl * getSetterMethodDecl() const
SourceLocation getSetterNameLoc() const
SourceLocation getAtLoc() const
ObjCIvarDecl * getPropertyIvarDecl() const
Selector getSetterName() const
TypeSourceInfo * getTypeSourceInfo() const
Selector getGetterName() const
SourceLocation getLParenLoc() const
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
ObjCPropertyAttribute::Kind getPropertyAttributes() const
PropertyControl getPropertyImplementation() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
SourceLocation getPropertyIvarDeclLoc() const
Expr * getSetterCXXAssignment() const
ObjCPropertyDecl * getPropertyDecl() const
Expr * getGetterCXXConstructor() const
ObjCMethodDecl * getSetterMethodDecl() const
SourceLocation getBeginLoc() const LLVM_READONLY
ObjCMethodDecl * getGetterMethodDecl() const
Represents an Objective-C protocol declaration.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
protocol_loc_range protocol_locs() const
protocol_range protocols() const
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
unsigned protocol_size() const
Represents the declaration of an Objective-C type parameter.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
unsigned size() const
Determine the number of type parameters in this list.
SourceLocation getRAngleLoc() const
SourceLocation getLAngleLoc() const
ArrayRef< const OpenACCClause * > clauses() const
Represents a partial function definition.
ImplicitParamDecl * getParam(unsigned i) const
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
unsigned getNumParams() const
Represents a parameter to a function.
bool isKNRPromoted() const
True if the value passed to this parameter must undergo K&R-style default argument promotion:
unsigned getFunctionScopeIndex() const
Returns the index of this parameter in its prototype or method scope.
SourceLocation getExplicitObjectParamThisLoc() const
bool isObjCMethodParameter() const
ObjCDeclQualifier getObjCDeclQualifier() const
bool hasUninstantiatedDefaultArg() const
bool hasInheritedDefaultArg() const
Expr * getUninstantiatedDefaultArg()
unsigned getFunctionScopeDepth() const
Represents a #pragma detect_mismatch line.
StringRef getName() const
StringRef getValue() const
A (possibly-)qualified type.
Represents a struct/union/class.
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
bool hasNonTrivialToPrimitiveDestructCUnion() const
bool hasNonTrivialToPrimitiveCopyCUnion() const
RecordArgPassingKind getArgPassingRestrictions() const
bool hasVolatileMember() const
bool hasFlexibleArrayMember() const
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
bool hasObjectMember() const
bool isNonTrivialToPrimitiveDestroy() const
bool isNonTrivialToPrimitiveCopy() const
bool isParamDestroyedInCallee() const
RecordDecl * getMostRecentDecl()
bool hasUninitializedExplicitInitFields() const
bool isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C structs.
bool isAnonymousStructOrUnion() const
Whether this is an anonymous struct or union.
Declaration of a redeclarable template.
bool isMemberSpecialization() const
Determines whether this template was a specialization of a member template.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
RedeclarableTemplateDecl * getInstantiatedFromMemberTemplate() const
Retrieve the member template from which this template was instantiated, or nullptr if this template w...
Provides common interface for the Decls that can be redeclared.
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Represents the body of a requires-expression.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
Represents a C++11 static_assert declaration.
SourceLocation getRParenLoc() const
StringLiteral - This represents a string literal expression, e.g.
Represents the declaration of a struct/union/class/enum.
SourceRange getBraceRange() const
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
bool isEmbeddedInDeclarator() const
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
TypedefNameDecl * getTypedefNameForAnonDecl() const
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
bool isFreeStanding() const
True if this tag is free standing, e.g. "struct foo;".
TagKind getTagKind() const
unsigned size() const
Retrieve the number of template arguments in this template argument list.
const TemplateArgument & get(unsigned Idx) const
Retrieve the template argument at a given index.
Represents a template argument.
@ Declaration
The template argument is a declaration that was provided for a pointer, reference,...
@ Type
The template argument is a type.
ArgKind getKind() const
Return the kind of stored template argument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
A template parameter object.
const APValue & getValue() const
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
bool wasDeclaredWithTypename() const
Whether this template template parameter was declared with the 'typename' keyword.
TemplateParameterList * getExpansionTemplateParameters(unsigned I) const
Retrieve a particular expansion type within an expanded parameter pack.
unsigned getNumExpansionTemplateParameters() const
Retrieves the number of expansion template parameters in an expanded parameter pack.
TemplateNameKind templateParameterKind() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getPosition() const
Get the position of the template parameter within its parameter list.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool isExpandedParameterPack() const
Whether this parameter is a template template parameter pack that has a known list of different templ...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool hasTypeConstraint() const
Determine whether this template parameter has a type-constraint.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
UnsignedOrNone getNumExpansionParameters() const
Whether this parameter is a template type parameter pack that has a known list of different type-cons...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
A declaration that models statements at global scope.
The top declaration context.
Represents the declaration of a typedef-name via a C++11 alias-declaration.
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
Declaration of an alias template.
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
UnsignedOrNone getArgPackSubstIndex() const
Expr * getImmediatelyDeclaredConstraint() const
Get the immediately-declared constraint expression introduced by this type-constraint,...
ConceptReference * getConceptReference() const
Represents a declaration of a type.
const Type * getTypeForDecl() const
SourceLocation getBeginLoc() const LLVM_READONLY
QualType getType() const
Return the type wrapped by this type source info.
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
TypeSourceInfo * getTypeSourceInfo() const
TypedefNameDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
QualType getUnderlyingType() const
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes,...
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
const APValue & getValue() const
This node is generated when a using-declaration that was annotated with attribute((using_if_exists)) ...
Represents a dependent using declaration which was marked with typename.
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Represents a dependent using declaration which was not marked with typename.
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
Represents a C++ using-declaration.
bool hasTypename() const
Return true if the using declaration has 'typename'.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
Represents C++ using-directive.
SourceLocation getUsingLoc() const
Return the location of the using keyword.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
Represents a C++ using-enum-declaration.
SourceLocation getEnumLoc() const
The source location of the 'enum' keyword.
TypeSourceInfo * getEnumType() const
SourceLocation getUsingLoc() const
The source location of the 'using' keyword.
Represents a pack of using declarations that a single using-declarator pack-expanded into.
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
UsingShadowDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
VarDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
@ CInit
C-style initialization with assignment.
bool isObjCForDecl() const
Determine whether this variable is a for-loop declaration for a for-in statement in Objective-C.
bool hasInitWithSideEffects() const
Checks whether this declaration has an initializer with side effects.
bool isInlineSpecified() const
bool isStaticDataMember() const
Determines whether this is a static data member.
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
bool isCXXForRangeImplicitVar() const
Whether this variable is the implicit '__range' variable in C++ range-based for loops.
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
bool isInline() const
Whether this variable is (C++1z) inline.
ThreadStorageClassSpecifier getTSCSpec() const
const Expr * getInit() const
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
StorageDuration getStorageDuration() const
Get the storage duration of this variable, per C++ [basic.stc].
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool isEscapingByref() const
Indicates the capture is a __block variable that is captured by a block that can potentially escape (...
bool isThisDeclarationADemotedDefinition() const
If this definition should pretend to be a declaration.
bool isPreviousDeclInSameBlockScope() const
Whether this local extern variable declaration's previous declaration was declared in the same block ...
VarDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization,...
Declaration of a variable template.
VarTemplateDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
VarTemplatePartialSpecializationDecl * getInstantiatedFromMember() const
Retrieve the member variable template partial specialization from which this particular variable temp...
bool isMemberSpecialization() const
Determines whether this variable template partial specialization was a specialization of a member par...
Represents a variable template specialization, which refers to a variable template with a given set o...
SourceLocation getPointOfInstantiation() const
Get the point of instantiation (if any), or null if none.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Retrieve the template argument list as written in the sources, if any.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the variable template specialization.
const TemplateArgumentList & getTemplateInstantiationArgs() const
Retrieve the set of template arguments that should be used to instantiate the initializer of the vari...
SourceLocation getTemplateKeywordLoc() const
Gets the location of the template keyword, if present.
llvm::PointerUnion< VarTemplateDecl *, VarTemplatePartialSpecializationDecl * > getSpecializedTemplateOrPartial() const
Retrieve the variable template or variable template partial specialization which was specialized by t...
TemplateSpecializationKind getSpecializationKind() const
Determine the kind of specialization that this declaration represents.
VarTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
SourceLocation getExternKeywordLoc() const
Gets the location of the extern keyword, if present.
const unsigned int LOCAL_REDECLARATIONS
Record code for a list of local redeclarations of a declaration.
DeclCode
Record codes for each kind of declaration.
@ DECL_EMPTY
An EmptyDecl record.
@ DECL_CAPTURED
A CapturedDecl record.
@ DECL_CXX_RECORD
A CXXRecordDecl record.
@ DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION
A VarTemplatePartialSpecializationDecl record.
@ DECL_OMP_ALLOCATE
An OMPAllocateDcl record.
@ DECL_MS_PROPERTY
A MSPropertyDecl record.
@ DECL_OMP_DECLARE_MAPPER
An OMPDeclareMapperDecl record.
@ DECL_TOP_LEVEL_STMT_DECL
A TopLevelStmtDecl record.
@ DECL_REQUIRES_EXPR_BODY
A RequiresExprBodyDecl record.
@ DECL_STATIC_ASSERT
A StaticAssertDecl record.
@ DECL_INDIRECTFIELD
A IndirectFieldDecl record.
@ DECL_TEMPLATE_TEMPLATE_PARM
A TemplateTemplateParmDecl record.
@ DECL_IMPORT
An ImportDecl recording a module import.
@ DECL_UNNAMED_GLOBAL_CONSTANT
A UnnamedGlobalConstantDecl record.
@ DECL_ACCESS_SPEC
An AccessSpecDecl record.
@ DECL_OBJC_TYPE_PARAM
An ObjCTypeParamDecl record.
@ DECL_OBJC_CATEGORY_IMPL
A ObjCCategoryImplDecl record.
@ DECL_ENUM_CONSTANT
An EnumConstantDecl record.
@ DECL_PARM_VAR
A ParmVarDecl record.
@ DECL_TYPEDEF
A TypedefDecl record.
@ DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK
A TemplateTemplateParmDecl record that stores an expanded template template parameter pack.
@ DECL_HLSL_BUFFER
A HLSLBufferDecl record.
@ DECL_NAMESPACE_ALIAS
A NamespaceAliasDecl record.
@ DECL_TYPEALIAS
A TypeAliasDecl record.
@ DECL_FUNCTION_TEMPLATE
A FunctionTemplateDecl record.
@ DECL_MS_GUID
A MSGuidDecl record.
@ DECL_UNRESOLVED_USING_TYPENAME
An UnresolvedUsingTypenameDecl record.
@ DECL_CLASS_TEMPLATE_SPECIALIZATION
A ClassTemplateSpecializationDecl record.
@ DECL_FILE_SCOPE_ASM
A FileScopeAsmDecl record.
@ DECL_PARTIAL_SPECIALIZATIONS
@ DECL_CXX_CONSTRUCTOR
A CXXConstructorDecl record.
@ DECL_CXX_CONVERSION
A CXXConversionDecl record.
@ DECL_FIELD
A FieldDecl record.
@ DECL_LINKAGE_SPEC
A LinkageSpecDecl record.
@ DECL_CONTEXT_TU_LOCAL_VISIBLE
A record that stores the set of declarations that are only visible to the TU.
@ DECL_NAMESPACE
A NamespaceDecl record.
@ DECL_NON_TYPE_TEMPLATE_PARM
A NonTypeTemplateParmDecl record.
@ DECL_USING_PACK
A UsingPackDecl record.
@ DECL_FUNCTION
A FunctionDecl record.
@ DECL_USING_DIRECTIVE
A UsingDirecitveDecl record.
@ DECL_RECORD
A RecordDecl record.
@ DECL_CONTEXT_LEXICAL
A record that stores the set of declarations that are lexically stored within a given DeclContext.
@ DECL_OUTLINEDFUNCTION
A OutlinedFunctionDecl record.
@ DECL_BLOCK
A BlockDecl record.
@ DECL_UNRESOLVED_USING_VALUE
An UnresolvedUsingValueDecl record.
@ DECL_TYPE_ALIAS_TEMPLATE
A TypeAliasTemplateDecl record.
@ DECL_OBJC_CATEGORY
A ObjCCategoryDecl record.
@ DECL_VAR
A VarDecl record.
@ DECL_UNRESOLVED_USING_IF_EXISTS
An UnresolvedUsingIfExistsDecl record.
@ DECL_USING
A UsingDecl record.
@ DECL_OBJC_PROTOCOL
A ObjCProtocolDecl record.
@ DECL_TEMPLATE_TYPE_PARM
A TemplateTypeParmDecl record.
@ DECL_VAR_TEMPLATE_SPECIALIZATION
A VarTemplateSpecializationDecl record.
@ DECL_OBJC_IMPLEMENTATION
A ObjCImplementationDecl record.
@ DECL_LABEL
A LabelDecl record.
@ DECL_OBJC_COMPATIBLE_ALIAS
A ObjCCompatibleAliasDecl record.
@ DECL_CONSTRUCTOR_USING_SHADOW
A ConstructorUsingShadowDecl record.
@ DECL_USING_ENUM
A UsingEnumDecl record.
@ DECL_FRIEND_TEMPLATE
A FriendTemplateDecl record.
@ DECL_PRAGMA_DETECT_MISMATCH
A PragmaDetectMismatchDecl record.
@ DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK
A NonTypeTemplateParmDecl record that stores an expanded non-type template parameter pack.
@ DECL_OBJC_AT_DEFS_FIELD
A ObjCAtDefsFieldDecl record.
@ DECL_IMPLICIT_PARAM
An ImplicitParamDecl record.
@ DECL_FRIEND
A FriendDecl record.
@ DECL_CXX_METHOD
A CXXMethodDecl record.
@ DECL_EXPORT
An ExportDecl record.
@ DECL_BINDING
A BindingDecl record.
@ DECL_PRAGMA_COMMENT
A PragmaCommentDecl record.
@ DECL_ENUM
An EnumDecl record.
@ DECL_CONTEXT_MODULE_LOCAL_VISIBLE
A record containing the set of declarations that are only visible from DeclContext in the same module...
@ DECL_DECOMPOSITION
A DecompositionDecl record.
@ DECL_OMP_DECLARE_REDUCTION
An OMPDeclareReductionDecl record.
@ DECL_OMP_THREADPRIVATE
An OMPThreadPrivateDecl record.
@ DECL_OBJC_METHOD
A ObjCMethodDecl record.
@ DECL_CXX_DESTRUCTOR
A CXXDestructorDecl record.
@ DECL_OMP_CAPTUREDEXPR
An OMPCapturedExprDecl record.
@ DECL_CLASS_TEMPLATE
A ClassTemplateDecl record.
@ DECL_USING_SHADOW
A UsingShadowDecl record.
@ DECL_CONCEPT
A ConceptDecl record.
@ DECL_CXX_DEDUCTION_GUIDE
A CXXDeductionGuideDecl record.
@ DECL_OMP_REQUIRES
An OMPRequiresDecl record.
@ DECL_OBJC_IVAR
A ObjCIvarDecl record.
@ DECL_OBJC_PROPERTY
A ObjCPropertyDecl record.
@ DECL_TEMPLATE_PARAM_OBJECT
A TemplateParamObjectDecl record.
@ DECL_OBJC_INTERFACE
A ObjCInterfaceDecl record.
@ DECL_VAR_TEMPLATE
A VarTemplateDecl record.
@ DECL_LIFETIME_EXTENDED_TEMPORARY
An LifetimeExtendedTemporaryDecl record.
@ DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION
A ClassTemplatePartialSpecializationDecl record.
@ DECL_IMPLICIT_CONCEPT_SPECIALIZATION
An ImplicitConceptSpecializationDecl record.
@ DECL_CONTEXT_VISIBLE
A record that stores the set of declarations that are visible from a given DeclContext.
@ DECL_OBJC_PROPERTY_IMPL
A ObjCPropertyImplDecl record.
@ EXPR_COMPOUND_ASSIGN_OPERATOR
A CompoundAssignOperator record.
@ EXPR_CXX_OPERATOR_CALL
A CXXOperatorCallExpr record.
@ EXPR_IMPLICIT_CAST
An ImplicitCastExpr record.
@ EXPR_CHARACTER_LITERAL
A CharacterLiteral record.
@ STMT_COMPOUND
A CompoundStmt record.
@ EXPR_CALL
A CallExpr record.
@ EXPR_BINARY_OPERATOR
A BinaryOperator record.
@ EXPR_DECL_REF
A DeclRefExpr record.
@ EXPR_INTEGER_LITERAL
An IntegerLiteral record.
@ EXPR_CXX_MEMBER_CALL
A CXXMemberCallExpr record.
bool isRedeclarableDeclKind(unsigned Kind)
Determine whether the given declaration kind is redeclarable.
bool needsAnonymousDeclarationNumber(const NamedDecl *D)
Determine whether the given declaration needs an anonymous declaration number.
bool isPartOfPerModuleInitializer(const Decl *D)
Determine whether the given declaration will be included in the per-module initializer if it needs to...
@ CXXAddedAnonymousNamespace
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
@ GVA_AvailableExternally
@ Specialization
We are substituting template parameters for template arguments in order to form a template specializa...
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ SD_Static
Static storage duration.
const FunctionProtoType * T
@ Template
We are parsing a template declaration.
@ ExplicitInstantiation
We are parsing an explicit instantiation.
@ VarTemplate
The name was classified as a variable template name.
bool CanElideDeclDef(const Decl *D)
If we can elide the definition of.
Definition ASTWriterDecl.cpp:429
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
U cast(CodeGen::Address addr)
bool isExternallyVisible(Linkage L)
Diagnostic wrappers for TextAPI types for error reporting.
Represents an explicit template argument list in C++, e.g., the "" in "sort".
const Expr * ConstraintExpr
UnsignedOrNone ArgPackSubstIndex
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
Data that is common to all of the declarations of a given function template.
uint16_t Part2
...-89ab-...
uint32_t Part1
{01234567-...
uint16_t Part3
...-cdef-...
uint8_t Part4And5[8]
...-0123-456789abcdef}
static DeclType * getDecl(EntryType *D)