clang: include/clang/AST/DeclBase.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_AST_DECLBASE_H
14#define LLVM_CLANG_AST_DECLBASE_H
15
26#include "llvm/ADT/ArrayRef.h"
27#include "llvm/ADT/PointerIntPair.h"
28#include "llvm/ADT/PointerUnion.h"
29#include "llvm/ADT/iterator.h"
30#include "llvm/ADT/iterator_range.h"
31#include "llvm/Support/Casting.h"
32#include "llvm/Support/Compiler.h"
33#include "llvm/Support/PrettyStackTrace.h"
34#include "llvm/Support/VersionTuple.h"
35#include
36#include
37#include
38#include
39#include
40#include <type_traits>
41#include
42
44
50class ExternalSourceSymbolAttr;
54enum class Linkage : unsigned char;
69
70
71
78
79
80
81
82
83
84
85
87public:
88
90#define DECL(DERIVED, BASE) DERIVED,
91#define ABSTRACT_DECL(DECL)
92#define DECL_RANGE(BASE, START, END) \
93 first##BASE = START, last##BASE = END,
94#define LAST_DECL_RANGE(BASE, START, END) \
95 first##BASE = START, last##BASE = END
96#include "clang/AST/DeclNodes.inc"
97 };
98
99
100
101
103
104
105
106
107
108
109
110
111
112
113
114
116
118
119
120
121
122
123
124
126
127
128
129
131
132
133
134
135
137
138
139
141
142
143
145
146
148
149
150
151
153
154
155
156
158
159
160
161
162
164
165
166
167
169
170
171
172
173
174
176
177
179
180
182 };
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
212
213
214
215
217
219
220
221
222
223
224
226
227
228
230
231
232
233
235
236
237
238
239
241 };
242
243protected:
244
245
246
247
248
250
251private:
253
254 struct MultipleDC {
257 };
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272 llvm::PointerUnion<DeclContext*, MultipleDC*> DeclCtx;
273
275 bool isOutOfSemaDC() const { return isa<MultipleDC *>(DeclCtx); }
276
277 MultipleDC *getMultipleDC() const { return cast<MultipleDC *>(DeclCtx); }
278
280
281
282 SourceLocation Loc;
283
284
285 LLVM_PREFERRED_TYPE(Kind)
286 unsigned DeclKind : 7;
287
288
289 LLVM_PREFERRED_TYPE(bool)
290 unsigned InvalidDecl : 1;
291
292
293 LLVM_PREFERRED_TYPE(bool)
294 unsigned HasAttrs : 1;
295
296
297
298 LLVM_PREFERRED_TYPE(bool)
299 unsigned Implicit : 1;
300
301
302
303 LLVM_PREFERRED_TYPE(bool)
304 unsigned Used : 1;
305
306
307
308
309
310 LLVM_PREFERRED_TYPE(bool)
311 unsigned Referenced : 1;
312
313
314
315
316 LLVM_PREFERRED_TYPE(bool)
317 unsigned TopLevelDeclInObjCContainer : 1;
318
319
320 static bool StatisticsEnabled;
321
322protected:
332
333
334
337
338
339 LLVM_PREFERRED_TYPE(bool)
341
342
345
346
347 LLVM_PREFERRED_TYPE(Linkage)
349
350
351
352
353
354
355
356
357
358
361
362
363 void *operator new(std::size_t Size, const ASTContext &Ctx,
365
366private:
367 bool AccessDeclContextCheck() const;
368
369
370
372 if (DC) {
374 auto MOK = D->getModuleOwnershipKind();
376 (!D->isFromASTFile() || D->hasLocalOwningModuleStorage()))
377 return MOK;
378
379
380 }
382 }
383
384public:
390
391protected:
394 DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(false), HasAttrs(false),
399 if (StatisticsEnabled) add(DK);
400 }
401
403 : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false),
404 Used(false), Referenced(false), TopLevelDeclInObjCContainer(false),
408 if (StatisticsEnabled) add(DK);
409 }
410
412
416
420
424
425public:
426
430
434
438
441
444
447
449 if (isInSemaDC())
450 return getSemanticDC();
451 return getMultipleDC()->SemanticDC;
452 }
456
457
458
459
464
465
466
467
468
469
474
479
481
483
484
486
487
488
489
490
494 bool IgnoreTemplateOrMacroSubstitution);
495
497
498
499
501
504 assert(AccessDeclContextCheck());
505 }
506
508 assert(AccessDeclContextCheck());
510 }
511
512
513
517
518 bool hasAttrs() const { return HasAttrs; }
519
523
525 return const_cast<AttrVec&>(const_cast<const Decl*>(this)->getAttrs());
526 }
527
531
533 using attr_range = llvm::iterator_range<attr_iterator>;
534
538
545
547 if (!HasAttrs) return;
548
550 llvm::erase_if(Vec, [](Attr *A) { return isa<Ts...>(A); });
551
552 if (Vec.empty())
553 HasAttrs = false;
554 }
555
557
558 template
562
563 template
567
568 template
572
576
577 template bool hasAttr() const {
579 }
580
581
582
584
585
586
589
590
591
592
595
596
597
598
599
600
601
602 bool isUsed(bool CheckUsedAttr = true) const;
603
604
605
606
607
609
610
611
612
613
615
616
618
619
620
622
624
625
626
627
628
630
631
632
633
635 return TopLevelDeclInObjCContainer;
636 }
637
639 TopLevelDeclInObjCContainer = V;
640 }
641
642
643
645
646
647
651
652
653
655
656
657
658
659
660
661
662
663
664
665
666
667
669
673
674
676
677
679
680
681
683
684
686
687
689
690
692
693
695
696
697
699
700
702
703protected:
704
705
707
708
710 return;
712 }
713
714public:
715
716
717
721
722
723
725
726public:
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
746 VersionTuple EnclosingVersion = VersionTuple(),
747 StringRef *RealizedPlatform = nullptr) const;
748
749
750
751
752
753
754
756
757
758
759
760
761
765
766
767
768
769
770
774
775
776
777
778
779
780
782
783
784
785
786
787
788
790
791
792
794
795
796
798
799
800
802
803private:
804 Module *getOwningModuleSlow() const;
805
806protected:
808
809public:
810
811
814 return nullptr;
815
816 return getOwningModuleSlow();
817 }
818
819
820
823 return nullptr;
824
826 "owned local decl but no local module storage");
827 return reinterpret_cast<Module *const *>(this)[-1];
828 }
832 "should not have a cached owning module");
833 reinterpret_cast<Module **>(this)[-1] = M;
834 }
835
836
840
841
845
846
847
849
850
851
853
854
855
856
857
858
862
867
868
869
874
875
879
880
885 "no storage available for owning module for this declaration");
887 }
888
892
896
898
902
907
908
909
910
911
912
913
914
915
916
917
919 if (isInSemaDC())
920 return getSemanticDC();
921 return getMultipleDC()->LexicalDC;
922 }
926
927
928
930
931
932
934
936
937
938
940
941
942
944
945
946
947
948
952
953
954
955
956
957
958
959
960
961
962
963
964
966
967
968
973 const_cast<const Decl *>(this)->getParentFunctionOrMethod(
974 LexicalParent));
975 }
976
977
982
983
985
986protected:
987
988
989
990
992
993
994
996
997
998
1000
1001public:
1002
1004
1005 Decl *Current = nullptr;
1006 Decl *Starter;
1007
1008 public:
1014
1017
1020
1022 assert(Current && "Advancing while iterator has reached end");
1023
1024 Decl *Next = Current->getNextRedeclarationImpl();
1025 assert(Next && "Should return next redeclaration or itself, never null!");
1026 Current = (Next != Starter) ? Next : nullptr;
1027 return *this;
1028 }
1029
1032 ++(*this);
1033 return tmp;
1034 }
1035
1037 return x.Current == y.Current;
1038 }
1039
1041 return x.Current != y.Current;
1042 }
1043 };
1044
1046
1047
1048
1052
1056
1058
1059
1060
1062
1063
1064
1068
1069
1073
1074
1075
1077
1078
1079
1083
1084
1085
1086
1088
1089
1090
1091
1092
1094
1095
1096
1098
1099
1100 static void add(Kind k);
1103
1104
1105
1107
1108
1109
1111
1112
1114
1115
1117
1118
1120 return (DeclKind >= Decl::firstFunction &&
1121 DeclKind <= Decl::lastFunction) ||
1123 }
1124
1125
1126
1127
1128
1129
1130
1132
1133
1134
1136
1137
1138
1140
1142 return const_cast<Decl *>(this)->getAsFunction();
1143 }
1144
1145
1146
1147
1148
1149
1150
1154
1155
1156
1157
1159 "namespace is not ordinary");
1160
1164 }
1165
1166
1167
1168
1172
1173
1174
1175
1176
1177
1178
1179
1185 "namespace includes neither ordinary nor tag");
1189 "namespace includes other than ordinary or tag");
1190
1193
1196 if (PerformFriendInjection ||
1199 }
1200
1204 if (PerformFriendInjection ||
1207 }
1208 }
1209
1210
1211
1212
1213
1215
1221
1222
1223
1224
1225
1227 unsigned mask =
1232 }
1233
1234
1238 "visible non-member operators should be in ordinary namespace");
1240 }
1241
1245
1246 void print(raw_ostream &Out, unsigned Indentation = 0,
1247 bool PrintInstantiation = false) const;
1249 unsigned Indentation = 0, bool PrintInstantiation = false) const;
1250 static void printGroup(Decl** Begin, unsigned NumDecls,
1252 unsigned Indentation = 0);
1253
1254
1255 void dump() const;
1256
1257
1259
1260 void dump(raw_ostream &Out, bool Deserialize = false,
1262
1263
1264 int64_t getID() const;
1265
1266
1267
1268
1269
1270
1271
1273
1274
1275
1277
1278private:
1282
1283protected:
1285};
1286
1287
1289 if (!D1 || !D2)
1290 return false;
1291
1292 if (D1 == D2)
1293 return true;
1294
1296}
1297
1298
1299
1301 const Decl *TheDecl;
1304 const char *Message;
1305
1306public:
1309 : TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {}
1310
1311 void print(raw_ostream &OS) const override;
1312};
1313}
1314
1315
1316
1317namespace llvm {
1325}
1326
1327namespace clang {
1328
1329class DeclListNode {
1330 friend class ASTContext;
1332public:
1333 using Decls = llvm::PointerUnion<NamedDecl*, DeclListNode*>;
1334 class iterator {
1337
1340 public:
1346
1348
1350 assert(Ptr && "dereferencing end() iterator");
1351 if (DeclListNode *CurNode = dyn_cast<DeclListNode *>(Ptr))
1352 return CurNode->D;
1354 }
1356 bool operator==(const iterator &X) const { return Ptr == X.Ptr; }
1357 bool operator!=(const iterator &X) const { return Ptr != X.Ptr; }
1359 assert(!Ptr.isNull() && "Advancing empty iterator");
1360
1361 if (DeclListNode *CurNode = dyn_cast<DeclListNode *>(Ptr))
1362 Ptr = CurNode->Rest;
1363 else
1364 Ptr = nullptr;
1365 return *this;
1366 }
1368 iterator temp = *this;
1369 ++(*this);
1370 return temp;
1371 }
1372
1374 };
1375private:
1377 Decls Rest = nullptr;
1379};
1380
1381
1384
1385
1386 Decls Result;
1387
1388public:
1391
1395
1402
1403 bool empty() const { return Result.isNull(); }
1404 bool isSingleResult() const { return isa_and_present<NamedDecl *>(Result); }
1406
1407
1408
1409
1410
1412 for (auto *D : *this)
1413 if (T *Decl = dyn_cast(D))
1414 return Decl;
1415
1416 return nullptr;
1417 }
1418};
1419
1420
1426
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1450
1452
1454
1455
1457
1459
1460
1462
1463protected:
1465
1466
1467
1468
1469
1470
1471
1474
1476 uint64_t DeclKind : 7;
1477
1478
1479
1480
1481 LLVM_PREFERRED_TYPE(bool)
1482 mutable uint64_t ExternalLexicalStorage : 1;
1483
1484
1485
1486
1487 LLVM_PREFERRED_TYPE(bool)
1488 mutable uint64_t ExternalVisibleStorage : 1;
1489
1490
1491
1492
1493
1494 LLVM_PREFERRED_TYPE(bool)
1495 mutable uint64_t NeedToReconcileExternalVisibleStorage : 1;
1496
1497
1498
1499 LLVM_PREFERRED_TYPE(bool)
1500 mutable uint64_t HasLazyLocalLexicalLookups : 1;
1501
1502
1503
1504 LLVM_PREFERRED_TYPE(bool)
1505 mutable uint64_t HasLazyExternalLexicalLookups : 1;
1506
1507
1508
1509
1510 LLVM_PREFERRED_TYPE(bool)
1511 mutable uint64_t UseQualifiedLookup : 1;
1512 };
1513
1514
1516
1517
1518
1519
1522
1525
1526
1527 LLVM_PREFERRED_TYPE(bool)
1528 uint64_t IsInline : 1;
1529
1530
1531 LLVM_PREFERRED_TYPE(bool)
1532 uint64_t IsNested : 1;
1533 };
1534
1535
1537
1538
1539
1540
1543
1546
1547
1549 uint64_t TagDeclKind : 3;
1550
1551
1552
1553
1554 LLVM_PREFERRED_TYPE(bool)
1555 uint64_t IsCompleteDefinition : 1;
1556
1557
1558 LLVM_PREFERRED_TYPE(bool)
1559 uint64_t IsBeingDefined : 1;
1560
1561
1562
1563 LLVM_PREFERRED_TYPE(bool)
1564 uint64_t IsEmbeddedInDeclarator : 1;
1565
1566
1567 LLVM_PREFERRED_TYPE(bool)
1568 uint64_t IsFreeStanding : 1;
1569
1570
1571
1572 LLVM_PREFERRED_TYPE(bool)
1573 uint64_t IsCompleteDefinitionRequired : 1;
1574
1575
1576
1577 LLVM_PREFERRED_TYPE(bool)
1578 uint64_t IsThisDeclarationADemotedDefinition : 1;
1579 };
1580
1581
1583
1584
1585
1586
1589
1592
1593
1594
1595 uint64_t NumPositiveBits : 8;
1596
1597
1598
1599 uint64_t NumNegativeBits : 8;
1600
1601
1602
1603 LLVM_PREFERRED_TYPE(bool)
1604 uint64_t IsScoped : 1;
1605
1606
1607
1608
1609
1610 LLVM_PREFERRED_TYPE(bool)
1611 uint64_t IsScopedUsingClassTag : 1;
1612
1613
1614
1615 LLVM_PREFERRED_TYPE(bool)
1616 uint64_t IsFixed : 1;
1617
1618
1619 LLVM_PREFERRED_TYPE(bool)
1620 uint64_t HasODRHash : 1;
1621 };
1622
1623
1625
1626
1627
1628
1631
1634
1635
1636
1637
1638 LLVM_PREFERRED_TYPE(bool)
1639 uint64_t HasFlexibleArrayMember : 1;
1640
1641
1642 LLVM_PREFERRED_TYPE(bool)
1643 uint64_t AnonymousStructOrUnion : 1;
1644
1645
1646
1647 LLVM_PREFERRED_TYPE(bool)
1648 uint64_t HasObjectMember : 1;
1649
1650
1651
1652 LLVM_PREFERRED_TYPE(bool)
1653 uint64_t HasVolatileMember : 1;
1654
1655
1656
1657
1658
1659 LLVM_PREFERRED_TYPE(bool)
1660 mutable uint64_t LoadedFieldsFromExternalStorage : 1;
1661
1662
1663 LLVM_PREFERRED_TYPE(bool)
1664 uint64_t NonTrivialToPrimitiveDefaultInitialize : 1;
1665 LLVM_PREFERRED_TYPE(bool)
1666 uint64_t NonTrivialToPrimitiveCopy : 1;
1667 LLVM_PREFERRED_TYPE(bool)
1668 uint64_t NonTrivialToPrimitiveDestroy : 1;
1669
1670
1671
1672
1673 LLVM_PREFERRED_TYPE(bool)
1674 uint64_t HasNonTrivialToPrimitiveDefaultInitializeCUnion : 1;
1675 LLVM_PREFERRED_TYPE(bool)
1676 uint64_t HasNonTrivialToPrimitiveDestructCUnion : 1;
1677 LLVM_PREFERRED_TYPE(bool)
1678 uint64_t HasNonTrivialToPrimitiveCopyCUnion : 1;
1679
1680
1681
1682
1683
1684
1685 LLVM_PREFERRED_TYPE(bool)
1686 uint64_t HasUninitializedExplicitInitFields : 1;
1687
1688
1689 LLVM_PREFERRED_TYPE(bool)
1690 uint64_t ParamDestroyedInCallee : 1;
1691
1692
1694 uint64_t ArgPassingRestrictions : 2;
1695
1696
1697 LLVM_PREFERRED_TYPE(bool)
1698 uint64_t IsRandomized : 1;
1699
1700
1701
1703 };
1704
1705
1707
1708
1709
1710
1713
1716
1717
1718
1720 uint64_t InitializerKind : 2;
1721 };
1722
1723
1724
1726
1727
1728
1729
1730
1733
1735
1738
1740 uint64_t SClass : 3;
1741 LLVM_PREFERRED_TYPE(bool)
1742 uint64_t IsInline : 1;
1743 LLVM_PREFERRED_TYPE(bool)
1744 uint64_t IsInlineSpecified : 1;
1745
1746 LLVM_PREFERRED_TYPE(bool)
1747 uint64_t IsVirtualAsWritten : 1;
1748 LLVM_PREFERRED_TYPE(bool)
1749 uint64_t IsPureVirtual : 1;
1750 LLVM_PREFERRED_TYPE(bool)
1751 uint64_t HasInheritedPrototype : 1;
1752 LLVM_PREFERRED_TYPE(bool)
1753 uint64_t HasWrittenPrototype : 1;
1754 LLVM_PREFERRED_TYPE(bool)
1755 uint64_t IsDeleted : 1;
1756
1757 LLVM_PREFERRED_TYPE(bool)
1758 uint64_t IsTrivial : 1;
1759
1760
1761
1762
1763 LLVM_PREFERRED_TYPE(bool)
1764 uint64_t IsTrivialForCall : 1;
1765
1766 LLVM_PREFERRED_TYPE(bool)
1767 uint64_t IsDefaulted : 1;
1768 LLVM_PREFERRED_TYPE(bool)
1769 uint64_t IsExplicitlyDefaulted : 1;
1770 LLVM_PREFERRED_TYPE(bool)
1771 uint64_t HasDefaultedOrDeletedInfo : 1;
1772
1773
1774
1775
1776 LLVM_PREFERRED_TYPE(bool)
1777 uint64_t IsIneligibleOrNotSelected : 1;
1778
1779 LLVM_PREFERRED_TYPE(bool)
1780 uint64_t HasImplicitReturnZero : 1;
1781 LLVM_PREFERRED_TYPE(bool)
1782 uint64_t IsLateTemplateParsed : 1;
1783 LLVM_PREFERRED_TYPE(bool)
1784 uint64_t IsInstantiatedFromMemberTemplate : 1;
1785
1786
1788 uint64_t ConstexprKind : 2;
1789 LLVM_PREFERRED_TYPE(bool)
1790 uint64_t BodyContainsImmediateEscalatingExpression : 1;
1791
1792 LLVM_PREFERRED_TYPE(bool)
1793 uint64_t InstantiationIsPending : 1;
1794
1795
1796 LLVM_PREFERRED_TYPE(bool)
1797 uint64_t UsesSEHTry : 1;
1798
1799
1800
1801 LLVM_PREFERRED_TYPE(bool)
1802 uint64_t HasSkippedBody : 1;
1803
1804
1805
1806 LLVM_PREFERRED_TYPE(bool)
1807 uint64_t WillHaveBody : 1;
1808
1809
1810
1811 LLVM_PREFERRED_TYPE(bool)
1812 uint64_t IsMultiVersion : 1;
1813
1814
1815
1816
1818 uint64_t DeductionCandidateKind : 2;
1819
1820
1821 LLVM_PREFERRED_TYPE(bool)
1822 uint64_t HasODRHash : 1;
1823
1824
1825 LLVM_PREFERRED_TYPE(bool)
1826 uint64_t UsesFPIntrin : 1;
1827
1828
1829
1830 LLVM_PREFERRED_TYPE(bool)
1831 uint64_t FriendConstraintRefersToEnclosingTemplate : 1;
1832 };
1833
1834
1836
1837
1838
1839
1842
1845
1846
1847
1848
1849
1850
1851 uint64_t NumCtorInitializers : 16;
1852 LLVM_PREFERRED_TYPE(bool)
1853 uint64_t IsInheritingConstructor : 1;
1854
1855
1856 LLVM_PREFERRED_TYPE(bool)
1857 uint64_t HasTrailingExplicitSpecifier : 1;
1858
1859
1860 LLVM_PREFERRED_TYPE(bool)
1861 uint64_t IsSimpleExplicit : 1;
1862 };
1863
1864
1866
1867
1868
1869
1872
1873
1876
1877
1878
1879
1882
1883
1884 LLVM_PREFERRED_TYPE(bool)
1885 uint64_t IsInstance : 1;
1886 LLVM_PREFERRED_TYPE(bool)
1887 uint64_t IsVariadic : 1;
1888
1889
1890 LLVM_PREFERRED_TYPE(bool)
1891 uint64_t IsPropertyAccessor : 1;
1892
1893
1894 LLVM_PREFERRED_TYPE(bool)
1895 uint64_t IsSynthesizedAccessorStub : 1;
1896
1897
1898 LLVM_PREFERRED_TYPE(bool)
1899 uint64_t IsDefined : 1;
1900
1901
1902 LLVM_PREFERRED_TYPE(bool)
1903 uint64_t IsRedeclaration : 1;
1904
1905
1906 LLVM_PREFERRED_TYPE(bool)
1907 mutable uint64_t HasRedeclaration : 1;
1908
1909
1911 uint64_t DeclImplementation : 2;
1912
1913
1915 uint64_t objcDeclQualifier : 7;
1916
1917
1918 LLVM_PREFERRED_TYPE(bool)
1919 uint64_t RelatedResultType : 1;
1920
1921
1922
1924 uint64_t SelLocsKind : 2;
1925
1926
1927
1928
1929
1930
1931
1932
1933 LLVM_PREFERRED_TYPE(bool)
1934 uint64_t IsOverriding : 1;
1935
1936
1937 LLVM_PREFERRED_TYPE(bool)
1938 uint64_t HasSkippedBody : 1;
1939 };
1940
1941
1943
1944
1945
1946
1949
1952
1953
1954
1956 };
1957
1958
1959
1960
1962
1963
1964
1965
1968
1971
1972
1974 uint64_t Language : 3;
1975
1976
1977
1978
1979
1980 LLVM_PREFERRED_TYPE(bool)
1981 uint64_t HasBraces : 1;
1982 };
1983
1984
1986
1987
1988
1989
1992
1995
1996 LLVM_PREFERRED_TYPE(bool)
1997 uint64_t IsVariadic : 1;
1998 LLVM_PREFERRED_TYPE(bool)
1999 uint64_t CapturesCXXThis : 1;
2000 LLVM_PREFERRED_TYPE(bool)
2001 uint64_t BlockMissingReturnType : 1;
2002 LLVM_PREFERRED_TYPE(bool)
2003 uint64_t IsConversionFromLambda : 1;
2004
2005
2006
2007 LLVM_PREFERRED_TYPE(bool)
2008 uint64_t DoesNotEscape : 1;
2009
2010
2011
2012
2013 LLVM_PREFERRED_TYPE(bool)
2014 uint64_t CanAvoidCopyToHeap : 1;
2015 };
2016
2017
2019
2020
2021
2022
2023
2024
2025
2027
2028protected:
2029
2030
2031
2032
2033
2034
2035
2036
2037 union {
2050
2052 "DeclContextBitfields is larger than 8 bytes!");
2054 "NamespaceDeclBitfields is larger than 8 bytes!");
2056 "TagDeclBitfields is larger than 8 bytes!");
2058 "EnumDeclBitfields is larger than 8 bytes!");
2060 "RecordDeclBitfields is larger than 8 bytes!");
2062 "OMPDeclareReductionDeclBitfields is larger than 8 bytes!");
2064 "FunctionDeclBitfields is larger than 8 bytes!");
2066 "CXXConstructorDeclBitfields is larger than 8 bytes!");
2068 "ObjCMethodDeclBitfields is larger than 8 bytes!");
2070 "ObjCContainerDeclBitfields is larger than 8 bytes!");
2072 "LinkageSpecDeclBitfields is larger than 8 bytes!");
2074 "BlockDeclBitfields is larger than 8 bytes!");
2075 };
2076
2077
2078
2080
2081
2082
2083
2084
2086
2087
2088
2089
2090 static std::pair<Decl *, Decl *>
2092
2094
2095public:
2097
2098
2099
2101
2105
2107
2108
2110 return cast(this)->getDeclContext();
2111 }
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2126 return cast(this)->getLexicalDeclContext();
2127 }
2131
2133
2137
2139 return cast(this)->getASTContext();
2140 }
2141
2143
2144
2145
2147
2150 case Decl::ObjCCategory:
2151 case Decl::ObjCCategoryImpl:
2152 case Decl::ObjCImplementation:
2153 case Decl::ObjCInterface:
2154 case Decl::ObjCProtocol:
2155 return true;
2156 default:
2157 return false;
2158 }
2159 }
2160
2163 case Decl::Block:
2164 case Decl::Captured:
2165 case Decl::ObjCMethod:
2166 case Decl::TopLevelStmt:
2167 return true;
2168 default:
2169 return getDeclKind() >= Decl::firstFunction &&
2171 }
2172 }
2173
2174
2179
2181 return getDeclKind() == Decl::TranslationUnit ||
2183 }
2184
2186 return getDeclKind() == Decl::TranslationUnit;
2187 }
2188
2190 return getDeclKind() >= Decl::firstRecord &&
2192 }
2193
2195 return getDeclKind() == Decl::RequiresExprBody;
2196 }
2197
2199
2201
2203
2204
2205
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2224
2225
2226
2228
2229
2231
2232
2233
2235
2236
2237
2241
2242
2243
2245
2246
2247
2249
2250
2251
2252
2257
2258
2263
2264
2265
2266
2267
2268
2269
2274
2275
2276
2277
2282
2283
2288
2289
2294
2295
2296
2297
2298
2299
2300
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2327
2328
2329
2331
2332 Decl *Current = nullptr;
2333
2334 public:
2340
2343
2345
2346
2348
2351 return *this;
2352 }
2353
2356 ++(*this);
2357 return tmp;
2358 }
2359
2361 return x.Current == y.Current;
2362 }
2363
2365 return x.Current != y.Current;
2366 }
2367 };
2368
2369 using decl_range = llvm::iterator_range<decl_iterator>;
2370
2371
2372
2377
2378
2379
2380
2386
2387
2388
2389
2390
2391
2392 template
2394
2395
2396
2398
2399
2400
2401
2402 void SkipToNextDecl() {
2404 ++Current;
2405 }
2406
2407 public:
2409
2410
2414 std::iterator_traitsDeclContext::decl\_iterator::difference_type;
2416
2418
2419
2420
2421
2422
2423
2424
2425
2426
2428 SkipToNextDecl();
2429 }
2430
2432
2433
2435
2437 ++Current;
2438 SkipToNextDecl();
2439 return *this;
2440 }
2441
2444 ++(*this);
2445 return tmp;
2446 }
2447
2450 return x.Current == y.Current;
2451 }
2452
2455 return x.Current != y.Current;
2456 }
2457 };
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468 template<typename SpecificDecl, bool (SpecificDecl::*Acceptable)() const>
2470
2471
2472
2474
2475
2476
2477
2478 void SkipToNextDecl() {
2479 while (*Current &&
2482 ++Current;
2483 }
2484
2485 public:
2487
2488
2492 std::iterator_traitsDeclContext::decl\_iterator::difference_type;
2494
2496
2497
2498
2499
2500
2501
2502
2503
2504
2506 SkipToNextDecl();
2507 }
2508
2511
2513 ++Current;
2514 SkipToNextDecl();
2515 return *this;
2516 }
2517
2520 ++(*this);
2521 return tmp;
2522 }
2523
2526 return x.Current == y.Current;
2527 }
2528
2531 return x.Current != y.Current;
2532 }
2533 };
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2548
2549
2550
2551
2552
2553
2554
2555
2556
2558
2559
2560
2561
2562
2563
2564
2566
2567
2569
2570
2572
2573
2574
2576
2579
2580
2581
2582
2583
2584
2586
2587
2588
2589
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2619
2620
2621
2623
2624 using lookups_range = llvm::iterator_range<all_lookups_iterator>;
2625
2627
2628
2630
2631
2634
2635
2636
2637
2640
2642
2647
2653
2654 using udir_range = llvm::iterator_range<udir_iterator>;
2655
2657
2658
2660
2661 using ddiag_range = llvm::iterator_rangeDeclContext::ddiag\_iterator;
2662
2664
2665
2666
2667
2668
2669
2670
2671
2672
2675 "should only be called on primary context");
2677 }
2678
2679
2680
2682
2683
2685
2686
2687
2691
2692
2693
2697
2698
2699
2703
2704
2705
2711
2712
2713
2718
2722
2726
2729
2734 void dumpLookups(llvm::raw_ostream &OS, bool DumpDecls = false,
2735 bool Deserialize = false) const;
2736
2737private:
2739 const DeclContext *OriginalLookupDC) const;
2740
2741
2742
2743
2744
2745 bool hasNeedToReconcileExternalVisibleStorage() const {
2746 return DeclContextBits.NeedToReconcileExternalVisibleStorage;
2747 }
2748
2749
2750
2751
2752
2753 void setNeedToReconcileExternalVisibleStorage(bool Need = true) const {
2754 DeclContextBits.NeedToReconcileExternalVisibleStorage = Need;
2755 }
2756
2757
2758
2759 bool hasLazyLocalLexicalLookups() const {
2761 }
2762
2763
2764
2765 void setHasLazyLocalLexicalLookups(bool HasLLLL = true) const {
2767 }
2768
2769
2770
2771 bool hasLazyExternalLexicalLookups() const {
2773 }
2774
2775
2776
2777 void setHasLazyExternalLexicalLookups(bool HasLELL = true) const {
2778 DeclContextBits.HasLazyExternalLexicalLookups = HasLELL;
2779 }
2780
2781 void reconcileExternalVisibleStorage() const;
2782 bool LoadLexicalDeclsFromExternalStorage() const;
2783
2784 StoredDeclsMap *CreateStoredDeclsMap(ASTContext &C) const;
2785
2786 void loadLazyLocalLexicalLookups();
2788 void makeDeclVisibleInContextWithFlags(NamedDecl *D, bool Internal,
2789 bool Rediscoverable);
2790 void makeDeclVisibleInContextImpl(NamedDecl *D, bool Internal);
2791};
2792
2794 return getKind() == TemplateTypeParm || getKind() == NonTypeTemplateParm ||
2795 getKind() == TemplateTemplateParm;
2796}
2797
2798
2799template <class ToTy,
2800 bool IsKnownSubtype = ::std::is_base_of<DeclContext, ToTy>::value>
2810
2811
2812template
2815 return static_cast<const ToTy*>(Val);
2816 }
2817
2819 return static_cast<ToTy*>(Val);
2820 }
2821};
2822
2823}
2824
2825namespace llvm {
2826
2827
2828template
2830 static bool doit(const ::clang::DeclContext &Val) {
2831 return To::classofKind(Val.getDeclKind());
2832 }
2833};
2834
2835
2836template
2837struct cast_convert_val<ToTy,
2839 static const ToTy &doit(const ::clang::DeclContext &Val) {
2841 }
2842};
2843
2844template
2850
2851template
2852struct cast_convert_val<ToTy,
2854 static const ToTy *doit(const ::clang::DeclContext *Val) {
2855 return ::clang::cast_convert_decl_context::doit(Val);
2856 }
2857};
2858
2859template
2862 return ::clang::cast_convert_decl_context::doit(Val);
2863 }
2864};
2865
2866
2867template
2869 static ::clang::DeclContext &doit(const FromTy &Val) {
2870 return *FromTy::castToDeclContext(&Val);
2871 }
2872};
2873
2874template
2876 static ::clang::DeclContext *doit(const FromTy *Val) {
2877 return FromTy::castToDeclContext(Val);
2878 }
2879};
2880
2881template
2883 static const ::clang::DeclContext &doit(const FromTy &Val) {
2884 return *FromTy::castToDeclContext(&Val);
2885 }
2886};
2887
2888template
2890 static const ::clang::DeclContext *doit(const FromTy *Val) {
2891 return FromTy::castToDeclContext(Val);
2892 }
2893};
2894
2895}
2896
2897#endif
FormatToken * Next
The next token in the unwrapped line.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Attr - This represents one attribute.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
The results of name lookup within a DeclContext.
Definition DeclBase.h:1382
iterator end()
Definition DeclBase.h:1397
reference front() const
Definition DeclBase.h:1405
bool empty() const
Definition DeclBase.h:1403
DeclContextLookupResult(Decls Result)
Definition DeclBase.h:1390
iterator::reference reference
Definition DeclBase.h:1394
DeclContextLookupResult()=default
const_iterator begin() const
Definition DeclBase.h:1398
DeclListNode::iterator iterator
Definition DeclBase.h:1392
const_iterator end() const
Definition DeclBase.h:1401
iterator const_iterator
Definition DeclBase.h:1393
bool isSingleResult() const
Definition DeclBase.h:1404
T * find_first() const
Definition DeclBase.h:1411
iterator begin()
Definition DeclBase.h:1396
Stores the bits used by BlockDecl.
Definition DeclBase.h:1990
friend class BlockDecl
Definition DeclBase.h:1991
Stores the bits used by CXXConstructorDecl.
Definition DeclBase.h:1840
friend class CXXConstructorDecl
Definition DeclBase.h:1841
Stores the bits used by DeclContext.
Definition DeclBase.h:1472
friend class DeclContext
Definition DeclBase.h:1473
Stores the bits used by EnumDecl.
Definition DeclBase.h:1587
friend class EnumDecl
Definition DeclBase.h:1588
Stores the bits used by FunctionDecl.
Definition DeclBase.h:1731
friend class FunctionDecl
Definition DeclBase.h:1732
friend class CXXDeductionGuideDecl
For DeductionCandidateKind.
Definition DeclBase.h:1734
Stores the bits used by LinkageSpecDecl.
Definition DeclBase.h:1966
friend class LinkageSpecDecl
Definition DeclBase.h:1967
Stores the bits used by NamespaceDecl.
Definition DeclBase.h:1520
friend class NamespaceDecl
Definition DeclBase.h:1521
Stores the bits used by OMPDeclareReductionDecl.
Definition DeclBase.h:1711
friend class OMPDeclareReductionDecl
Definition DeclBase.h:1712
Stores the bits used by ObjCContainerDecl.
Definition DeclBase.h:1947
friend class ObjCContainerDecl
Definition DeclBase.h:1948
Stores the bits used by ObjCMethodDecl.
Definition DeclBase.h:1870
friend class ObjCMethodDecl
Definition DeclBase.h:1871
Stores the bits used by RecordDecl.
Definition DeclBase.h:1629
friend class RecordDecl
Definition DeclBase.h:1630
Stores the bits used by TagDecl.
Definition DeclBase.h:1541
friend class TagDecl
Definition DeclBase.h:1542
all_lookups_iterator - An iterator that provides a view over the results of looking up every possible...
An iterator over the dependent diagnostics in a dependent context.
decl_iterator - Iterates through the declarations stored within this context.
Definition DeclBase.h:2330
std::ptrdiff_t difference_type
Definition DeclBase.h:2339
std::forward_iterator_tag iterator_category
Definition DeclBase.h:2338
decl_iterator(Decl *C)
Definition DeclBase.h:2342
decl_iterator operator++(int)
Definition DeclBase.h:2354
value_type operator->() const
Definition DeclBase.h:2347
const value_type * pointer
Definition DeclBase.h:2337
friend bool operator!=(decl_iterator x, decl_iterator y)
Definition DeclBase.h:2364
friend bool operator==(decl_iterator x, decl_iterator y)
Definition DeclBase.h:2360
const value_type & reference
Definition DeclBase.h:2336
Decl * value_type
Definition DeclBase.h:2335
reference operator*() const
Definition DeclBase.h:2344
decl_iterator & operator++()
Definition DeclBase.h:2349
std::forward_iterator_tag iterator_category
Definition DeclBase.h:2493
void pointer
Definition DeclBase.h:2490
value_type operator->() const
Definition DeclBase.h:2510
filtered_decl_iterator(DeclContext::decl_iterator C)
filtered_decl_iterator - Construct a new iterator over a subset of the declarations the range [C,...
Definition DeclBase.h:2505
friend bool operator==(const filtered_decl_iterator &x, const filtered_decl_iterator &y)
Definition DeclBase.h:2524
value_type operator*() const
Definition DeclBase.h:2509
std::iterator_traits< DeclContext::decl_iterator >::difference_type difference_type
Definition DeclBase.h:2491
filtered_decl_iterator operator++(int)
Definition DeclBase.h:2518
void reference
Definition DeclBase.h:2489
friend bool operator!=(const filtered_decl_iterator &x, const filtered_decl_iterator &y)
Definition DeclBase.h:2529
SpecificDecl * value_type
Definition DeclBase.h:2486
filtered_decl_iterator()=default
filtered_decl_iterator & operator++()
Definition DeclBase.h:2512
specific_decl_iterator()=default
specific_decl_iterator(DeclContext::decl_iterator C)
specific_decl_iterator - Construct a new iterator over a subset of the declarations the range [C,...
Definition DeclBase.h:2427
void pointer
Definition DeclBase.h:2412
value_type operator->() const
Definition DeclBase.h:2434
void reference
Definition DeclBase.h:2411
friend bool operator==(const specific_decl_iterator &x, const specific_decl_iterator &y)
Definition DeclBase.h:2448
std::iterator_traits< DeclContext::decl_iterator >::difference_type difference_type
Definition DeclBase.h:2413
std::forward_iterator_tag iterator_category
Definition DeclBase.h:2415
value_type operator*() const
Definition DeclBase.h:2431
SpecificDecl * value_type
Definition DeclBase.h:2408
specific_decl_iterator operator++(int)
Definition DeclBase.h:2442
friend bool operator!=(const specific_decl_iterator &x, const specific_decl_iterator &y)
Definition DeclBase.h:2453
specific_decl_iterator & operator++()
Definition DeclBase.h:2436
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition DeclBase.h:1449
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition DeclBase.h:2109
udir_range using_directives() const
Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context.
bool Equals(const DeclContext *DC) const
Determine whether this declaration context is equivalent to the declaration context DC.
Definition DeclBase.h:2238
lookup_result::iterator lookup_iterator
Definition DeclBase.h:2578
bool isRequiresExprBody() const
Definition DeclBase.h:2194
friend class ASTWriter
For hasNeedToReconcileExternalVisibleStorage, hasLazyLocalLexicalLookups, hasLazyExternalLexicalLooku...
Definition DeclBase.h:1461
FunctionDeclBitfields FunctionDeclBits
Definition DeclBase.h:2044
bool isFileContext() const
Definition DeclBase.h:2180
@ NumTagDeclBits
Definition DeclBase.h:1582
void setHasExternalVisibleStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations visible in this context.
Definition DeclBase.h:2706
void makeDeclVisibleInContext(NamedDecl *D)
Makes a declaration visible within this context.
all_lookups_iterator noload_lookups_begin() const
Iterators over all possible lookups within this context that are currently loaded; don't attempt to r...
DeclContextLookupResult lookup_result
Definition DeclBase.h:2577
@ NumOdrHashBits
Definition DeclBase.h:1464
void dumpLookups(llvm::raw_ostream &OS, bool DumpDecls=false, bool Deserialize=false) const
static std::pair< Decl *, Decl * > BuildDeclChain(ArrayRef< Decl * > Decls, bool FieldsAlreadyLoaded)
Build up a chain of declarations.
@ NumBlockDeclBits
Definition DeclBase.h:2018
bool isTransparentContext() const
isTransparentContext - Determines whether this context is a "transparent" context,...
@ NumOMPDeclareReductionDeclBits
Definition DeclBase.h:1725
Decl * getNonClosureAncestor()
Find the nearest non-closure ancestor of this context, i.e.
bool isObjCContainer() const
Definition DeclBase.h:2148
ObjCMethodDeclBitfields ObjCMethodDeclBits
Definition DeclBase.h:2046
TagDeclBitfields TagDeclBits
Definition DeclBase.h:2040
ASTContext & getParentASTContext() const
Definition DeclBase.h:2138
lookups_range noload_lookups(bool PreserveInternalState) const
const DeclContext * getParent() const
Definition DeclBase.h:2112
bool isExternCXXContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
bool InEnclosingNamespaceSetOf(const DeclContext *NS) const
Test if this context is part of the enclosing namespace set of the context NS, as defined in C++0x [n...
const DeclContext * getRedeclContext() const
Definition DeclBase.h:2279
EnumDeclBitfields EnumDeclBits
Definition DeclBase.h:2041
CXXConstructorDeclBitfields CXXConstructorDeclBits
Definition DeclBase.h:2045
bool isClosure() const
Definition DeclBase.h:2142
@ NumRecordDeclBits
Definition DeclBase.h:1706
static bool classof(const DeclContext *D)
Definition DeclBase.h:2728
const Decl * getNonClosureAncestor() const
Definition DeclBase.h:2254
@ NumEnumDeclBits
Definition DeclBase.h:1624
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
Definition DeclBase.h:2125
bool isNamespace() const
Definition DeclBase.h:2198
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
bool isLookupContext() const
Test whether the context supports looking up names.
Definition DeclBase.h:2175
@ NumLinkageSpecDeclBits
Definition DeclBase.h:1985
const BlockDecl * getInnermostBlockDecl() const
Return this DeclContext if it is a BlockDecl.
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
Definition DeclBase.h:2700
const DeclContext * getPrimaryContext() const
Definition DeclBase.h:2271
ObjCContainerDeclBitfields ObjCContainerDeclBits
Definition DeclBase.h:2047
const char * getDeclKindName() const
BlockDeclBitfields BlockDeclBits
Definition DeclBase.h:2049
bool isTranslationUnit() const
Definition DeclBase.h:2185
bool isRecord() const
Definition DeclBase.h:2189
void collectAllContexts(SmallVectorImpl< DeclContext * > &Contexts)
Collects all of the declaration contexts that are semantically connected to this declaration context.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
llvm::iterator_range< udir_iterator > udir_range
Definition DeclBase.h:2654
all_lookups_iterator lookups_end() const
void setMustBuildLookupTable()
Mark that there are external lexical declarations that we need to include in our lookup table (and th...
Definition DeclBase.h:2673
RecordDeclBitfields RecordDeclBits
Definition DeclBase.h:2042
Decl * FirstDecl
FirstDecl - The first declaration stored within this declaration context.
Definition DeclBase.h:2079
friend class ASTDeclReader
For makeDeclVisibleInContextImpl.
Definition DeclBase.h:1451
decl_iterator noload_decls_begin() const
Definition DeclBase.h:2384
DeclContext(Decl::Kind K)
void addDeclInternal(Decl *D)
Add the declaration D into this context, but suppress searches for external declarations with the sam...
lookups_range lookups() const
const DeclContext * getLookupParent() const
Definition DeclBase.h:2134
bool shouldUseQualifiedLookup() const
Definition DeclBase.h:2723
bool containsDeclAndLoad(Decl *D) const
Checks whether a declaration is in this context.
void removeDecl(Decl *D)
Removes a declaration from this context.
void addDecl(Decl *D)
Add the declaration D into this context.
@ NumCXXConstructorDeclBits
Definition DeclBase.h:1865
llvm::iterator_range< decl_iterator > decl_range
Definition DeclBase.h:2369
void dumpDeclContext() const
StoredDeclsMap * buildLookup()
Ensure the lookup structure is fully-built and return it.
decl_iterator decls_end() const
Definition DeclBase.h:2375
@ NumFunctionDeclBits
Definition DeclBase.h:1835
bool hasValidDeclKind() const
bool isStdNamespace() const
ddiag_range ddiags() const
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
static bool classof(const Decl *D)
const DeclContext * getNonTransparentContext() const
Definition DeclBase.h:2260
const RecordDecl * getOuterLexicalRecordContext() const
Definition DeclBase.h:2291
bool containsDecl(Decl *D) const
Checks whether a declaration is in this context.
llvm::iterator_range< DeclContext::ddiag_iterator > ddiag_range
Definition DeclBase.h:2661
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
Definition DeclBase.h:2688
void setUseQualifiedLookup(bool use=true) const
Definition DeclBase.h:2719
DeclContext * getEnclosingNamespaceContext()
Retrieve the nearest enclosing namespace context.
friend class ExternalASTSource
For reconcileExternalVisibleStorage, CreateStoredDeclsMap, hasNeedToReconcileExternalVisibleStorage.
Definition DeclBase.h:1456
Decl * LastDecl
LastDecl - The last declaration stored within this declaration context.
Definition DeclBase.h:2085
friend class ASTDeclWriter
For checking the new bits in the Serialization part.
Definition DeclBase.h:1453
NamespaceDeclBitfields NamespaceDeclBits
Definition DeclBase.h:2039
all_lookups_iterator lookups_begin() const
Iterators over all possible lookups within this context.
llvm::iterator_range< all_lookups_iterator > lookups_range
Definition DeclBase.h:2624
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
Definition DeclBase.h:2381
friend class DependentDiagnostic
For CreateStoredDeclsMap.
Definition DeclBase.h:1458
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
RecordDecl * getOuterLexicalRecordContext()
Retrieve the outermost lexically enclosing record context.
const DeclContext * getEnclosingNamespaceContext() const
Definition DeclBase.h:2285
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Definition DeclBase.h:2373
@ NumDeclContextBits
Definition DeclBase.h:1515
bool isInlineNamespace() const
DeclContextBitfields DeclContextBits
Definition DeclBase.h:2038
bool isFunctionOrMethod() const
Definition DeclBase.h:2161
llvm::iterator_adaptor_base< udir_iterator, lookup_iterator, lookup_iterator::iterator_category, UsingDirectiveDecl * > udir_iterator_base
Definition DeclBase.h:2643
void setHasExternalLexicalStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations lexically in this context.
Definition DeclBase.h:2694
DeclContext * getLookupParent()
Find the parent context of this context that will be used for unqualified name lookup.
StoredDeclsMap * LookupPtr
Pointer to the data structure used to lookup declarations within this context (or a DependentStoredDe...
Definition DeclBase.h:2026
bool isExternCContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
all_lookups_iterator noload_lookups_end() const
const LinkageSpecDecl * getExternCContext() const
Retrieve the nearest enclosing C linkage specification context.
LinkageSpecDeclBitfields LinkageSpecDeclBits
Definition DeclBase.h:2048
decl_iterator noload_decls_end() const
Definition DeclBase.h:2385
@ NumNamespaceDeclBits
Definition DeclBase.h:1536
StoredDeclsMap * getLookupPtr() const
Retrieve the internal representation of the lookup structure.
Definition DeclBase.h:2681
bool Encloses(const DeclContext *DC) const
Determine whether this declaration context semantically encloses the declaration context DC.
void addHiddenDecl(Decl *D)
Add the declaration D to this context without modifying any lookup tables.
void localUncachedLookup(DeclarationName Name, SmallVectorImpl< NamedDecl * > &Results)
A simplistic name lookup mechanism that performs name lookup into this declaration context without co...
OMPDeclareReductionDeclBitfields OMPDeclareReductionDeclBits
Definition DeclBase.h:2043
bool isDeclInLexicalTraversal(const Decl *D) const
Determine whether the given declaration is stored in the list of declarations lexically within this c...
Definition DeclBase.h:2714
Decl::Kind getDeclKind() const
Definition DeclBase.h:2102
@ NumObjCMethodDeclBits
Definition DeclBase.h:1942
DeclContext * getNonTransparentContext()
@ NumObjCContainerDeclBits
Definition DeclBase.h:1961
decl_iterator decls_begin() const
bool LexicallyEncloses(const DeclContext *DC) const
Determine whether this declaration context lexically encloses the declaration context DC.
const DeclContext * getLexicalParent() const
Definition DeclBase.h:2128
Definition DeclBase.h:1334
std::forward_iterator_tag iterator_category
Definition DeclBase.h:1345
void operator->() const
Definition DeclBase.h:1355
ptrdiff_t difference_type
Definition DeclBase.h:1341
void pointer
Definition DeclBase.h:1343
friend class DeclContextLookupResult
Definition DeclBase.h:1335
reference operator*() const
Definition DeclBase.h:1349
bool operator==(const iterator &X) const
Definition DeclBase.h:1356
iterator & operator++()
Definition DeclBase.h:1358
iterator operator++(int)
Definition DeclBase.h:1367
friend class StoredDeclsList
Definition DeclBase.h:1336
bool operator!=(const iterator &X) const
Definition DeclBase.h:1357
iterator end()
Definition DeclBase.h:1373
value_type reference
Definition DeclBase.h:1344
NamedDecl * value_type
Definition DeclBase.h:1342
A list storing NamedDecls in the lookup tables.
Definition DeclBase.h:1329
friend class ASTContext
Definition DeclBase.h:1330
friend class StoredDeclsList
Definition DeclBase.h:1331
llvm::PointerUnion< NamedDecl *, DeclListNode * > Decls
Definition DeclBase.h:1333
Iterates through all the redeclarations of the same decl.
Definition DeclBase.h:1003
friend bool operator!=(redecl_iterator x, redecl_iterator y)
Definition DeclBase.h:1040
Decl * value_type
Definition DeclBase.h:1009
redecl_iterator(Decl *C)
Definition DeclBase.h:1016
value_type operator->() const
Definition DeclBase.h:1019
redecl_iterator & operator++()
Definition DeclBase.h:1021
redecl_iterator operator++(int)
Definition DeclBase.h:1030
friend bool operator==(redecl_iterator x, redecl_iterator y)
Definition DeclBase.h:1036
const value_type * pointer
Definition DeclBase.h:1011
std::ptrdiff_t difference_type
Definition DeclBase.h:1013
redecl_iterator()=default
const value_type & reference
Definition DeclBase.h:1010
reference operator*() const
Definition DeclBase.h:1018
std::forward_iterator_tag iterator_category
Definition DeclBase.h:1012
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
Definition DeclBase.h:1061
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
Definition DeclBase.h:1076
const DeclContext * getParentFunctionOrMethod(bool LexicalParent=false) const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...
bool isInStdNamespace() const
unsigned CacheValidAndLinkage
If 0, we have not computed the linkage of this declaration.
Definition DeclBase.h:348
bool isInCurrentModuleUnit() const
Whether this declaration comes from the same module unit being compiled.
SourceLocation getEndLoc() const LLVM_READONLY
Definition DeclBase.h:435
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition DeclBase.h:648
TemplateDecl * getDescribedTemplate() const
If this is a declaration that describes some template, this method returns that template declaration.
bool isTemplateDecl() const
returns true if this declaration is a template
Module * getTopLevelOwningNamedModule() const
Get the top level owning named module that owns this declaration if any.
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition DeclBase.h:1226
bool isFunctionOrFunctionTemplate() const
Whether this declaration is a function or function template.
Definition DeclBase.h:1119
bool isModuleLocal() const
Whether this declaration was a local declaration to a C++20 named module.
bool isFromGlobalModule() const
Whether this declaration comes from global module.
T * getAttr() const
Definition DeclBase.h:573
static bool isFlexibleArrayMemberLike(const ASTContext &Context, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution)
Whether it resembles a flexible array member.
bool hasAttrs() const
Definition DeclBase.h:518
ASTContext & getASTContext() const LLVM_READONLY
void setOwningModuleID(unsigned ID)
Set the owning module ID.
attr_iterator attr_end() const
Definition DeclBase.h:542
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition DeclBase.h:593
void setAttrs(const AttrVec &Attrs)
Definition DeclBase.h:520
void dropAttrs()
Definition DeclBase.h:546
bool isUnavailable(std::string *Message=nullptr) const
Determine whether this declaration is marked 'unavailable'.
Definition DeclBase.h:771
bool hasLocalOwningModuleStorage() const
const Decl * getPreviousDecl() const
Retrieve the previous declaration that declares the same entity as this declaration,...
Definition DeclBase.h:1065
friend class Redeclarable
Definition DeclBase.h:331
bool isFunctionPointerType() const
bool isInNamedModule() const
Whether this declaration comes from a named module.
const TranslationUnitDecl * getTranslationUnitDecl() const
Definition DeclBase.h:476
bool isReachable() const
Definition DeclBase.h:863
ExternalSourceSymbolAttr * getExternalSourceSymbolAttr() const
Looks on this and related declarations for an applicable external source symbol attribute.
void setFromASTFile()
Set the FromASTFile flag.
Definition DeclBase.h:718
void setLocalExternDecl()
Changes the namespace of this declaration to reflect that it's a function-local extern declaration.
Definition DeclBase.h:1151
Decl(Kind DK, DeclContext *DC, SourceLocation L)
Definition DeclBase.h:392
virtual bool isOutOfLine() const
Determine whether this declaration is declared out of line (outside its semantic context).
virtual Decl * getPreviousDeclImpl()
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Definition DeclBase.h:995
Decl(Kind DK, EmptyShell Empty)
Definition DeclBase.h:402
llvm::iterator_range< redecl_iterator > redecl_range
Definition DeclBase.h:1045
const Decl * getCanonicalDecl() const
Definition DeclBase.h:979
bool isWeakImported() const
Determine whether this is a weak-imported symbol.
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
Definition DeclBase.h:876
bool isParameterPack() const
Whether this declaration is a parameter pack.
ASTMutationListener * getASTMutationListener() const
bool hasCachedLinkage() const
Definition DeclBase.h:421
unsigned getMaxAlignment() const
getMaxAlignment - return the maximum alignment specified by attributes on this decl,...
AvailabilityResult getAvailability(std::string *Message=nullptr, VersionTuple EnclosingVersion=VersionTuple(), StringRef *RealizedPlatform=nullptr) const
Determine the availability of the given declaration.
void setInvalidDecl(bool Invalid=true)
setInvalidDecl - Indicates the Decl had a semantic error.
bool isUnconditionallyVisible() const
Determine whether this declaration is definitely visible to name lookup, independent of whether the o...
Definition DeclBase.h:859
friend class ASTDeclMerger
Definition DeclBase.h:323
DeclContext * getParentFunctionOrMethod(bool LexicalParent=false)
Definition DeclBase.h:971
Kind
Lists the kind of concrete classes of Decl.
Definition DeclBase.h:89
void clearIdentifierNamespace()
Clears the namespace of this declaration.
Definition DeclBase.h:1214
AttrVec::const_iterator attr_iterator
Definition DeclBase.h:532
static unsigned getIdentifierNamespaceForKind(Kind DK)
void setTopLevelDeclInObjCContainer(bool V=true)
Definition DeclBase.h:638
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
Definition DeclBase.h:1087
void markUsed(ASTContext &C)
Mark the declaration used, in the sense of odr-use.
bool isInIdentifierNamespace(unsigned NS) const
Definition DeclBase.h:893
bool isFileContextDecl() const
static Decl * castFromDeclContext(const DeclContext *)
FriendObjectKind
Definition DeclBase.h:1216
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition DeclBase.h:1219
@ FOK_None
Not a friend object.
Definition DeclBase.h:1217
@ FOK_Declared
A friend of a previously-declared entity.
Definition DeclBase.h:1218
Decl * getNextDeclInContext()
Definition DeclBase.h:445
friend class ASTReader
Definition DeclBase.h:327
bool isInvisibleOutsideTheOwningModule() const
Definition DeclBase.h:670
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
bool isInExportDeclContext() const
Whether this declaration was exported in a lexical context.
SourceLocation getBodyRBrace() const
getBodyRBrace - Gets the right brace of the body, if a body exists.
static bool isTagIdentifierNamespace(unsigned NS)
Definition DeclBase.h:903
bool isReferenced() const
Whether any declaration of this entity was referenced.
const FunctionType * getFunctionType(bool BlocksToo=true) const
Looks through the Decl's underlying type to extract a FunctionType when possible.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
Definition DeclBase.h:984
bool isInAnotherModuleUnit() const
Whether this declaration comes from another module unit.
llvm::PointerIntPair< Decl *, 3, ModuleOwnershipKind > NextInContextAndBits
The next declaration within the same lexical DeclContext.
Definition DeclBase.h:249
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition DeclBase.h:842
unsigned getTemplateDepth() const
Determine the number of levels of template parameter surrounding this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Definition DeclBase.h:1070
friend class ASTDeclReader
Definition DeclBase.h:324
bool isFromExplicitGlobalModule() const
Whether this declaration comes from explicit global module.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
Module * getImportedOwningModule() const
Get the imported owning module, if this decl is from an imported (non-local) module.
Definition DeclBase.h:812
friend class ASTNodeImporter
Definition DeclBase.h:326
bool canBeWeakImported(bool &IsDefinition) const
Determines whether this symbol can be weak-imported, e.g., whether it would be well-formed to add the...
static DeclContext * castToDeclContext(const Decl *)
const DeclContext * getDeclContext() const
Definition DeclBase.h:453
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
Definition DeclBase.h:198
@ OBJC_TQ_Byref
Definition DeclBase.h:204
@ OBJC_TQ_Oneway
Definition DeclBase.h:205
@ OBJC_TQ_Bycopy
Definition DeclBase.h:203
@ OBJC_TQ_None
Definition DeclBase.h:199
@ OBJC_TQ_CSNullability
The nullability qualifier is set when the nullability of the result or parameter was expressed via a ...
Definition DeclBase.h:210
@ OBJC_TQ_Inout
Definition DeclBase.h:201
@ OBJC_TQ_In
Definition DeclBase.h:200
@ OBJC_TQ_Out
Definition DeclBase.h:202
const TemplateParameterList * getDescribedTemplateParams() const
If this is a declaration that describes some template or partial specialization, this returns the cor...
void invalidateCachedLinkage()
When doing manipulations which might change the computed linkage, such as changing the DeclContext af...
Definition DeclBase.h:629
void setObjectOfFriendDecl(bool PerformFriendInjection=false)
Changes the namespace of this declaration to reflect that it's the object of a friend declaration.
Definition DeclBase.h:1180
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition DeclBase.h:793
attr_iterator attr_begin() const
Definition DeclBase.h:539
bool isInLocalScopeForInstantiation() const
Determine whether a substitution into this declaration would occur as part of a substitution into a d...
const Attr * getDefiningAttr() const
Return this declaration's defining attribute if it has one.
Linkage getCachedLinkage() const
Definition DeclBase.h:413
bool isTemplateParameter() const
isTemplateParameter - Determines whether this declaration is a template parameter.
Definition DeclBase.h:2793
DeclContext * getNonTransparentDeclContext()
Return the non transparent context.
virtual bool hasBody() const
Returns true if this Decl represents a declaration for a body of code, such as a function or method d...
Definition DeclBase.h:1093
Decl * getNonClosureContext()
Find the innermost non-closure ancestor of this declaration, walking up through blocks,...
bool isInvalidDecl() const
Definition DeclBase.h:588
unsigned getIdentifierNamespace() const
Definition DeclBase.h:889
unsigned FromASTFile
Whether this declaration was loaded from an AST file.
Definition DeclBase.h:340
const Decl * getMostRecentDecl() const
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
Definition DeclBase.h:1080
virtual Decl * getNextRedeclarationImpl()
Returns the next redeclaration or itself if this is the only decl.
Definition DeclBase.h:991
Decl & operator=(Decl &&)=delete
bool hasDefiningAttr() const
Return true if this declaration has an attribute which acts as definition of the entity,...
bool isLocalExternDecl() const
Determine whether this is a block-scope declaration with linkage.
Definition DeclBase.h:1169
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
Definition DeclBase.h:559
friend class CXXClassMemberWrapper
Definition DeclBase.h:328
void setAccess(AccessSpecifier AS)
Definition DeclBase.h:502
SourceLocation getLocation() const
Definition DeclBase.h:439
redecl_iterator redecls_end() const
Definition DeclBase.h:1057
const char * getDeclKindName() const
IdentifierNamespace
IdentifierNamespace - The different namespaces in which declarations may appear.
Definition DeclBase.h:115
@ IDNS_NonMemberOperator
This declaration is a C++ operator declared in a non-class context.
Definition DeclBase.h:168
@ IDNS_TagFriend
This declaration is a friend class.
Definition DeclBase.h:157
@ IDNS_Ordinary
Ordinary names.
Definition DeclBase.h:144
@ IDNS_Type
Types, declared with 'struct foo', typedefs, etc.
Definition DeclBase.h:130
@ IDNS_OMPReduction
This declaration is an OpenMP user defined reduction construction.
Definition DeclBase.h:178
@ IDNS_Label
Labels, declared with 'x:' and referenced with 'goto x'.
Definition DeclBase.h:117
@ IDNS_Member
Members, declared with object declarations within tag definitions.
Definition DeclBase.h:136
@ IDNS_OMPMapper
This declaration is an OpenMP user defined mapper.
Definition DeclBase.h:181
@ IDNS_ObjCProtocol
Objective C @protocol.
Definition DeclBase.h:147
@ IDNS_Namespace
Namespaces, declared with 'namespace foo {}'.
Definition DeclBase.h:140
@ IDNS_OrdinaryFriend
This declaration is a friend function.
Definition DeclBase.h:152
@ IDNS_Using
This declaration is a using declaration.
Definition DeclBase.h:163
@ IDNS_LocalExtern
This declaration is a function-local extern declaration of a variable or function.
Definition DeclBase.h:175
@ IDNS_Tag
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
Definition DeclBase.h:125
bool isDeprecated(std::string *Message=nullptr) const
Determine whether this declaration is marked 'deprecated'.
Definition DeclBase.h:762
AccessSpecifier getAccessUnsafe() const
Retrieve the access specifier for this declaration, even though it may not yet have been properly set...
Definition DeclBase.h:514
bool isTemplateParameterPack() const
isTemplateParameter - Determines whether this declaration is a template parameter pack.
void setLocalOwningModule(Module *M)
Definition DeclBase.h:829
const DeclContext * getNonTransparentDeclContext() const
Definition DeclBase.h:461
void setImplicit(bool I=true)
Definition DeclBase.h:594
void setReferenced(bool R=true)
Definition DeclBase.h:623
const DeclContext * getLexicalDeclContext() const
Definition DeclBase.h:923
static void printGroup(Decl **Begin, unsigned NumDecls, raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation=0)
friend class ASTDeclWriter
Definition DeclBase.h:325
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition DeclBase.h:621
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Definition DeclBase.h:1049
void setIsUsed()
Set whether the declaration is used, in the sense of odr-use.
Definition DeclBase.h:608
unsigned Access
Access - Used by C++ decls for the access specifier.
Definition DeclBase.h:336
bool isTopLevelDeclInObjCContainer() const
Whether this declaration is a top-level declaration (function, global variable, etc....
Definition DeclBase.h:634
void setLocation(SourceLocation L)
Definition DeclBase.h:440
friend class LinkageComputer
Definition DeclBase.h:329
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
bool isDefinedOutsideFunctionOrMethod() const
isDefinedOutsideFunctionOrMethod - This predicate returns true if this scoped decl is defined outside...
Definition DeclBase.h:949
DeclContext * getDeclContext()
Definition DeclBase.h:448
attr_range attrs() const
Definition DeclBase.h:535
AccessSpecifier getAccess() const
Definition DeclBase.h:507
const Decl * getNextDeclInContext() const
Definition DeclBase.h:446
bool isInAnonymousNamespace() const
SourceLocation getBeginLoc() const LLVM_READONLY
Definition DeclBase.h:431
redecl_iterator redecls_begin() const
Definition DeclBase.h:1053
static void EnableStatistics()
TranslationUnitDecl * getTranslationUnitDecl()
VersionTuple getVersionIntroduced() const
Retrieve the version of the target platform in which this declaration was introduced.
specific_attr_iterator< T > specific_attr_end() const
Definition DeclBase.h:569
virtual Decl * getMostRecentDeclImpl()
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
Definition DeclBase.h:999
bool hasOwningModule() const
Is this declaration owned by some module?
Definition DeclBase.h:837
Decl(const Decl &)=delete
void setCachedLinkage(Linkage L) const
Definition DeclBase.h:417
void setModulePrivate()
Specify that this declaration was marked as being private to the module in which it was defined.
Definition DeclBase.h:706
bool isFromHeaderUnit() const
Whether this declaration comes from a header unit.
friend class RecordDecl
Definition DeclBase.h:330
void dropAttr()
Definition DeclBase.h:556
llvm::iterator_range< attr_iterator > attr_range
Definition DeclBase.h:533
specific_attr_iterator< T > specific_attr_begin() const
Definition DeclBase.h:564
void print(raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const
AttrVec & getAttrs()
Definition DeclBase.h:524
void setDeclContext(DeclContext *DC)
setDeclContext - Set both the semantic and lexical DeclContext to DC.
Module * getOwningModuleForLinkage() const
Get the module that owns this declaration for linkage purposes.
bool hasTagIdentifierNamespace() const
Definition DeclBase.h:899
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition DeclBase.h:918
bool hasAttr() const
Definition DeclBase.h:577
friend class DeclContext
Definition DeclBase.h:252
void setNonMemberOperator()
Specifies that this declaration is a C++ overloaded non-member.
Definition DeclBase.h:1235
void setLexicalDeclContext(DeclContext *DC)
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Definition DeclBase.h:978
ModuleOwnershipKind
The kind of ownership a declaration has, for visibility purposes.
Definition DeclBase.h:216
@ VisibleWhenImported
This declaration has an owning module, and is visible when that module is imported.
Definition DeclBase.h:229
@ Unowned
This declaration is not owned by a module.
Definition DeclBase.h:218
@ ReachableWhenImported
This declaration has an owning module, and is visible to lookups that occurs within that module.
Definition DeclBase.h:234
@ ModulePrivate
This declaration has an owning module, but is only visible to lookups that occur within that module.
Definition DeclBase.h:240
@ Visible
This declaration has an owning module, but is globally visible (typically because its owning module i...
Definition DeclBase.h:225
Kind getKind() const
Definition DeclBase.h:442
void setModuleOwnershipKind(ModuleOwnershipKind MOK)
Set whether this declaration is hidden from name lookup.
Definition DeclBase.h:881
Module * getLocalOwningModule() const
Get the local owning module, if known.
Definition DeclBase.h:821
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition DeclBase.h:427
GlobalDeclID getGlobalID() const
Retrieve the global declaration ID associated with this declaration, which specifies where this Decl ...
unsigned getOwningModuleID() const
Retrieve the global ID of the module that owns this particular declaration.
static bool classofKind(Kind K)
Definition DeclBase.h:1242
bool shouldEmitInExternalSource() const
Whether the definition of the declaration should be emitted in external sources.
Decl & operator=(const Decl &)=delete
void setVisibleDespiteOwningModule()
Set that this declaration is globally visible, even if it came from a module that is not visible.
Definition DeclBase.h:870
const Decl * getNonClosureContext() const
Definition DeclBase.h:471
The name of a declaration.
Represents a function declaration or definition.
FunctionType - C99 6.7.5.3 - Function Declarators.
One of these records is kept for each identifier that is lexed.
StrictFlexArraysLevelKind
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Represents a linkage specification.
Describes a module or submodule.
This represents a decl that may have a name.
ObjCContainerDecl - Represents a container for method declarations.
ObjCMethodDecl - Represents an instance or class method declaration.
void print(raw_ostream &OS) const override
PrettyStackTraceDecl(const Decl *theDecl, SourceLocation L, SourceManager &sm, const char *Msg)
Definition DeclBase.h:1307
A (possibly-)qualified type.
Represents a struct/union/class.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
Stmt - This represents one statement.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
The top declaration context.
Represents C++ using-directive.
specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are o...
The JSON file list parser is used to communicate input to InstallAPI.
ASTDumpOutputFormat
Used to specify the format for printing AST dump information.
@ ObjCMethodFamilyBitWidth
bool isa(CodeGen::Address addr)
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
bool hasSpecificAttr(const Container &container)
ConstexprSpecKind
Define the kind of constexpr specifier.
LinkageSpecLanguageIDs
Represents the language in a linkage specification.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
SmallVector< Attr *, 4 > AttrVec
AttrVec - A vector of Attr, which is how they are stored on the AST.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
OMPDeclareReductionInitKind
StorageClass
Storage classes.
ObjCMethodFamily
A family of Objective-C methods.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ Internal
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
const FunctionProtoType * T
TagTypeKind
The kind of a tag type.
@ FunctionTemplate
The name was classified as a function template name.
AvailabilityResult
Captures the result of checking the availability of a declaration.
Definition DeclBase.h:72
@ AR_NotYetIntroduced
Definition DeclBase.h:74
@ AR_Available
Definition DeclBase.h:73
@ AR_Deprecated
Definition DeclBase.h:75
@ AR_Unavailable
Definition DeclBase.h:76
ObjCImplementationControl
RecordArgPassingKind
Enum that represents the different ways arguments are passed to and returned from function calls.
auto * getSpecificAttr(const Container &container)
DeductionCandidate
Only used by CXXDeductionGuideDecl.
Definition DeclBase.h:1421
@ Aggregate
Definition DeclBase.h:1424
@ Copy
Definition DeclBase.h:1423
@ Normal
Definition DeclBase.h:1422
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
Definition DeclBase.h:1288
U cast(CodeGen::Address addr)
Diagnostic wrappers for TextAPI types for error reporting.
Definition DeclBase.h:2648
UsingDirectiveDecl * operator*() const
udir_iterator(lookup_iterator I)
Definition DeclBase.h:2649
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
Definition DeclBase.h:102
Describes how types, statements, expressions, and declarations should be printed.
static ToTy * doit(DeclContext *Val)
Definition DeclBase.h:2818
static const ToTy * doit(const DeclContext *Val)
Definition DeclBase.h:2814
Definition DeclBase.h:2801
static const ToTy * doit(const DeclContext *Val)
Definition DeclBase.h:2802
static ToTy * doit(DeclContext *Val)
Definition DeclBase.h:2806
static void * getAsVoidPointer(::clang::NamedDecl *P)
Definition DeclBase.h:1319
static inline ::clang::NamedDecl * getFromVoidPointer(void *P)
Definition DeclBase.h:1320
static constexpr int NumLowBitsAvailable
Definition DeclBase.h:1323
static ToTy & doit(::clang::DeclContext &Val)
Definition DeclBase.h:2846
static ToTy * doit(::clang::DeclContext *Val)
Definition DeclBase.h:2861
static const ToTy & doit(const ::clang::DeclContext &Val)
Definition DeclBase.h:2839
static const ToTy * doit(const ::clang::DeclContext *Val)
Definition DeclBase.h:2854
::clang::DeclContext & doit(const FromTy &Val)
Definition DeclBase.h:2869
::clang::DeclContext * doit(const FromTy *Val)
Definition DeclBase.h:2876
static const ::clang::DeclContext & doit(const FromTy &Val)
Definition DeclBase.h:2883
static const ::clang::DeclContext * doit(const FromTy *Val)
Definition DeclBase.h:2890
static bool doit(const ::clang::DeclContext &Val)
Definition DeclBase.h:2830