clang: include/clang/AST/Decl.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_AST_DECL_H
14#define LLVM_CLANG_AST_DECL_H
15
37#include "llvm/ADT/APSInt.h"
38#include "llvm/ADT/ArrayRef.h"
39#include "llvm/ADT/PointerIntPair.h"
40#include "llvm/ADT/PointerUnion.h"
41#include "llvm/ADT/StringRef.h"
42#include "llvm/ADT/iterator_range.h"
43#include "llvm/Support/Casting.h"
44#include "llvm/Support/Compiler.h"
45#include "llvm/Support/TrailingObjects.h"
46#include
47#include
48#include
49#include
50#include
51#include
52
54
55class ASTContext;
56struct ASTTemplateArgumentListInfo;
57class CompoundStmt;
58class DependentFunctionTemplateSpecializationInfo;
59class EnumDecl;
60class Expr;
61class FunctionTemplateDecl;
62class FunctionTemplateSpecializationInfo;
63class FunctionTypeLoc;
64class LabelStmt;
65class MemberSpecializationInfo;
67class NamespaceDecl;
68class ParmVarDecl;
69class RecordDecl;
70class Stmt;
71class StringLiteral;
72class TagDecl;
73class TemplateArgumentList;
74class TemplateArgumentListInfo;
75class TemplateParameterList;
76class TypeAliasTemplateDecl;
77class UnresolvedSetImpl;
78class VarTemplateDecl;
80
81
86
89 }
90
93 }
94
97 }
98
100
101
102
104
106
107 virtual void anchor();
108
109public:
112
119
121
124
126
127
132 }
135 }
136
137
140};
141
142
143
145 : public Decl,
146 private llvm::TrailingObjects<PragmaCommentDecl, char> {
149 friend TrailingObjects;
150
152
155 : Decl(PragmaComment, TU, CommentLoc), CommentKind(CommentKind) {}
156
157 virtual void anchor();
158
159public:
163 StringRef Arg);
165 unsigned ArgSize);
166
168
169 StringRef getArg() const { return getTrailingObjects(); }
170
171
174};
175
176
177
179 : public Decl,
180 private llvm::TrailingObjects<PragmaDetectMismatchDecl, char> {
183 friend TrailingObjects;
184
185 size_t ValueStart;
186
188 size_t ValueStart)
189 : Decl(PragmaDetectMismatch, TU, Loc), ValueStart(ValueStart) {}
190
191 virtual void anchor();
192
193public:
197 StringRef Value);
200
201 StringRef getName() const { return getTrailingObjects(); }
202 StringRef getValue() const { return getTrailingObjects() + ValueStart; }
203
204
206 static bool classofKind(Kind K) { return K == PragmaDetectMismatch; }
207};
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
230
231 virtual void anchor();
232
233public:
237
242 }
245 }
246};
247
248
249
250
251
252
254
255
256
258
259 virtual void anchor();
260
261private:
262 NamedDecl *getUnderlyingDeclImpl() LLVM_READONLY;
263
264protected:
266 : Decl(DK, DC, L), Name(N) {}
267
268public:
269
270
271
272
273
275
276
277
278
279
281 assert(Name.isIdentifier() && "Name is not a simple identifier");
283 }
284
285
286
287
288
289
290
291
292
293
294
295
297
298
299
301
302 void printName(raw_ostream &OS) const;
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
320
321
323
324
325
326
327
328
329
330
331
334
335
336
337
338
342
343
345
346
347
348
349
350
351
355
356
357
358
359
360
361
362
363
364
365
367 bool IsKnownNewer = true) const;
368
369
371
374
375
378
379
380
381
382 if (isa(DC))
384
386 }
387
388
389
391
392
393
395
396
397
398
399
400
402
403
404
406
407
410 }
411
414 }
415
416
417
420 }
421
422
425 }
426
427
429
430
432
433
434
436
437
438
439
442
443
444
445 std::optional
447
448
449
451
452
453
454
455
456
457
460 }
461
463
464
465
467
468 if (this->getKind() != UsingShadow &&
469 this->getKind() != ConstructorUsingShadow &&
470 this->getKind() != ObjCCompatibleAlias &&
471 this->getKind() != NamespaceAlias)
472 return this;
473
474 return getUnderlyingDeclImpl();
475 }
478 }
479
482 }
485 }
486
488
490 static bool classofKind(Kind K) { return K >= firstNamed && K <= lastNamed; }
491};
492
495 return OS;
496}
497
498
499
500
501
502
505 StringRef MSAsmName;
506 bool MSAsmNameResolved = false;
507
508
509
510
512
515 : NamedDecl(Label, DC, IdentL, II), TheStmt(S), LocStart(StartL) {}
516
517 void anchor() override;
518
519public:
526
529
532
535 }
536
542
543
546};
547
548
552
553
555
556
558
559
561
565
567
568 NamespaceDecl *getNextRedeclarationImpl() override;
571
572public:
575
579 bool Nested);
580
582
585
592
593
594
595
596
597
598
599
600
601
604 }
605
606
608
609
611
612
613
614
615
617
618
620
621
624 return false;
626
627
629 return std::distance(X.begin(), X.end()) ==
630 std::distance(Y.begin(), Y.end());
631 }
632
633
636 }
637
640 }
641
642
645
648 }
649
654
655
660 }
663 }
664};
665
666class VarDecl;
667
668
669
670
673
674 void anchor() override;
675
676protected:
679 : NamedDecl(DK, DC, L, N), DeclType(T) {}
680
681public:
684
685
686
688
689
690
691
693
694
695
699 }
700
701
703 static bool classofKind(Kind K) { return K >= firstValue && K <= lastValue; }
704};
705
706
707
710
711
712
713
714
716
717
718
719
720
721
723
727
728
731};
732
733
734
736
737
738
741 Expr *TrailingRequiresClause = nullptr;
742 };
743
744 llvm::PointerUnion<TypeSourceInfo *, ExtInfo *> DeclInfo;
745
746
747
749
750 bool hasExtInfo() const { return isa<ExtInfo *>(DeclInfo); }
751 ExtInfo *getExtInfo() { return cast<ExtInfo *>(DeclInfo); }
752 const ExtInfo *getExtInfo() const { return cast<ExtInfo *>(DeclInfo); }
753
754protected:
758 : ValueDecl(DK, DC, L, N, T), DeclInfo(TInfo), InnerLocStart(StartL) {}
759
760public:
763
765 return hasExtInfo() ? getExtInfo()->TInfo
766 : cast<TypeSourceInfo *>(DeclInfo);
767 }
768
770 if (hasExtInfo())
771 getExtInfo()->TInfo = TI;
772 else
773 DeclInfo = TI;
774 }
775
776
779
780
781
783
785
788 }
789
790
791
793 return hasExtInfo() ? getExtInfo()->QualifierLoc.getNestedNameSpecifier()
794 : nullptr;
795 }
796
797
798
799
801 return hasExtInfo() ? getExtInfo()->QualifierLoc
803 }
804
806
807
808
809
811 return hasExtInfo() ? getExtInfo()->TrailingRequiresClause
812 : nullptr;
813 }
814
816 return hasExtInfo() ? getExtInfo()->TrailingRequiresClause
817 : nullptr;
818 }
819
821
823 return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0;
824 }
825
828 return getExtInfo()->TemplParamLists[index];
829 }
830
833
836
837
840 return K >= firstDeclarator && K <= lastDeclarator;
841 }
842};
843
844
845
846
848
850
851
853
854
855
856
857
859
860
861
862
863
864
866
867
868
871
874
879};
880
881
883public:
884
886
888
889
891
892
894
895
898
899
901
903
904
906
907
910
911
912
913
915
916protected:
917
918
919
920
921
922
923
924 using InitType = llvm::PointerUnion<Stmt *, EvaluatedStmt *>;
925
926
927
929
930private:
934
935 class VarDeclBitfields {
938
940 unsigned SClass : 3;
942 unsigned TSCSpec : 2;
944 unsigned InitStyle : 2;
945
946
947
948 LLVM_PREFERRED_TYPE(bool)
949 unsigned ARCPseudoStrong : 1;
950 };
951 enum { NumVarDeclBits = 8 };
952
953protected:
955
962
964
968
969 LLVM_PREFERRED_TYPE(VarDeclBitfields)
971
972
973
974 LLVM_PREFERRED_TYPE(bool)
975 unsigned HasInheritedDefaultArg : 1;
976
977
978
979
980
983
984
985 LLVM_PREFERRED_TYPE(bool)
986 unsigned IsKNRPromoted : 1;
987
988
989 LLVM_PREFERRED_TYPE(bool)
990 unsigned IsObjCMethodParam : 1;
991
992
993
994
995
997
998
999
1001 };
1002
1007
1008 LLVM_PREFERRED_TYPE(VarDeclBitfields)
1010
1011
1012
1013
1014 LLVM_PREFERRED_TYPE(bool)
1015 unsigned IsThisDeclarationADemotedDefinition : 1;
1016
1017
1018
1019 LLVM_PREFERRED_TYPE(bool)
1020 unsigned ExceptionVar : 1;
1021
1022
1023
1024
1025 LLVM_PREFERRED_TYPE(bool)
1026 unsigned NRVOVariable : 1;
1027
1028
1029
1030 LLVM_PREFERRED_TYPE(bool)
1031 unsigned CXXForRangeDecl : 1;
1032
1033
1034 LLVM_PREFERRED_TYPE(bool)
1035 unsigned ObjCForDecl : 1;
1036
1037
1038 LLVM_PREFERRED_TYPE(bool)
1039 unsigned IsInline : 1;
1040
1041
1042 LLVM_PREFERRED_TYPE(bool)
1043 unsigned IsInlineSpecified : 1;
1044
1045
1046 LLVM_PREFERRED_TYPE(bool)
1047 unsigned IsConstexpr : 1;
1048
1049
1050
1051 LLVM_PREFERRED_TYPE(bool)
1052 unsigned IsInitCapture : 1;
1053
1054
1055
1056
1057 LLVM_PREFERRED_TYPE(bool)
1058 unsigned PreviousDeclInSameBlockScope : 1;
1059
1060
1061
1064
1065 LLVM_PREFERRED_TYPE(bool)
1066 unsigned EscapingByref : 1;
1067
1068 LLVM_PREFERRED_TYPE(bool)
1069 unsigned IsCXXCondDecl : 1;
1070 };
1071
1072 union {
1077 };
1078
1082
1084
1087 }
1088
1091 }
1092
1095 }
1096
1097public:
1100
1107
1112
1114
1116
1117
1118
1121 }
1123
1126 assert(VarDeclBits.TSCSpec == TSC && "truncation");
1127 }
1130 }
1132
1133
1134
1137
1138
1139
1140
1142 return false;
1143
1145 }
1146
1147
1149 return false;
1150
1151
1152
1153
1155 }
1156
1157
1158
1161
1164 }
1165
1166
1167
1171 }
1172
1173
1174
1175
1176
1178
1179
1183 }
1184
1185
1187
1188
1190
1191
1192
1194
1195
1196
1198
1199
1200
1201
1202
1203
1205 if (getKind() != Decl::Var && getKind() != Decl::Decomposition)
1206 return false;
1208 return DC->getRedeclContext()->isFunctionOrMethod();
1209 return false;
1210 }
1211
1212
1215 }
1216
1217
1219 if (getKind() != Decl::Var && getKind() != Decl::Decomposition)
1220 return false;
1223 }
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1235
1237 }
1238
1242 }
1243
1245
1247
1248
1250
1251
1254
1255
1256
1257
1261 }
1262
1263
1267 }
1268
1269
1270
1274 }
1275
1276
1280 }
1283 }
1286 }
1287
1288
1289
1291
1292
1295 if (K == ParmVar || K == ImplicitParam)
1296 return false;
1297
1299 return true;
1300
1302 return true;
1303
1304 return false;
1305 }
1306
1307
1308
1312 }
1313
1314
1315
1317
1321 }
1323
1324
1326
1328
1329
1330
1331
1335 }
1336
1337
1338
1339
1340
1341
1342
1343
1345
1346
1347
1348
1350
1353
1354
1355
1356
1358
1359private:
1361 bool IsConstantInitialization) const;
1362
1363public:
1364
1365
1366
1368
1369
1370
1371
1372
1373
1374
1376
1377
1378
1379
1380
1381
1382
1384
1385
1386
1387
1389
1390
1391
1392
1395
1398 }
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1412 }
1413
1414
1417 }
1418
1419
1421 return isa(this) ? false :
1423 }
1424
1425
1426
1427
1428
1429
1432 assert(!isa(this) && "Cannot demote ParmVarDecls!");
1434 }
1435
1436
1437
1440 }
1442 assert(!isa(this));
1444 }
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1458 }
1460 assert(!isa(this));
1462 }
1463
1464
1465
1468 }
1470 assert(!isa(this));
1472 }
1473
1474
1475
1478 }
1479
1482 }
1483
1484
1485
1486
1487
1488
1489
1490
1493
1494
1497 }
1499 return isa(this) ? false
1501 }
1503 assert(!isa(this));
1506 }
1508 assert(!isa(this));
1510 }
1511
1512
1515 }
1517 assert(!isa(this));
1519 }
1520
1521
1524 }
1526 assert(!isa(this));
1528 }
1529
1530
1531
1533
1534
1535
1537 return isa(this)
1540 }
1542 assert(!isa(this));
1544 }
1545
1546
1547
1548
1550
1551
1552
1554
1557 }
1558
1561 }
1562
1564 assert(!isa(this));
1566 }
1567
1568
1570
1571
1572
1574
1575
1576
1577
1579
1580
1581
1582
1584
1585
1586
1587
1590
1591
1592
1593
1595
1596
1597
1598
1600
1601
1602
1605
1606
1607
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1623
1625
1626
1627
1628
1630
1631
1632
1634
1635
1636
1638
1639
1640
1641
1642
1643
1644
1646
1647
1648
1649
1650
1652
1653
1655 static bool classofKind(Kind K) { return K >= firstVar && K <= lastVar; }
1656};
1657
1658
1659
1660
1662
1664
1665
1667
1668
1670
1671
1673
1674
1676
1677
1679
1680
1682};
1683
1685 void anchor() override;
1686
1687public:
1688
1694
1696
1700 : VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type,
1701 nullptr, SC_None) {
1702 NonParmVarDeclBits.ImplicitParamKind = llvm::to_underlying(ParamKind);
1704 }
1705
1709 nullptr, SC_None) {
1710 NonParmVarDeclBits.ImplicitParamKind = llvm::to_underlying(ParamKind);
1712 }
1713
1714
1717 }
1718
1719
1722};
1723
1724
1726public:
1729
1730protected:
1734 : VarDecl(DK, C, DC, StartLoc, IdLoc, Id, T, TInfo, S) {
1735 assert(ParmVarDeclBits.HasInheritedDefaultArg == false);
1740 }
1741
1742public:
1747 Expr *DefArg);
1748
1750
1752
1755 setParameterIndex(parameterIndex);
1756 }
1757
1758 void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex) {
1760
1762 assert(ParmVarDeclBits.ScopeDepthOrObjCQuals == scopeDepth
1763 && "truncation!");
1764
1765 setParameterIndex(parameterIndex);
1766 }
1767
1770 }
1771
1772
1774
1778 }
1779
1782 }
1783
1784
1786 return getParameterIndex();
1787 }
1788
1792 }
1796 }
1797
1798
1799
1800
1801
1802
1803
1804
1805
1808 }
1811 }
1812
1814 return ExplicitObjectParameterIntroducerLoc.isValid();
1815 }
1816
1818 ExplicitObjectParameterIntroducerLoc = Loc;
1819 }
1820
1822 return ExplicitObjectParameterIntroducerLoc;
1823 }
1824
1828 }
1829
1831
1832
1833
1839 }
1840
1841
1842
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1856 }
1857
1860 }
1861
1862
1863
1864
1865
1868 }
1869
1872 }
1873
1876 }
1877
1879
1880
1881
1882
1883
1885
1886
1889
1890private:
1892
1894 SourceLocation ExplicitObjectParameterIntroducerLoc;
1895
1896 void setParameterIndex(unsigned parameterIndex) {
1897 if (parameterIndex >= ParameterIndexSentinel) {
1898 setParameterIndexLarge(parameterIndex);
1899 return;
1900 }
1901
1903 assert(ParmVarDeclBits.ParameterIndex == parameterIndex && "truncation!");
1904 }
1905 unsigned getParameterIndex() const {
1907 return d == ParameterIndexSentinel ? getParameterIndexLarge() : d;
1908 }
1909
1910 void setParameterIndexLarge(unsigned parameterIndex);
1911 unsigned getParameterIndexLarge() const;
1912};
1913
1921};
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1936
1937
1938public:
1939
1941
1943
1945
1946
1948
1949
1950
1952
1953
1955
1957
1959
1960
1962 : llvm::TrailingObjects<DefaultedOrDeletedFunctionInfo, DeclAccessPair,
1963 StringLiteral *> {
1964 friend TrailingObjects;
1965 unsigned NumLookups;
1966 bool HasDeletedMessage;
1967
1968 size_t numTrailingObjects(OverloadToken) const {
1969 return NumLookups;
1970 }
1971
1972 public:
1976
1977
1978
1980 return {getTrailingObjects(), NumLookups};
1981 }
1982
1984 return HasDeletedMessage ? *getTrailingObjects<StringLiteral *>()
1985 : nullptr;
1986 }
1987
1989 };
1990
1991private:
1992
1993
1994
1996
1997
1998
1999 union {
2000
2002
2004 };
2005
2007
2008
2009
2010
2011
2012
2013
2014
2016
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2036 TemplateOrSpecialization;
2037
2038
2039
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063 void setFunctionTemplateSpecialization(
2069
2070
2071
2074
2076
2077
2078
2079
2080 bool isDeletedBit() const { return FunctionDeclBits.IsDeleted; }
2081
2082
2083 bool hasODRHash() const { return FunctionDeclBits.HasODRHash; }
2084
2085
2086 void setHasODRHash(bool B = true) { FunctionDeclBits.HasODRHash = B; }
2087
2088protected:
2089 FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
2090 const DeclarationNameInfo &NameInfo, QualType T,
2093 Expr *TrailingRequiresClause = nullptr);
2094
2096
2099 }
2100
2103 }
2104
2107 }
2108
2109public:
2112
2115
2122
2129 Expr *TrailingRequiresClause = nullptr) {
2134 TrailingRequiresClause);
2135 }
2136
2142 Expr *TrailingRequiresClause);
2143
2145
2148 }
2149
2152
2154
2156
2157
2160 if (FPT && FPT->isVariadic())
2163 }
2164
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2187
2191 }
2192
2193
2194
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2209 bool CheckForPendingFriendDefinition = false) const;
2210
2214 }
2215
2216
2221 return nullptr;
2222 }
2225 }
2226
2227
2228
2229
2230
2231
2232
2234
2238 }
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2253 }
2254
2255
2256
2257
2259
2260
2264 }
2265
2270 }
2271
2274
2275
2277
2278
2281 }
2282
2283
2285
2286
2287
2290
2291
2294 }
2295
2296
2299 }
2300
2301
2302
2303
2304
2307
2310
2311
2312
2315
2316
2319 }
2320
2321
2324 }
2325
2328 }
2329
2332 "Can't set default loc is function isn't explicitly defaulted");
2333 DefaultKWLoc = NewLoc;
2334 }
2335
2336
2337
2339 auto *DeclAsWritten = this;
2341 DeclAsWritten = Pattern;
2342 return !(DeclAsWritten->isDeleted() ||
2343 DeclAsWritten->getCanonicalDecl()->isDefaulted());
2344 }
2345
2348 }
2351 }
2352
2353
2354
2355
2358 }
2359
2360
2361
2362
2365 }
2366
2367
2368
2369
2370
2373 }
2374
2375
2378 }
2379
2380
2383 }
2384
2385
2386
2389 }
2390
2391
2392
2395 }
2396
2397
2400 }
2402 FunctionDeclBits.ConstexprKind = static_cast<uint64_t>(CSK);
2403 }
2406 }
2409 }
2412 }
2413
2416 }
2417
2419 return FunctionDeclBits.BodyContainsImmediateEscalatingExpression;
2420 }
2421
2423
2424
2425
2426
2428
2429
2430
2431
2432
2433
2434
2437 }
2438
2439
2440
2443 }
2444
2445
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2470 }
2471
2474 }
2475
2477
2478
2479
2480 bool isMain() const;
2481
2482
2483
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2523 std::optional *AlignmentParam = nullptr,
2524 bool *IsNothrow = nullptr) const;
2525
2526
2528
2529
2531
2532
2534
2535
2536
2538
2539
2540
2542
2543
2544
2546
2547
2549
2550
2551
2553
2554
2558 }
2559
2560
2563
2564
2567 }
2568
2569
2570
2573 }
2574
2575
2576
2579 ->FunctionDeclBits.FriendConstraintRefersToEnclosingTemplate = V;
2580 }
2581
2582
2585 ->FunctionDeclBits.FriendConstraintRefersToEnclosingTemplate;
2586 }
2587
2588
2589
2591
2592
2593
2594
2596
2597
2598
2599
2601
2602
2604
2605
2606
2608
2609
2610
2612
2613
2614
2616
2617
2618
2620
2621
2622
2623
2624
2625
2626
2629 AC.push_back(TRC);
2630 }
2631
2632
2636 : nullptr;
2637 }
2638
2640
2644 }
2645
2646 unsigned getBuiltinID(bool ConsiderWrapperFunctions = false) const;
2647
2648
2651 }
2654 }
2655
2656
2659
2666
2667
2668
2669
2671
2673 assert(i < getNumParams() && "Illegal param #");
2674 return ParamInfo[i];
2675 }
2677 assert(i < getNumParams() && "Illegal param #");
2678 return ParamInfo[i];
2679 }
2682 }
2683
2684
2685
2686
2688
2689
2690
2691
2693
2695
2697
2700 }
2701
2704 }
2705
2706
2707
2708
2709
2710
2711
2713
2714
2715
2716
2717
2719
2722 }
2723
2724
2725
2726
2728
2729
2730
2731
2732
2734
2735
2736
2741 }
2742
2743
2749 }
2750
2751
2752
2754
2755
2759 }
2760
2761
2762
2765 }
2766
2767
2770 }
2771
2772
2773
2775
2776
2780 }
2781
2782
2783
2785
2786
2787
2789
2790
2792
2793
2794
2795
2797
2799
2801
2803
2805
2806
2807
2810 }
2811
2813
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2838
2839
2841
2842
2843
2844
2846
2847
2848
2851 setInstantiationOfMemberFunction(getASTContext(), FD, TSK);
2852 }
2853
2854
2855
2856
2858
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2874
2876
2877
2878
2880
2881
2882
2883
2885
2886
2887
2888
2890
2891
2892
2894
2895
2896
2897
2898
2899
2900
2901
2902
2905
2906
2907
2908
2909
2910
2912
2913
2914
2915
2916
2917
2919
2920
2921
2922
2923
2924
2925
2926
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2951 void *InsertPos,
2955 setFunctionTemplateSpecialization(getASTContext(), Template, TemplateArgs,
2956 InsertPos, TSK, TemplateArgsAsWritten,
2957 PointOfInstantiation);
2958 }
2959
2960
2961
2965
2968
2969
2970
2972
2973
2974
2977
2978
2979
2982
2983
2984
2985
2986
2987
2988
2990
2991
2992
2994
2995
2996
2997
2998
3000
3001
3002
3004
3005
3006
3008
3010
3011
3012
3013 if (const auto *FPT =
3015 return FPT->getFunctionEffects();
3016 return {};
3017 }
3018
3019
3022 return K >= firstFunction && K <= lastFunction;
3023 }
3026 }
3029 }
3030};
3031
3032
3034
3035
3036
3037
3038 enum InitStorageKind {
3039
3040
3041
3043
3044
3045
3047
3048
3049
3051
3052
3053
3054 ISK_CapturedVLAType,
3055 };
3056
3057 LLVM_PREFERRED_TYPE(bool)
3058 unsigned BitField : 1;
3059 LLVM_PREFERRED_TYPE(bool)
3060 unsigned Mutable : 1;
3061 LLVM_PREFERRED_TYPE(InitStorageKind)
3062 unsigned StorageKind : 2;
3063 mutable unsigned CachedFieldIndex : 28;
3064
3065
3066
3067 struct InitAndBitWidthStorage {
3069 Expr *BitWidth;
3070 };
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081 union {
3082
3084
3086
3088
3090 };
3091
3092protected:
3098 Mutable(Mutable), StorageKind((InitStorageKind)InitStyle),
3099 CachedFieldIndex(0), Init() {
3100 if (BW)
3102 }
3103
3104public:
3107
3113
3115
3116
3117
3120 if (Canonical->CachedFieldIndex == 0) {
3121 Canonical->setCachedFieldIndex();
3122 assert(Canonical->CachedFieldIndex != 0);
3123 }
3124 return Canonical->CachedFieldIndex - 1;
3125 }
3126
3127private:
3128
3129 void setCachedFieldIndex() const;
3130
3131public:
3132
3134
3135
3137
3138
3140
3141
3142
3143
3144
3146
3147
3148
3150 if (!BitField)
3151 return nullptr;
3153 }
3154
3155
3156
3157
3158
3160
3161
3162
3165 "bit width or captured type already set");
3166 assert(Width && "no bit width specified");
3170 else
3172 BitField = true;
3173 }
3174
3175
3176
3178 assert(isBitField() && "no bitfield width to remove");
3180
3182 Init = ExistingInit;
3183 }
3184 BitField = false;
3185 }
3186
3187
3188
3189
3191
3192
3193
3194
3196
3197
3198
3200
3201
3203 return (StorageKind == ISK_CapturedVLAType ? ICIS_NoInit
3205 }
3206
3207
3210 }
3211
3212
3213
3216 }
3217
3218
3219
3220
3222
3223
3225
3226
3227
3229
3230private:
3231 void setLazyInClassInitializer(LazyDeclStmtPtr NewInit);
3232
3233public:
3234
3237 StorageKind = ISK_NoInit;
3238 if (BitField) {
3239
3241 BitWidth = ExistingBitWidth;
3242 }
3243 }
3244
3245
3246
3248 return StorageKind == ISK_CapturedVLAType;
3249 }
3250
3251
3254 }
3255
3256
3258
3259
3260
3261
3262
3263
3266 }
3267
3270 }
3271
3273
3274
3277
3278
3280 static bool classofKind(Kind K) { return K >= firstField && K <= lastField; }
3281
3283};
3284
3285
3286
3287
3288
3290 public Mergeable,
3292 Stmt *Init;
3293 bool IsUnsigned;
3294
3295protected:
3298 const llvm::APSInt &V);
3299
3300public:
3302
3306 const llvm::APSInt &V);
3308
3312 return llvm::APSInt(getValue(), IsUnsigned);
3313 }
3314
3318 IsUnsigned = V.isUnsigned();
3319 }
3320
3322
3323
3326
3327
3330};
3331
3332
3333
3335 public Mergeable {
3337 unsigned ChainingSize;
3338
3342
3343 void anchor() override;
3344
3345public:
3347
3352
3354
3356
3359 }
3362
3364
3366 assert(chain().size() >= 2);
3367 return cast(chain().back());
3368 }
3369
3371 assert(chain().size() >= 2);
3372 return dyn_cast(chain().front());
3373 }
3374
3377
3378
3381};
3382
3383
3387
3388
3389
3390
3391
3392 mutable const Type *TypeForDecl = nullptr;
3393
3394
3396
3397 void anchor() override;
3398
3399protected:
3402 : NamedDecl(DK, DC, L, Id), LocStart(StartL) {}
3403
3404public:
3405
3406
3407
3408
3411
3417 else
3419 }
3420
3421
3423 static bool classofKind(Kind K) { return K >= firstType && K <= lastType; }
3424};
3425
3426
3428 struct alignas(8) ModedTInfo {
3431 };
3432
3433
3434
3435 mutable llvm::PointerIntPair<
3436 llvm::PointerUnion<TypeSourceInfo *, ModedTInfo *>, 2>
3437 MaybeModedTInfo;
3438
3439 void anchor() override;
3440
3441protected:
3446 MaybeModedTInfo(TInfo, 0) {}
3447
3449
3452 }
3453
3456 }
3457
3460 }
3461
3462public:
3465
3472
3474 return isa<ModedTInfo *>(MaybeModedTInfo.getPointer());
3475 }
3476
3478 return isModed() ? cast<ModedTInfo *>(MaybeModedTInfo.getPointer())->first
3479 : cast<TypeSourceInfo *>(MaybeModedTInfo.getPointer());
3480 }
3481
3483 return isModed() ? cast<ModedTInfo *>(MaybeModedTInfo.getPointer())->second
3484 : cast<TypeSourceInfo *>(MaybeModedTInfo.getPointer())
3485 ->getType();
3486 }
3487
3489 MaybeModedTInfo.setPointer(newType);
3490 }
3491
3493 MaybeModedTInfo.setPointer(new (getASTContext(), 8)
3494 ModedTInfo({unmodedTSI, modedTy}));
3495 }
3496
3497
3500
3501
3502
3503
3504
3505
3507
3508
3509
3511 if (MaybeModedTInfo.getInt())
3512 return MaybeModedTInfo.getInt() & 0x2;
3513 return isTransparentTagSlow();
3514 }
3515
3516
3519 return K >= firstTypedefName && K <= lastTypedefName;
3520 }
3521
3522private:
3523 bool isTransparentTagSlow() const;
3524};
3525
3526
3527
3533
3534public:
3539
3541
3542
3545};
3546
3547
3548
3550
3552
3557 Template(nullptr) {}
3558
3559public:
3564
3566
3569
3570
3573};
3574
3575
3579
3580
3581public:
3582
3584
3585private:
3587
3588
3589
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600 llvm::PointerUnion<TypedefNameDecl *, ExtInfo *> TypedefNameDeclOrQualifier;
3601
3602 bool hasExtInfo() const { return isa<ExtInfo *>(TypedefNameDeclOrQualifier); }
3603 ExtInfo *getExtInfo() { return cast<ExtInfo *>(TypedefNameDeclOrQualifier); }
3604 const ExtInfo *getExtInfo() const {
3605 return cast<ExtInfo *>(TypedefNameDeclOrQualifier);
3606 }
3607
3608protected:
3610 SourceLocation L, IdentifierInfo *Id, TagDecl *PrevDecl,
3611 SourceLocation StartL);
3612
3614
3617 }
3618
3621 }
3622
3625 }
3626
3627
3628
3629
3631
3632
3634
3635
3636
3637
3638
3641 }
3642
3643public:
3646
3649
3656
3659
3660
3661
3663
3664
3665
3668
3672 }
3673
3674
3675
3678 }
3679
3680
3682
3683
3686 }
3687
3688
3689
3691 return TagDeclBits.IsCompleteDefinitionRequired;
3692 }
3693
3694
3695
3697 TagDeclBits.IsCompleteDefinitionRequired = V;
3698 }
3699
3700
3702
3703
3704
3706 return TagDeclBits.IsEmbeddedInDeclarator;
3707 }
3708
3709
3710
3712 TagDeclBits.IsEmbeddedInDeclarator = isInDeclarator;
3713 }
3714
3715
3717
3718
3721 }
3722
3723
3724
3725
3726
3728
3729
3730
3731
3733
3734
3735
3736
3737
3738
3740 return TagDeclBits.IsThisDeclarationADemotedDefinition;
3741 }
3742
3743
3744
3747 "Should demote definitions only, not forward declarations");
3749 TagDeclBits.IsThisDeclarationADemotedDefinition = true;
3750 }
3751
3752
3753
3754
3755
3756
3758
3759
3760
3761
3762
3763
3764
3765
3766
3768
3771 }
3772
3775 }
3776
3778 TagDeclBits.TagDeclKind = llvm::to_underlying(TK);
3779 }
3780
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3804 }
3805
3807 return hasExtInfo() ? nullptr
3808 : cast<TypedefNameDecl *>(TypedefNameDeclOrQualifier);
3809 }
3810
3812
3813
3814
3817 : nullptr;
3818 }
3819
3820
3821
3822
3824 return hasExtInfo() ? getExtInfo()->QualifierLoc
3826 }
3827
3829
3832 }
3833
3837 }
3838
3841
3844
3845
3847 static bool classofKind(Kind K) { return K >= firstTag && K <= lastTag; }
3848
3851 }
3852
3855 }
3856};
3857
3858
3859
3860
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879 llvm::PointerUnion<const Type *, TypeSourceInfo *> IntegerType;
3880
3881
3882
3883
3884
3886
3887
3888
3889
3891
3892
3893
3894
3896
3899 bool Scoped, bool ScopedUsingClassTag, bool Fixed);
3900
3901 void anchor() override;
3902
3905
3906
3907
3908 void setNumPositiveBits(unsigned Num) {
3910 assert(EnumDeclBits.NumPositiveBits == Num && "can't store this bitcount");
3911 }
3912
3913
3914
3915 void setNumNegativeBits(unsigned Num) { EnumDeclBits.NumNegativeBits = Num; }
3916
3917public:
3918
3919
3921
3922
3923
3924
3925
3927 EnumDeclBits.IsScopedUsingClassTag = ScopedUCT;
3928 }
3929
3930
3931
3933
3934private:
3935
3936 bool hasODRHash() const { return EnumDeclBits.HasODRHash; }
3937 void setHasODRHash(bool Hash = true) { EnumDeclBits.HasODRHash = Hash; }
3938
3939public:
3941
3944 }
3947 }
3948
3950 return cast_or_null(
3952 }
3955 }
3956
3959 }
3962 }
3963
3966 }
3967
3971 bool IsScoped, bool IsScopedUsingClassTag,
3972 bool IsFixed);
3974
3975
3976
3978
3979
3980
3981
3982
3983
3986 unsigned NumPositiveBits,
3987 unsigned NumNegativeBits);
3988
3989
3993
3996 }
3997
4000 if ()
4001 E = this;
4003 }
4004
4007 if ()
4008 E = this;
4010 }
4011
4012
4014
4015
4017
4018
4019
4020
4022 if (!IntegerType)
4024 if (const Type *T = dyn_cast<const Type *>(IntegerType))
4026 return cast<TypeSourceInfo *>(IntegerType)->getType().getUnqualifiedType();
4027 }
4028
4029
4031
4032
4034
4035
4036
4039 }
4040
4041
4042
4044
4045
4046
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4059
4060
4061
4062
4064
4065
4067
4068
4071 }
4072
4073
4074
4076
4078
4079
4081
4082
4084 }
4085
4086
4087
4089
4090
4091
4093
4094
4095
4097
4098
4099
4101
4102
4103
4104
4106
4107
4108
4109
4111
4112
4113
4116
4117
4118
4119
4121 return SpecializationInfo;
4122 }
4123
4124
4125
4128 setInstantiationOfMemberEnum(getASTContext(), ED, TSK);
4129 }
4130
4133};
4134
4135
4136
4137
4138
4140
4142
4143
4144
4145
4146
4147
4148
4149
4151
4152
4153
4154
4156};
4157
4158
4159
4160
4161
4163
4164
4165public:
4168
4169protected:
4173
4174public:
4179
4181 return cast_or_null(
4183 }
4186 }
4187
4190 }
4193 }
4194
4197 }
4198
4201 }
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4216 }
4217
4220 }
4221
4224
4226
4229 }
4230
4232 return RecordDeclBits.LoadedFieldsFromExternalStorage;
4233 }
4234
4236 RecordDeclBits.LoadedFieldsFromExternalStorage = val;
4237 }
4238
4239
4241 return RecordDeclBits.NonTrivialToPrimitiveDefaultInitialize;
4242 }
4243
4245 RecordDeclBits.NonTrivialToPrimitiveDefaultInitialize = V;
4246 }
4247
4250 }
4251
4254 }
4255
4258 }
4259
4262 }
4263
4265 return RecordDeclBits.HasNonTrivialToPrimitiveDefaultInitializeCUnion;
4266 }
4267
4269 RecordDeclBits.HasNonTrivialToPrimitiveDefaultInitializeCUnion = V;
4270 }
4271
4273 return RecordDeclBits.HasNonTrivialToPrimitiveDestructCUnion;
4274 }
4275
4277 RecordDeclBits.HasNonTrivialToPrimitiveDestructCUnion = V;
4278 }
4279
4281 return RecordDeclBits.HasNonTrivialToPrimitiveCopyCUnion;
4282 }
4283
4286 }
4287
4289 return RecordDeclBits.HasUninitializedExplicitInitFields;
4290 }
4291
4294 }
4295
4296
4297
4298
4301 }
4302
4306 }
4307
4310 }
4311
4314 }
4315
4318 }
4319
4321
4323
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4340
4341
4342
4344
4345
4346
4348
4349
4350
4352
4353
4354
4355
4356
4357
4358
4359
4360
4363 }
4364
4365
4366
4367
4369
4370
4371
4372
4374 using field_range = llvm::iterator_range<specific_decl_iterator>;
4375
4378
4381 }
4382
4383
4386 }
4387
4388
4390
4393 return K >= firstRecord && K <= lastRecord;
4394 }
4395
4396
4397
4398
4400
4401
4402
4403
4405
4406
4407
4409
4410
4412
4413private:
4414
4415 void LoadFieldsFromExternalStorage() const;
4416
4417
4418 bool hasODRHash() const { return RecordDeclBits.ODRHash; }
4419 void setODRHash(unsigned Hash) { RecordDeclBits.ODRHash = Hash; }
4420};
4421
4425
4428 : Decl(FileScopeAsm, DC, StartL), AsmString(asmstring), RParenLoc(EndL) {}
4429
4430 virtual void anchor();
4431
4432public:
4436
4438
4444 }
4445
4449
4452};
4453
4454
4455
4456
4457
4458
4462
4463 Stmt *Statement = nullptr;
4464 bool IsSemiMissing = false;
4465
4467 : Decl(TopLevelStmt, DC, L), DeclContext(TopLevelStmt), Statement(S) {}
4468
4469 virtual void anchor();
4470
4471public:
4474
4480 void setSemiMissing(bool Missing = true) { IsSemiMissing = Missing; }
4481
4484
4487 }
4490 }
4491};
4492
4493
4494
4495
4497
4498
4499public:
4500
4501
4503 enum {
4504 flag_isByRef = 0x1,
4505 flag_isNested = 0x2
4506 };
4507
4508
4509 llvm::PointerIntPair<VarDecl*, 2> VariableAndFlags;
4510
4511
4512
4513
4514 Expr *CopyExpr;
4515
4516 public:
4518 : VariableAndFlags(variable,
4519 (byRef ? flag_isByRef : 0) | (nested ? flag_isNested : 0)),
4520 CopyExpr(copy) {}
4521
4522
4524
4525
4526
4527 bool isByRef() const { return VariableAndFlags.getInt() & flag_isByRef; }
4528
4531 }
4532
4535 }
4536
4537
4538
4539 bool isNested() const { return VariableAndFlags.getInt() & flag_isNested; }
4540
4541 bool hasCopyExpr() const { return CopyExpr != nullptr; }
4544 };
4545
4546private:
4547
4548
4549
4551 unsigned NumParams = 0;
4552
4553 Stmt *Body = nullptr;
4555
4556 const Capture *Captures = nullptr;
4557 unsigned NumCaptures = 0;
4558
4559 unsigned ManglingNumber = 0;
4560 Decl *ManglingContextDecl = nullptr;
4561
4562protected:
4564
4565public:
4568
4570
4573
4577
4580
4581
4584 }
4587 }
4588
4589
4592
4599
4601
4603 assert(i < getNumParams() && "Illegal param #");
4604 return ParamInfo[i];
4605 }
4607 assert(i < getNumParams() && "Illegal param #");
4608 return ParamInfo[i];
4609 }
4610
4612
4613
4614
4616
4617
4618
4620
4622
4624
4627
4630
4633 }
4634
4637 }
4638
4641 }
4642
4645 }
4646
4649
4652 }
4655 }
4656
4658
4660 bool CapturesCXXThis);
4661
4663
4665
4667 ManglingNumber = Number;
4668 ManglingContextDecl = Ctx;
4669 }
4670
4672
4675 if (const auto *FPT = TSI->getType()->getAs<FunctionProtoType>())
4676 return FPT->getFunctionEffects();
4677 return {};
4678 }
4679
4680
4685 }
4688 }
4689};
4690
4691
4693 : public Decl,
4695 private llvm::TrailingObjects<CapturedDecl, ImplicitParamDecl *> {
4696protected:
4698 return NumParams;
4699 }
4700
4701private:
4702
4703 unsigned NumParams;
4704
4705
4706 unsigned ContextParam;
4707
4708
4709 llvm::PointerIntPair<Stmt *, 1, bool> BodyAndNothrow;
4710
4712
4714 return getTrailingObjects<ImplicitParamDecl *>();
4715 }
4716
4717 ImplicitParamDecl **getParams() {
4718 return getTrailingObjects<ImplicitParamDecl *>();
4719 }
4720
4721public:
4725
4727 unsigned NumParams);
4729 unsigned NumParams);
4730
4733
4735 void setNothrow(bool Nothrow = true);
4736
4738
4740 assert(i < NumParams);
4741 return getParams()[i];
4742 }
4744 assert(i < NumParams);
4745 getParams()[i] = P;
4746 }
4747
4748
4751 }
4754 }
4755
4756
4758 assert(ContextParam < NumParams);
4759 return getParam(ContextParam);
4760 }
4762 assert(i < NumParams);
4763 ContextParam = i;
4765 }
4767
4769 using param_range = llvm::iterator_range<param_iterator>;
4770
4771
4773
4775
4776
4781 }
4784 }
4785};
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4808 llvm::TrailingObjects<ImportDecl, SourceLocation> {
4812 friend TrailingObjects;
4813
4814
4815 Module *ImportedModule = nullptr;
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825 llvm::PointerIntPair<ImportDecl *, 1, bool> NextLocalImportAndComplete;
4826
4829
4832
4834
4835 bool isImportComplete() const { return NextLocalImportAndComplete.getInt(); }
4836
4837 void setImportComplete(bool C) { NextLocalImportAndComplete.setInt(C); }
4838
4839
4840
4841 ImportDecl *getNextLocalImport() const {
4842 return NextLocalImportAndComplete.getPointer();
4843 }
4844
4845 void setNextLocalImport(ImportDecl *Import) {
4846 NextLocalImportAndComplete.setPointer(Import);
4847 }
4848
4849public:
4850
4852 SourceLocation StartLoc, Module *Imported,
4853 ArrayRef IdentifierLocs);
4854
4855
4856
4858 SourceLocation StartLoc, Module *Imported,
4859 SourceLocation EndLoc);
4860
4861
4863 unsigned NumLocations);
4864
4865
4867
4868
4869
4870
4871
4872
4874
4876
4879};
4880
4881
4882
4883
4884
4885
4886
4888 virtual void anchor();
4889
4890private:
4892
4893
4895
4899
4900public:
4904
4908
4910
4913 return RBraceLoc;
4914
4915
4917 }
4918
4921 }
4922
4927 }
4930 }
4931};
4932
4933
4936
4937 virtual void anchor();
4938
4939public:
4943
4946};
4947
4948
4950
4952
4954
4956
4957 bool IsCBuffer;
4958
4962
4963public:
4969
4972 }
4978
4979
4984 }
4987 }
4988
4991};
4992
4993
4994
4997 PD.AddTaggedVal(reinterpret_cast<uint64_t>(ND),
4999 return PD;
5000}
5001
5002template<typename decl_type>
5004
5005
5006 assert(RedeclLink.isFirst() &&
5007 "setPreviousDecl on a decl already in a redeclaration chain");
5008
5009 if (PrevDecl) {
5010
5011
5012
5013 First = PrevDecl->getFirstDecl();
5014 assert(First->RedeclLink.isFirst() && "Expected first");
5015 decl_type *MostRecent = First->getNextRedeclaration();
5016 RedeclLink = PreviousDeclLink(cast<decl_type>(MostRecent));
5017
5018
5019
5020 static_cast<decl_type*>(this)->IdentifierNamespace |=
5021 MostRecent->getIdentifierNamespace() &
5023 } else {
5024
5025 First = static_cast<decl_type*>(this);
5026 }
5027
5028
5029 First->RedeclLink.setLatest(static_cast<decl_type*>(this));
5030
5031 assert(!isa(static_cast<decl_type*>(this)) ||
5032 cast(static_cast<decl_type*>(this))->isLinkageValid());
5033}
5034
5035
5036
5037
5038
5039
5040
5043}
5044
5045
5046
5047
5048
5051}
5052
5053
5054
5055
5057 return "$ompvariant";
5058}
5059
5060
5061
5063 bool IncludeLocallyStreaming);
5064
5065}
5066
5067#endif
Provides definitions for the various language-specific address spaces.
Defines the Diagnostic-related interfaces.
enum clang::sema::@1725::IndirectLocalPathEntry::EntryKind Kind
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 an enumeration for C++ overloaded operators.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Defines the clang::Visibility enumeration and various utility functions.
void setValue(const ASTContext &C, const llvm::APInt &Val)
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
A class which contains all the information about a particular captured value.
bool isNested() const
Whether this is a nested capture, i.e.
void setCopyExpr(Expr *e)
Expr * getCopyExpr() const
bool isByRef() const
Whether this is a "by ref" capture, i.e.
Capture(VarDecl *variable, bool byRef, bool nested, Expr *copy)
bool isNonEscapingByref() const
VarDecl * getVariable() const
The variable being captured.
bool isEscapingByref() const
Represents a block literal declaration, which is like an unnamed FunctionDecl.
ParmVarDecl * getParamDecl(unsigned i)
static bool classofKind(Kind K)
CompoundStmt * getCompoundBody() const
static bool classof(const Decl *D)
unsigned getNumParams() const
unsigned getNumCaptures() const
Returns the number of captured variables.
void setParams(ArrayRef< ParmVarDecl * > NewParamInfo)
capture_const_iterator capture_begin() const
bool canAvoidCopyToHeap() const
void setDoesNotEscape(bool B=true)
param_iterator param_end()
capture_const_iterator capture_end() const
ArrayRef< Capture >::const_iterator capture_const_iterator
unsigned getBlockManglingNumber() const
param_const_iterator param_end() const
MutableArrayRef< ParmVarDecl * >::iterator param_iterator
size_t param_size() const
void setCapturesCXXThis(bool B=true)
void setSignatureAsWritten(TypeSourceInfo *Sig)
void setBlockMangling(unsigned Number, Decl *Ctx)
MutableArrayRef< ParmVarDecl * > parameters()
void setCanAvoidCopyToHeap(bool B=true)
param_iterator param_begin()
void setIsConversionFromLambda(bool val=true)
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
static DeclContext * castToDeclContext(const BlockDecl *D)
void setBlockMissingReturnType(bool val=true)
FunctionEffectsRef getFunctionEffects() const
ArrayRef< Capture > captures() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static BlockDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setIsVariadic(bool value)
bool blockMissingReturnType() const
SourceLocation getCaretLocation() const
bool capturesCXXThis() const
bool capturesVariable(const VarDecl *var) const
bool doesNotEscape() const
bool hasCaptures() const
True if this block (or its nested blocks) captures anything of local storage from its enclosing scope...
Decl * getBlockManglingContextDecl() const
ArrayRef< ParmVarDecl * >::const_iterator param_const_iterator
static BlockDecl * castFromDeclContext(const DeclContext *DC)
const ParmVarDecl * getParamDecl(unsigned i) const
void setBody(CompoundStmt *B)
param_const_iterator param_begin() const
bool isConversionFromLambda() const
ArrayRef< ParmVarDecl * > parameters() const
void setCaptures(ASTContext &Context, ArrayRef< Capture > Captures, bool CapturesCXXThis)
TypeSourceInfo * getSignatureAsWritten() const
Represents the body of a CapturedStmt, and serves as its DeclContext.
unsigned getNumParams() const
static bool classof(const Decl *D)
ImplicitParamDecl *const * param_iterator
ImplicitParamDecl * getContextParam() const
Retrieve the parameter containing captured variables.
ArrayRef< ImplicitParamDecl * > parameters() const
static DeclContext * castToDeclContext(const CapturedDecl *D)
size_t numTrailingObjects(OverloadToken< ImplicitParamDecl >)
static CapturedDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumParams)
unsigned getContextParamPosition() const
static CapturedDecl * castFromDeclContext(const DeclContext *DC)
static bool classofKind(Kind K)
void setContextParam(unsigned i, ImplicitParamDecl *P)
void setNothrow(bool Nothrow=true)
void setParam(unsigned i, ImplicitParamDecl *P)
param_iterator param_end() const
Retrieve an iterator one past the last parameter decl.
MutableArrayRef< ImplicitParamDecl * > parameters()
param_iterator param_begin() const
Retrieve an iterator pointing to the first parameter decl.
llvm::iterator_range< param_iterator > param_range
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
ImplicitParamDecl * getParam(unsigned i) const
CharUnits - This is an opaque type for sizes expressed in character units.
CompoundStmt - This represents a group of statements like { stmt stmt }.
decl_iterator - Iterates through the declarations stored within this context.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
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.
FunctionDeclBitfields FunctionDeclBits
TagDeclBitfields TagDeclBits
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
EnumDeclBitfields EnumDeclBits
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
BlockDeclBitfields BlockDeclBits
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
RecordDeclBitfields RecordDeclBits
NamespaceDeclBitfields NamespaceDeclBits
bool isFunctionOrMethod() const
Decl::Kind getDeclKind() const
DeclContext * getNonTransparentContext()
decl_iterator decls_begin() const
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
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
ASTContext & getASTContext() const LLVM_READONLY
bool hasCachedLinkage() const
Kind
Lists the kind of concrete classes of Decl.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
bool hasDefiningAttr() const
Return true if this declaration has an attribute which acts as definition of the entity,...
SourceLocation getLocation() const
@ IDNS_Ordinary
Ordinary names.
@ IDNS_Type
Types, declared with 'struct foo', typedefs, etc.
@ IDNS_Tag
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
void setImplicit(bool I=true)
DeclContext * getDeclContext()
void setModulePrivate()
Specify that this declaration was marked as being private to the module in which it was defined.
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.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
DeclarationNameLoc - Additional source/type location info for a declaration name.
The name of a declaration.
Represents a ValueDecl that came out of a declarator.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
SourceLocation getTypeSpecEndLoc() const
SourceLocation getInnerLocStart() const
Return start of source range ignoring outer template declarations.
TemplateParameterList * getTemplateParameterList(unsigned index) const
static bool classofKind(Kind K)
void setInnerLocStart(SourceLocation L)
SourceLocation getOuterLocStart() const
Return start of source range taking into account any outer template declarations.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getTypeSpecStartLoc() const
SourceLocation getBeginLoc() const LLVM_READONLY
unsigned getNumTemplateParameterLists() const
void setTypeSourceInfo(TypeSourceInfo *TI)
DeclaratorDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T, TypeSourceInfo *TInfo, SourceLocation StartL)
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
void setTrailingRequiresClause(Expr *TrailingRequiresClause)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
Expr * getTrailingRequiresClause()
Get the constraint-expression introduced by the trailing requires-clause in the function/member decla...
static bool classof(const Decl *D)
const Expr * getTrailingRequiresClause() const
TypeSourceInfo * getTypeSourceInfo() const
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
Provides information about a dependent function-template specialization declaration.
@ ak_nameddecl
NamedDecl *.
Represents an empty-declaration.
static EmptyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
static bool classofKind(Kind K)
An instance of this object exists for each enum constant that is defined.
static EnumConstantDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classofKind(Kind K)
const EnumConstantDecl * getCanonicalDecl() const
void setInitExpr(Expr *E)
void setInitVal(const ASTContext &C, const llvm::APSInt &V)
llvm::APSInt getInitVal() const
EnumConstantDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this enumerator.
static bool classof(const Decl *D)
const Expr * getInitExpr() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const EnumDecl * getMostRecentDecl() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization,...
enumerator_range enumerators() const
void setFixed(bool Fixed=true)
True if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying type.
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.
void setIntegerType(QualType T)
Set the underlying integer type.
void setIntegerTypeSourceInfo(TypeSourceInfo *TInfo)
Set the underlying integer type source info.
enumerator_iterator enumerator_begin() const
bool isComplete() const
Returns true if this can be considered a complete type.
void setInstantiationOfMemberEnum(EnumDecl *ED, TemplateSpecializationKind TSK)
Specify that this enumeration is an instantiation of the member enumeration ED.
const EnumDecl * getCanonicalDecl() const
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For an enumeration member that was instantiated from a member enumeration of a templated class,...
TypeSourceInfo * getIntegerTypeSourceInfo() const
Return the type source info for the underlying integer type, if no type source info exists,...
static EnumDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isClosedFlag() const
Returns true if this enum is annotated with flag_enum and isn't annotated with enum_extensibility(ope...
EnumDecl * getMostRecentDecl()
void setScoped(bool Scoped=true)
True if this tag declaration is a scoped enumeration.
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
SourceRange getIntegerTypeRange() const LLVM_READONLY
Retrieve the source range that covers the underlying type if specified.
void setPromotionType(QualType T)
Set the promotion type.
EnumDecl * getPreviousDecl()
SourceRange getSourceRange() const override LLVM_READONLY
Overrides to provide correct range when there's an enum-base specifier with forward declarations.
static bool classofKind(Kind K)
llvm::iterator_range< specific_decl_iterator< EnumConstantDecl > > enumerator_range
static bool classof(const Decl *D)
EnumDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
EnumDecl * getDefinition() const
unsigned getNumPositiveBits() const
Returns the width in bits required to store all the non-negative enumerators of this enum.
const EnumDecl * getPreviousDecl() const
specific_decl_iterator< EnumConstantDecl > enumerator_iterator
TemplateSpecializationKind getTemplateSpecializationKind() const
If this enumeration is a member of a specialization of a templated class, determine what kind of temp...
void setScopedUsingClassTag(bool ScopedUCT=true)
If this tag declaration is a scoped enum, then this is true if the scoped enum was declared using the...
bool isClosed() const
Returns true if this enum is either annotated with enum_extensibility(closed) or isn't annotated with...
QualType getPromotionType() const
Return the integer type that enumerators should promote to.
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
bool isClosedNonFlag() const
Returns true if this enum is annotated with neither flag_enum nor enum_extensibility(open).
enumerator_iterator enumerator_end() const
void getValueRange(llvm::APInt &Max, llvm::APInt &Min) const
Calculates the [Min,Max) values the enum can store based on the NumPositiveBits and NumNegativeBits.
Represents a standard C++ module export declaration.
static bool classof(const Decl *D)
SourceLocation getRBraceLoc() const
SourceLocation getEndLoc() const LLVM_READONLY
SourceLocation getExportLoc() const
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setRBraceLoc(SourceLocation L)
static DeclContext * castToDeclContext(const ExportDecl *D)
static ExportDecl * castFromDeclContext(const DeclContext *DC)
static ExportDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
This represents one expression.
Declaration context for names declared as extern "C" in C++.
static DeclContext * castToDeclContext(const ExternCContextDecl *D)
static bool classof(const Decl *D)
static bool classofKind(Kind K)
static ExternCContextDecl * castFromDeclContext(const DeclContext *DC)
Represents a member of a struct/union/class.
bool isMutable() const
Determines whether this field is mutable (C++ only).
Expr * getInClassInitializer() const
Get the C++11 default member initializer for this member, or null if one has not been set.
bool isBitField() const
Determines whether this field is a bitfield.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
unsigned getBitWidthValue() const
Computes the bit width of this field, if this is a bit field.
bool isAnonymousStructOrUnion() const
Determines whether this field is a representative for an anonymous struct or union.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setBitWidth(Expr *Width)
Set the bit-field width for this member.
void removeBitWidth()
Remove the bit-field width from this member.
InClassInitStyle getInClassInitStyle() const
Get the kind of (C++11) default member initializer that this field has.
static FieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void removeInClassInitializer()
Remove the C++11 in-class initializer from this member.
void setInClassInitializer(Expr *NewInit)
Set the C++11 in-class initializer for this member.
unsigned getFieldIndex() const
Returns the index of this field within its record, as appropriate for passing to ASTRecordLayout::get...
const RecordDecl * getParent() const
Returns the parent of this field declaration, which is the struct in which this field is defined.
bool isZeroSize(const ASTContext &Ctx) const
Determine if this field is a subobject of zero size, that is, either a zero-length bit-field or a fie...
InitAndBitWidthStorage * InitAndBitWidth
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
static bool classofKind(Kind K)
bool hasCapturedVLAType() const
Determine whether this member captures the variable length array type.
bool isUnnamedBitField() const
Determines whether this is an unnamed bitfield.
bool isZeroLengthBitField() const
Is this a zero-length bit-field? Such bit-fields aren't really bit-fields at all and instead act as a...
Expr * getBitWidth() const
Returns the expression that represents the bit width, if this field is a bit field.
void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override
Pretty-print the unqualified name of this declaration.
const FieldDecl * getCanonicalDecl() const
const FieldDecl * findCountedByField() const
Find the FieldDecl specified in a FAM's "counted_by" attribute.
const VariableArrayType * getCapturedVLAType() const
Get the captured variable length array type.
bool isPotentiallyOverlapping() const
Determine if this field is of potentially-overlapping class type, that is, subobject with the [[no_un...
void setCapturedVLAType(const VariableArrayType *VLAType)
Set the captured variable length array type for this field.
bool hasNonNullInClassInitializer() const
Determine whether getInClassInitializer() would return a non-null pointer without deserializing the i...
const VariableArrayType * CapturedVLAType
static bool classof(const Decl *D)
void setRParenLoc(SourceLocation L)
SourceLocation getAsmLoc() const
void setAsmString(StringLiteral *Asm)
static bool classofKind(Kind K)
const StringLiteral * getAsmString() const
SourceLocation getRParenLoc() const
static bool classof(const Decl *D)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
StringLiteral * getAsmString()
static FileScopeAsmDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
Stashed information about a defaulted/deleted function body.
StringLiteral * getDeletedMessage() const
void setDeletedMessage(StringLiteral *Message)
ArrayRef< DeclAccessPair > getUnqualifiedLookups() const
Get the unqualified lookup results that should be used in this defaulted function definition.
Represents a function declaration or definition.
unsigned getMemoryFunctionKind() const
Identify a memory copying or setting function.
void setInstantiationIsPending(bool IC)
State that the instantiation of this function is pending.
bool isTargetClonesMultiVersion() const
True if this function is a multiversioned dispatch function as a part of the target-clones functional...
bool isMultiVersion() const
True if this function is considered a multiversioned function.
const ParmVarDecl * getParamDecl(unsigned i) const
ExceptionSpecificationType getExceptionSpecType() const
Gets the ExceptionSpecificationType as declared.
bool isTrivialForCall() const
bool hasTrivialBody() const
Returns whether the function has a trivial body that does not require any specific codegen.
ConstexprSpecKind getConstexprKind() const
unsigned getMinRequiredArguments() const
Returns the minimum number of arguments needed to call this function.
bool isFunctionTemplateSpecialization() const
Determine whether this function is a function template specialization.
void setPreviousDeclaration(FunctionDecl *PrevDecl)
void setDescribedFunctionTemplate(FunctionTemplateDecl *Template)
FunctionTemplateDecl * getDescribedFunctionTemplate() const
Retrieves the function template that is described by this function declaration.
void setIsPureVirtual(bool P=true)
const FunctionDecl * getDefinition() const
bool isThisDeclarationADefinition() const
Returns whether this specific declaration of the function is also a definition that does not contain ...
bool isImmediateFunction() const
void setDefaultedOrDeletedInfo(DefaultedOrDeletedFunctionInfo *Info)
void setFriendConstraintRefersToEnclosingTemplate(bool V=true)
SourceLocation getEllipsisLoc() const
Returns the location of the ellipsis of a variadic function.
static bool classofKind(Kind K)
void setHasSkippedBody(bool Skipped=true)
SourceRange getReturnTypeSourceRange() const
Attempt to compute an informative source range covering the function return type.
bool isDestroyingOperatorDelete() const
Determine whether this is a destroying operator delete.
static FunctionDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
unsigned getBuiltinID(bool ConsiderWrapperFunctions=false) const
Returns a value indicating whether this function corresponds to a builtin function.
void setUsesSEHTry(bool UST)
param_iterator param_end()
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
SourceLocation getPointOfInstantiation() const
Retrieve the (first) point of instantiation of a function template specialization or a member of a cl...
bool isMemberLikeConstrainedFriend() const
Determine whether a function is a friend function that cannot be redeclared outside of its class,...
bool hasCXXExplicitFunctionObjectParameter() const
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
void setIsMultiVersion(bool V=true)
Sets the multiversion state for this declaration and all of its redeclarations.
bool UsesFPIntrin() const
Determine whether the function was declared in source context that requires constrained FP intrinsics...
SourceLocation getDefaultLoc() const
void setInstantiationOfMemberFunction(FunctionDecl *FD, TemplateSpecializationKind TSK)
Specify that this record is an instantiation of the member function FD.
bool usesSEHTry() const
Indicates the function uses __try.
void setHasWrittenPrototype(bool P=true)
State that this function has a written prototype.
bool isNoReturn() const
Determines whether this function is known to be 'noreturn', through an attribute on its declaration o...
QualType getReturnType() const
ArrayRef< ParmVarDecl * > parameters() const
bool isCPUSpecificMultiVersion() const
True if this function is a multiversioned processor specific function as a part of the cpu_specific/c...
FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition=true) const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
bool isMSExternInline() const
The combination of the extern and inline keywords under MSVC forces the function to be required.
bool isExplicitlyDefaulted() const
Whether this function is explicitly defaulted.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool instantiationIsPending() const
Whether the instantiation of this function is pending.
unsigned getMinRequiredExplicitArguments() const
Returns the minimum number of non-object arguments needed to call this function.
const FunctionDecl * getCanonicalDecl() const
bool BodyContainsImmediateEscalatingExpressions() const
LanguageLinkage getLanguageLinkage() const
Compute the language linkage.
FunctionTemplateDecl * getPrimaryTemplate() const
Retrieve the primary template that this function template specialization either specializes or was in...
MutableArrayRef< ParmVarDecl * >::iterator param_iterator
FunctionDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
bool hasWrittenPrototype() const
Whether this function has a written prototype.
void setWillHaveBody(bool V=true)
void setDeclarationNameLoc(DeclarationNameLoc L)
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this function is an instantiation of a member function of a class template specialization,...
bool hasPrototype() const
Whether this function has a prototype, either because one was explicitly written or because it was "i...
FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
If this function is actually a function template specialization, retrieve information about this func...
void setUsesFPIntrin(bool I)
Set whether the function was declared in source context that requires constrained FP intrinsics.
void setDefaultLoc(SourceLocation NewLoc)
FunctionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
FunctionTypeLoc getFunctionTypeLoc() const
Find the source location information for how the type of this function was written.
MutableArrayRef< ParmVarDecl * > parameters()
param_iterator param_begin()
FunctionDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
const ParmVarDecl * getNonObjectParameter(unsigned I) const
bool isVariadic() const
Whether this function is variadic.
bool doesThisDeclarationHaveABody() const
Returns whether this specific declaration of the function has a body.
bool isConstexprSpecified() const
DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
bool isDeleted() const
Whether this function has been deleted.
void setBodyContainsImmediateEscalatingExpressions(bool Set)
const TemplateArgumentList * getTemplateSpecializationArgs() const
Retrieve the template arguments used to produce this function template specialization from the primar...
FunctionEffectsRef getFunctionEffects() const
static DeclContext * castToDeclContext(const FunctionDecl *D)
SourceRange getExceptionSpecSourceRange() const
Attempt to compute an informative source range covering the function exception specification,...
bool hasBody() const override
Returns true if this Decl represents a declaration for a body of code, such as a function or method d...
bool isMSVCRTEntryPoint() const
Determines whether this function is a MSVCRT user defined entry point.
unsigned getODRHash()
Returns ODRHash of the function.
TemplateSpecializationKind getTemplateSpecializationKindForInstantiation() const
Determine the kind of template specialization this function represents for the purpose of template in...
ArrayRef< ParmVarDecl * >::const_iterator param_const_iterator
bool isTemplateInstantiation() const
Determines if the given function was instantiated from a function template.
void setInlineSpecified(bool I)
Set whether the "inline" keyword was specified for this function.
unsigned getNumNonObjectParams() const
TemplatedKind
The kind of templated function a FunctionDecl can be.
@ TK_MemberSpecialization
@ TK_DependentNonTemplate
@ TK_FunctionTemplateSpecialization
@ TK_DependentFunctionTemplateSpecialization
redeclarable_base::redecl_range redecl_range
StorageClass getStorageClass() const
Returns the storage class as written in the source.
FunctionDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
redeclarable_base::redecl_iterator redecl_iterator
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a member function.
bool isInlineBuiltinDeclaration() const
Determine if this function provides an inline implementation of a builtin.
bool FriendConstraintRefersToEnclosingTemplate() const
ParmVarDecl * getParamDecl(unsigned i)
TemplatedKind getTemplatedKind() const
What kind of templated function this is.
void setInstantiatedFromDecl(FunctionDecl *FD)
Specify that this function declaration was instantiated from a FunctionDecl FD.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
bool isDeletedAsWritten() const
bool isReservedGlobalPlacementOperator() const
Determines whether this operator new or delete is one of the reserved global placement operators: voi...
ParmVarDecl * getNonObjectParameter(unsigned I)
void setHasInheritedPrototype(bool P=true)
State that this function inherited its prototype from a previous declaration.
void setDependentTemplateSpecialization(ASTContext &Context, const UnresolvedSetImpl &Templates, const TemplateArgumentListInfo *TemplateArgs)
Specifies that this function declaration is actually a dependent function template specialization.
bool isInExternCContext() const
Determines whether this function's context is, or is nested within, a C++ extern "C" linkage spec.
FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass S, bool UsesFPIntrin, bool isInlineSpecified, ConstexprSpecKind ConstexprKind, Expr *TrailingRequiresClause=nullptr)
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
bool isImplicitlyInstantiable() const
Determines whether this function is a function template specialization or a member of a class templat...
bool isExternC() const
Determines whether this function is a function with external, C linkage.
Stmt * getBody() const override
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
bool isLateTemplateParsed() const
Whether this templated function will be late parsed.
LazyDeclStmtPtr Body
The body of the function.
bool hasImplicitReturnZero() const
Whether falling off this function implicitly returns null/zero.
bool isImmediateEscalating() const
void setVirtualAsWritten(bool V)
State that this function is marked as virtual explicitly.
bool hasSkippedBody() const
True if the function was a definition but its body was skipped.
static bool classof(const Decl *D)
void setLateTemplateParsed(bool ILT=true)
State that this templated function will be late parsed.
DefaultedOrDeletedFunctionInfo * DefaultedOrDeletedInfo
Information about a future defaulted function definition.
FunctionDecl * getDefinition()
Get the definition for this declaration.
bool isInExternCXXContext() const
Determines whether this function's context is, or is nested within, a C++ extern "C++" linkage spec.
bool isMain() const
Determines whether this function is "main", which is the entry point into an executable program.
void setImplicitlyInline(bool I=true)
Flag that this function is implicitly inline.
bool isTargetVersionMultiVersion() const
True if this function is a multiversioned dispatch function as a part of the target-version functiona...
void setTrivialForCall(bool IT)
bool isReplaceableGlobalAllocationFunction(std::optional< unsigned > *AlignmentParam=nullptr, bool *IsNothrow=nullptr) const
Determines whether this function is one of the replaceable global allocation functions: void *operato...
void setLazyBody(uint64_t Offset)
static FunctionDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation NLoc, DeclarationName N, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool UsesFPIntrin=false, bool isInlineSpecified=false, bool hasWrittenPrototype=true, ConstexprSpecKind ConstexprKind=ConstexprSpecKind::Unspecified, Expr *TrailingRequiresClause=nullptr)
bool isThisDeclarationInstantiatedFromAFriendDefinition() const
Determine whether this specific declaration of the function is a friend declaration that was instanti...
void setRangeEnd(SourceLocation E)
bool isCPUDispatchMultiVersion() const
True if this function is a multiversioned dispatch function as a part of the cpu_specific/cpu_dispatc...
bool isDefaulted() const
Whether this function is defaulted.
bool isIneligibleOrNotSelected() const
void setIneligibleOrNotSelected(bool II)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isOverloadedOperator() const
Whether this function declaration represents an C++ overloaded operator, e.g., "operator+".
FunctionDecl * getInstantiatedFromDecl() const
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Determine what kind of template instantiation this function represents.
const IdentifierInfo * getLiteralIdentifier() const
getLiteralIdentifier - The literal suffix identifier this function represents, if any.
OverloadedOperatorKind getOverloadedOperator() const
getOverloadedOperator - Which C++ overloaded operator this function represents, if any.
void setConstexprKind(ConstexprSpecKind CSK)
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
param_const_iterator param_begin() const
bool doesDeclarationForceExternallyVisibleDefinition() const
For a function declaration in C or C++, determine whether this declaration causes the definition to b...
void setDefaulted(bool D=true)
bool isTargetMultiVersion() const
True if this function is a multiversioned dispatch function as a part of the target functionality.
bool isUserProvided() const
True if this method is user-declared and was not deleted or defaulted on its first declaration.
QualType getDeclaredReturnType() const
Get the declared return type, which may differ from the actual return type if the return type is dedu...
void setStorageClass(StorageClass SClass)
Sets the storage class as written in the source.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool isGlobal() const
Determines whether this is a global function.
bool hasOneParamOrDefaultArgs() const
Determine whether this function has a single parameter, or multiple parameters where all but the firs...
void setDeletedAsWritten(bool D=true, StringLiteral *Message=nullptr)
void setFunctionTemplateSpecialization(FunctionTemplateDecl *Template, TemplateArgumentList *TemplateArgs, void *InsertPos, TemplateSpecializationKind TSK=TSK_ImplicitInstantiation, TemplateArgumentListInfo *TemplateArgsAsWritten=nullptr, SourceLocation PointOfInstantiation=SourceLocation())
Specify that this function declaration is actually a function template specialization.
void getAssociatedConstraints(SmallVectorImpl< const Expr * > &AC) const
Get the associated-constraints of this function declaration.
void setExplicitlyDefaulted(bool ED=true)
State that this function is explicitly defaulted.
param_const_iterator param_end() const
bool hasInheritedPrototype() const
Whether this function inherited its prototype from a previous declaration.
bool isTargetMultiVersionDefault() const
True if this function is the default version of a multiversioned dispatch function as a part of the t...
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization,...
bool isInlineDefinitionExternallyVisible() const
For an inline function definition in C, or for a gnu_inline function in C++, determine whether the de...
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
size_t param_size() const
DeclarationNameInfo getNameInfo() const
SourceRange getParametersSourceRange() const
Attempt to compute an informative source range covering the function parameters, including the ellips...
static FunctionDecl * castFromDeclContext(const DeclContext *DC)
void setHasImplicitReturnZero(bool IRZ)
State that falling off this function implicitly returns null/zero.
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
MultiVersionKind getMultiVersionKind() const
Gets the kind of multiversioning attribute this declaration has.
DefaultedOrDeletedFunctionInfo * getDefalutedOrDeletedInfo() const
void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const override
Appends a human-readable name for this declaration into the given stream.
void setParams(ArrayRef< ParmVarDecl * > NewParamInfo)
bool willHaveBody() const
True if this function will eventually have a body, once it's fully parsed.
const ASTTemplateArgumentListInfo * getTemplateSpecializationArgsAsWritten() const
Retrieve the template argument list as written in the sources, if any.
QualType getCallResultType() const
Determine the type of an expression that calls this function.
An immutable set of FunctionEffects and possibly conditions attached to them.
Represents a prototype with parameter type info, e.g.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
SourceLocation getEllipsisLoc() const
Declaration of a template function.
Provides information about a function template specialization, which is a FunctionDecl that has been ...
Wrapper for source info for functions.
FunctionType - C99 6.7.5.3 - Function Declarators.
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
static HLSLBufferDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const HLSLBufferDecl *D)
SourceLocation getLBraceLoc() const
SourceLocation getLocStart() const LLVM_READONLY
SourceLocation getRBraceLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setRBraceLoc(SourceLocation L)
static bool classofKind(Kind K)
static HLSLBufferDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
static bool classofKind(Kind K)
ImplicitParamDecl(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, const IdentifierInfo *Id, QualType Type, ImplicitParamKind ParamKind)
ImplicitParamKind getParameterKind() const
Returns the implicit parameter kind.
static bool classof(const Decl *D)
ImplicitParamDecl(ASTContext &C, QualType Type, ImplicitParamKind ParamKind)
static ImplicitParamDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
Describes a module import declaration, which makes the contents of the named module visible in the cu...
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static ImportDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NumLocations)
Create a new, deserialized module import declaration.
static bool classof(const Decl *D)
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.
static bool classofKind(Kind K)
static ImportDecl * CreateImplicit(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, SourceLocation EndLoc)
Create a new module import declaration for an implicitly-generated import.
Represents a field injected from an anonymous union/struct into the parent scope.
const IndirectFieldDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
static bool classof(const Decl *D)
FieldDecl * getAnonField() const
static IndirectFieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
unsigned getChainingSize() const
IndirectFieldDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
chain_iterator chain_end() const
chain_iterator chain_begin() const
ArrayRef< NamedDecl * > chain() const
VarDecl * getVarDecl() const
ArrayRef< NamedDecl * >::const_iterator chain_iterator
Represents the declaration of a label.
static bool classofKind(Kind K)
void setMSAsmLabel(StringRef Name)
bool isResolvedMSAsmLabel() const
static bool classof(const Decl *D)
void setLocStart(SourceLocation L)
LabelStmt * getStmt() const
StringRef getMSAsmLabel() const
void setStmt(LabelStmt *T)
void setMSAsmLabelResolved()
static LabelDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isMSAsmLabel() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
LabelStmt - Represents a label, which has a substatement.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Visibility getVisibility() const
Provides information a specialization of a member of a class template, which may be a member function...
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
FieldDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Describes a module or submodule.
This represents a decl that may have a name.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
ExplicitVisibilityKind
Kinds of explicit visibility.
@ VisibilityForValue
Do an LV computation for, ultimately, a non-type declaration.
@ VisibilityForType
Do an LV computation for, ultimately, a type.
Linkage getLinkageInternal() const
Determine what kind of linkage this entity has.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
LinkageInfo getLinkageAndVisibility() const
Determines the linkage and visibility of this entity.
bool isLinkageValid() const
True if the computed linkage is valid.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
bool isPlaceholderVar(const LangOptions &LangOpts) const
Visibility getVisibility() const
Determines the visibility of this entity.
bool hasLinkageBeenComputed() const
True if something has required us to compute the linkage of this declaration.
bool hasExternalFormalLinkage() const
True if this decl has external linkage.
static bool classof(const Decl *D)
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
std::string getQualifiedNameAsString() const
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
std::optional< Visibility > getExplicitVisibility(ExplicitVisibilityKind kind) const
If visibility was explicitly specified for this declaration, return that visibility.
NamedDecl * getMostRecentDecl()
virtual void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
Appends a human-readable name for this declaration into the given stream.
bool declarationReplaces(const NamedDecl *OldD, bool IsKnownNewer=true) const
Determine whether this declaration, if known to be well-formed within its context,...
ObjCStringFormatFamily getObjCFStringFormattingFamily() const
Linkage getFormalLinkage() const
Get the linkage from a semantic point of view.
void printQualifiedName(raw_ostream &OS) const
Returns a human-readable qualified name for this declaration, like A::B::i, for i being member of nam...
static bool classofKind(Kind K)
virtual void printName(raw_ostream &OS, const PrintingPolicy &Policy) const
Pretty-print the unqualified name of this declaration.
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
bool hasLinkage() const
Determine whether this declaration has linkage.
const NamedDecl * getMostRecentDecl() const
bool isExternallyVisible() const
void setDeclName(DeclarationName N)
Set the name of this declaration.
ReservedIdentifierStatus isReserved(const LangOptions &LangOpts) const
Determine if the declaration obeys the reserved identifier rules of the given language.
bool isCXXClassMember() const
Determine whether this declaration is a C++ class member.
const NamedDecl * getUnderlyingDecl() const
void printNestedNameSpecifier(raw_ostream &OS) const
Print only the nested name specifier part of a fully-qualified name, including the '::' at the end.
bool isExternallyDeclarable() const
Determine whether this declaration can be redeclared in a different translation unit.
Represent a C++ namespace.
NamespaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this namespace.
redeclarable_base::redecl_iterator redecl_iterator
SourceLocation getRBraceLoc() const
const NamespaceDecl * getCanonicalDecl() const
void setAnonymousNamespace(NamespaceDecl *D)
static bool classofKind(Kind K)
void setNested(bool Nested)
Set whether this is a nested namespace declaration.
static DeclContext * castToDeclContext(const NamespaceDecl *D)
void setLocStart(SourceLocation L)
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.
static bool classof(const Decl *D)
static NamespaceDecl * castFromDeclContext(const DeclContext *DC)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setInline(bool Inline)
Set whether 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.
static NamespaceDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setRBraceLoc(SourceLocation L)
redeclarable_base::redecl_range redecl_range
bool isRedundantInlineQualifierFor(DeclarationName Name) const
Returns true if the inline qualifier for Name is redundant.
A C++ nested-name-specifier augmented with source location information.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Represents a C++ nested name specifier, such as "\::std::vector::".
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.
void setObjCDeclQualifier(ObjCDeclQualifier QTVal)
static bool classofKind(Kind K)
void setDefaultArg(Expr *defarg)
static ParmVarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
SourceLocation getExplicitObjectParamThisLoc() const
void setUnparsedDefaultArg()
Specify that this parameter has an unparsed default argument.
ParmVarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
bool hasUnparsedDefaultArg() const
Determines whether this parameter has a default argument that has not yet been parsed.
SourceRange getDefaultArgRange() const
Retrieve the source range that covers the entire default argument.
void setUninstantiatedDefaultArg(Expr *arg)
bool isObjCMethodParameter() const
ObjCDeclQualifier getObjCDeclQualifier() const
static constexpr unsigned getMaxFunctionScopeDepth()
const Expr * getDefaultArg() const
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
bool hasUninstantiatedDefaultArg() const
void setObjCMethodScopeInfo(unsigned parameterIndex)
bool isDestroyedInCallee() const
Determines whether this parameter is destroyed in the callee function.
bool hasInheritedDefaultArg() const
bool isExplicitObjectParameter() const
void setKNRPromoted(bool promoted)
QualType getOriginalType() const
const Expr * getUninstantiatedDefaultArg() const
void setExplicitObjectParameterLoc(SourceLocation Loc)
Expr * getUninstantiatedDefaultArg()
bool hasDefaultArg() const
Determines whether this parameter has a default argument, either parsed or not.
unsigned getFunctionScopeDepth() const
void setHasInheritedDefaultArg(bool I=true)
void setOwningFunction(DeclContext *FD)
Sets the function declaration that owns this ParmVarDecl.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static bool classof(const Decl *D)
Represents a #pragma detect_mismatch line.
StringRef getName() const
static PragmaDetectMismatchDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID, unsigned NameValueSize)
StringRef getValue() const
static bool classofKind(Kind K)
static bool classof(const Decl *D)
A (possibly-)qualified type.
Represents a struct/union/class.
bool hasLoadedFieldsFromExternalStorage() const
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
bool hasNonTrivialToPrimitiveDestructCUnion() const
bool isLambda() const
Determine whether this record is a class describing a lambda function object.
bool hasNonTrivialToPrimitiveCopyCUnion() const
bool isMsStruct(const ASTContext &C) const
Get whether or not this is an ms_struct which can be turned on with an attribute, pragma,...
void setAnonymousStructOrUnion(bool Anon)
bool canPassInRegisters() const
Determine whether this class can be passed in registers.
RecordArgPassingKind getArgPassingRestrictions() const
bool hasVolatileMember() const
bool hasFlexibleArrayMember() const
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
const FieldDecl * findFirstNamedDataMember() const
Finds the first data member which has a name.
const RecordDecl * getMostRecentDecl() const
void setArgPassingRestrictions(RecordArgPassingKind Kind)
void setNonTrivialToPrimitiveCopy(bool V)
bool hasObjectMember() const
bool isNonTrivialToPrimitiveDestroy() const
bool isNonTrivialToPrimitiveCopy() const
bool isCapturedRecord() const
Determine whether this record is a record for captured variables in CapturedStmt construct.
void setHasNonTrivialToPrimitiveCopyCUnion(bool V)
field_iterator field_end() const
field_range fields() const
bool isRandomized() const
void setHasNonTrivialToPrimitiveDestructCUnion(bool V)
static bool classofKind(Kind K)
void setHasFlexibleArrayMember(bool V)
void setParamDestroyedInCallee(bool V)
void setNonTrivialToPrimitiveDestroy(bool V)
void setHasObjectMember(bool val)
bool isInjectedClassName() const
Determines whether this declaration represents the injected class name.
void setHasVolatileMember(bool val)
void setHasNonTrivialToPrimitiveDefaultInitializeCUnion(bool V)
void reorderDecls(const SmallVectorImpl< Decl * > &Decls)
void setIsRandomized(bool V)
bool isParamDestroyedInCallee() const
static RecordDecl * CreateDeserialized(const ASTContext &C, GlobalDeclID ID)
bool mayInsertExtraPadding(bool EmitRemark=false) const
Whether we are allowed to insert extra padding between fields.
static bool classof(const Decl *D)
RecordDecl * getMostRecentDecl()
const RecordDecl * getPreviousDecl() const
bool isOrContainsUnion() const
Returns whether this record is a union, or contains (at any nesting level) a union member.
virtual void completeDefinition()
Note that the definition of this type is now complete.
llvm::iterator_range< specific_decl_iterator< FieldDecl > > field_range
RecordDecl * getDefinition() const
Returns the RecordDecl that actually defines this struct/union/class.
bool hasUninitializedExplicitInitFields() const
void setCapturedRecord()
Mark the record as a record for captured variables in CapturedStmt construct.
specific_decl_iterator< FieldDecl > field_iterator
void setHasUninitializedExplicitInitFields(bool V)
RecordDecl * getPreviousDecl()
void setNonTrivialToPrimitiveDefaultInitialize(bool V)
bool isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C structs.
bool isAnonymousStructOrUnion() const
Whether this is an anonymous struct or union.
void setHasLoadedFieldsFromExternalStorage(bool val) const
field_iterator field_begin() const
Provides common interface for the Decls that can be redeclared.
TranslationUnitDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
TranslationUnitDecl * getNextRedeclaration() const
TranslationUnitDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
TranslationUnitDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
void setPreviousDecl(decl_type *PrevDecl)
Set the previous declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
redecl_iterator redecls_begin() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
StringLiteral - This represents a string literal expression, e.g.
Represents the declaration of a struct/union/class/enum.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
void setTagKind(TagKind TK)
void setCompleteDefinitionRequired(bool V=true)
True if this complete decl is required to be complete for some existing use.
static TagDecl * castFromDeclContext(const DeclContext *DC)
SourceRange getBraceRange() const
bool isBeingDefined() const
Return true if this decl is currently being defined.
void demoteThisDefinitionToDeclaration()
Mark a definition as a declaration and maintain information it was a definition.
TagDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
TagDecl * getDefinition() const
Returns the TagDecl that actually defines this struct/union/class/enum.
bool isThisDeclarationADefinition() const
Return true if this declaration is a completion definition of the type.
void setEmbeddedInDeclarator(bool isInDeclarator)
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
SourceLocation getInnerLocStart() const
Return SourceLocation representing start of source range ignoring outer template declarations.
bool isEmbeddedInDeclarator() const
True if this tag declaration is "embedded" (i.e., defined or declared for the very first time) in the...
StringRef getKindName() const
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
void setMayHaveOutOfDateDef(bool V=true)
Indicates whether it is possible for declarations of this kind to have an out-of-date definition.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier (with source-location information) that qualifies the name of this...
redeclarable_base::redecl_iterator redecl_iterator
TypedefNameDecl * getTypedefNameForAnonDecl() const
static bool classofKind(Kind K)
void startDefinition()
Starts the definition of this tag declaration.
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
void setTypedefNameForAnonDecl(TypedefNameDecl *TDD)
bool mayHaveOutOfDateDef() const
Indicates whether it is possible for declarations of this kind to have an out-of-date definition.
SourceLocation getOuterLocStart() const
Return SourceLocation representing start of source range taking into account any outer template decla...
bool isCompleteDefinitionRequired() const
Return true if this complete decl is required to be complete for some existing use.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isFreeStanding() const
True if this tag is free standing, e.g. "struct foo;".
void setBeingDefined(bool V=true)
True if this decl is currently being defined.
void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc)
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
void completeDefinition()
Completes the definition of this tag declaration.
void printName(raw_ostream &OS, const PrintingPolicy &Policy) const override
Pretty-print the unqualified name of this declaration.
static bool classof(const Decl *D)
bool hasNameForLinkage() const
Is this tag type named, either directly or via being defined in a typedef of this type?
TemplateParameterList * getTemplateParameterList(unsigned i) const
void setFreeStanding(bool isFreeStanding=true)
True if this tag is free standing, e.g. "struct foo;".
TagKind getTagKind() const
TagDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
TagDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
bool isThisDeclarationADemotedDefinition() const
Whether this declaration was a definition in some module but was forced to be a declaration.
unsigned getNumTemplateParameterLists() const
redeclarable_base::redecl_range redecl_range
static DeclContext * castToDeclContext(const TagDecl *D)
bool isDependentType() const
Whether this declaration declares a type that is dependent, i.e., a type that somehow depends on temp...
void setBraceRange(SourceRange R)
TagDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, TagDecl *PrevDecl, SourceLocation StartL)
void setCompleteDefinition(bool V=true)
True if this decl has its body fully specified.
A convenient class for passing around template argument information.
A template argument list.
Stores a list of template parameters for a TemplateDecl and its derived classes.
A declaration that models statements at global scope.
static bool classofKind(Kind K)
const Stmt * getStmt() const
void setSemiMissing(bool Missing=true)
static bool classof(const Decl *D)
static TopLevelStmtDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isSemiMissing() const
static DeclContext * castToDeclContext(const TopLevelStmtDecl *D)
static TopLevelStmtDecl * castFromDeclContext(const DeclContext *DC)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
The top declaration context.
static TranslationUnitDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const TranslationUnitDecl *D)
redeclarable_base::redecl_range redecl_range
const TranslationUnitDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
NamespaceDecl * getAnonymousNamespace() const
ASTContext & getASTContext() const
redeclarable_base::redecl_iterator redecl_iterator
static bool classof(const Decl *D)
TranslationUnitDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this translation unit.
void setAnonymousNamespace(NamespaceDecl *D)
Represents the declaration of a typedef-name via a C++11 alias-declaration.
static TypeAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
TypeAliasTemplateDecl * getDescribedAliasTemplate() const
void setDescribedAliasTemplate(TypeAliasTemplateDecl *TAT)
static bool classof(const Decl *D)
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Declaration of an alias template.
Represents a declaration of a type.
void setLocStart(SourceLocation L)
static bool classofKind(Kind K)
void setTypeForDecl(const Type *TD)
const Type * getTypeForDecl() const
static bool classof(const Decl *D)
TypeDecl(Kind DK, DeclContext *DC, SourceLocation L, const IdentifierInfo *Id, SourceLocation StartL=SourceLocation())
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getBeginLoc() const LLVM_READONLY
A container of type source information.
static StringRef getTagTypeKindName(TagTypeKind Kind)
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs.
const T * getAs() const
Member-template getAs'.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static TypedefDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
Base class for declarations which introduce a typedef-name.
TypedefNameDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
TypeSourceInfo * getTypeSourceInfo() const
TypedefNameDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
void setModedTypeSourceInfo(TypeSourceInfo *unmodedTSI, QualType modedTy)
redeclarable_base::redecl_range redecl_range
static bool classof(const Decl *D)
const TypedefNameDecl * getCanonicalDecl() const
TypedefNameDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, TypeSourceInfo *TInfo)
QualType getUnderlyingType() const
bool isTransparentTag() const
Determines if this typedef shares a name and spelling location with its underlying tag type,...
redeclarable_base::redecl_iterator redecl_iterator
TypedefNameDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this typedef-name.
void setTypeSourceInfo(TypeSourceInfo *newType)
static bool classofKind(Kind K)
TagDecl * getAnonDeclWithTypedefName(bool AnyRedecl=false) const
Retrieves the tag declaration for which this is the typedef name for linkage purposes,...
A set of unresolved declarations.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
static bool classof(const Decl *D)
ValueDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N, QualType T)
void setType(QualType newType)
bool isWeak() const
Determine whether this symbol is weakly-imported, or declared with the weak or weak-ref attr.
static bool classofKind(Kind K)
VarDecl * getPotentiallyDecomposedVarDecl()
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
const VarDecl * getPotentiallyDecomposedVarDecl() const
Represents a variable declaration or definition.
@ NumScopeDepthOrObjCQualsBits
const VarDecl * getDefinition() const
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
void setObjCForDecl(bool FRD)
Stmt ** getInitAddress()
Retrieve the address of the initializer expression.
const VarDecl * getInitializingDeclaration() const
void setCXXForRangeDecl(bool FRD)
DefinitionKind isThisDeclarationADefinition() const
bool isFunctionOrMethodVarDecl() const
Similar to isLocalVarDecl, but excludes variables declared in blocks.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
void setInstantiationOfStaticDataMember(VarDecl *VD, TemplateSpecializationKind TSK)
Specify that this variable is an instantiation of the static data member VD.
TLSKind getTLSKind() const
bool hasICEInitializer(const ASTContext &Context) const
Determine whether the initializer of this variable is an integer constant expression.
redeclarable_base::redecl_range redecl_range
ParmVarDeclBitfields ParmVarDeclBits
void setARCPseudoStrong(bool PS)
VarDecl * getNextRedeclarationImpl() override
Returns the next redeclaration or itself if this is the only decl.
void setInitStyle(InitializationStyle Style)
redeclarable_base::redecl_iterator redecl_iterator
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
void setInitCapture(bool IC)
DefinitionKind hasDefinition() const
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isOutOfLine() const override
Determine whether this is or was instantiated from an out-of-line definition of a static data member.
VarDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool hasFlexibleArrayInit(const ASTContext &Ctx) const
Whether this variable has a flexible array member initialized with one or more elements.
bool isNoDestroy(const ASTContext &) const
Is destruction of this variable entirely suppressed? If so, the variable need not have a usable destr...
bool isInitCapture() const
Whether this variable is the implicit variable for a lambda init-capture.
bool isCXXCondDecl() const
InitializationStyle
Initialization styles.
@ ListInit
Direct list-initialization (C++11)
@ CInit
C-style initialization with assignment.
@ ParenListInit
Parenthesized list-initialization (C++20)
@ CallInit
Call-style initialization (C++98)
bool isObjCForDecl() const
Determine whether this variable is a for-loop declaration for a for-in statement in Objective-C.
void setStorageClass(StorageClass SC)
void setPreviousDeclInSameBlockScope(bool Same)
bool isInlineSpecified() const
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
bool isStaticDataMember() const
Determines whether this is a static data member.
static VarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
bool hasGlobalStorage() const
Returns true for all variables that do not have local storage.
VarDeclBitfields VarDeclBits
CharUnits getFlexibleArrayInitChars(const ASTContext &Ctx) const
If hasFlexibleArrayInit is true, compute the number of additional bytes necessary to store those elem...
bool hasConstantInitialization() const
Determine whether this variable has constant initialization.
bool isCXXForRangeDecl() const
Determine whether this variable is the for-range-declaration in a C++0x for-range statement.
LanguageLinkage getLanguageLinkage() const
Compute the language linkage.
static bool classofKind(Kind K)
const VarDecl * getDefinition(ASTContext &C) const
EvaluatedStmt * getEvaluatedStmt() const
bool mightBeUsableInConstantExpressions(const ASTContext &C) const
Determine whether this variable's value might be usable in a constant expression, according to the re...
EvaluatedStmt * ensureEvaluatedStmt() const
Convert the initializer for this declaration to the elaborated EvaluatedStmt form,...
bool evaluateDestruction(SmallVectorImpl< PartialDiagnosticAt > &Notes) const
Evaluate the destruction of this variable to determine if it constitutes constant destruction.
static bool classof(const Decl *D)
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
void setInlineSpecified()
bool isStaticLocal() const
Returns true if a variable with function scope is a static local variable.
const VarDecl * getCanonicalDecl() const
VarDecl * getInstantiatedFromStaticDataMember() const
If this variable is an instantiated static data member of a class template specialization,...
bool isFileVarDecl() const
Returns true for file scoped variable declaration.
bool isExceptionVariable() const
Determine whether this variable is the exception variable in a C++ catch statememt or an Objective-C ...
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For a static data member that was instantiated from a static data member of a class template,...
void setTSCSpec(ThreadStorageClassSpecifier TSC)
void setNRVOVariable(bool NRVO)
QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const
Would the destruction of this variable have any effect, and if so, what kind?
bool checkForConstantInitialization(SmallVectorImpl< PartialDiagnosticAt > &Notes) const
Evaluate the initializer of this variable to determine whether it's a constant initializer.
bool isInline() const
Whether this variable is (C++1z) inline.
ThreadStorageClassSpecifier getTSCSpec() const
const Expr * getInit() const
bool isNonEscapingByref() const
Indicates the capture is a __block variable that is never captured by an escaping block.
bool isInExternCContext() const
Determines whether this variable's context is, or is nested within, a C++ extern "C" linkage spec.
NonParmVarDeclBitfields NonParmVarDeclBits
bool hasExternalStorage() const
Returns true if a variable has extern or private_extern storage.
InitType Init
The initializer for this variable or, for a ParmVarDecl, the C++ default argument.
APValue * getEvaluatedValue() const
Return the already-evaluated value of this variable's initializer, or NULL if the value is not yet kn...
bool isARCPseudoStrong() const
Determine whether this variable is an ARC pseudo-__strong variable.
bool hasLocalStorage() const
Returns true if a variable with function scope is a non-static local variable.
VarDecl * getInitializingDeclaration()
Get the initializing declaration of this variable, if any.
void setConstexpr(bool IC)
TLSKind
Kinds of thread-local storage.
@ TLS_Static
TLS with a known-constant initializer.
@ TLS_Dynamic
TLS with a dynamic initializer.
@ TLS_None
Not a TLS variable.
VarDecl * getActingDefinition()
Get the tentative definition that acts as the real definition in a TU.
@ TentativeDefinition
This declaration is a tentative definition.
@ DeclarationOnly
This declaration is only a declaration.
@ Definition
This declaration is definitely a definition.
void setDescribedVarTemplate(VarTemplateDecl *Template)
bool isExternC() const
Determines whether this variable is a variable with external, C linkage.
llvm::PointerUnion< Stmt *, EvaluatedStmt * > InitType
bool isLocalVarDecl() const
Returns true for local variable declarations other than parameters.
bool isDirectInit() const
Whether the initializer is a direct-initializer (list or call).
VarDecl * getMostRecentDeclImpl() override
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
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 (...
void setImplicitlyInline()
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 ...
bool isUsableInConstantExpressions(const ASTContext &C) const
Determine whether this variable's value can be used in a constant expression, according to the releva...
bool isInExternCXXContext() const
Determines whether this variable's context is, or is nested within, a C++ extern "C++" linkage spec.
SourceLocation getPointOfInstantiation() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
bool hasDependentAlignment() const
Determines if this variable's alignment is dependent.
TemplateSpecializationKind getTemplateSpecializationKindForInstantiation() const
Get the template specialization kind of this variable for the purposes of template instantiation.
VarDecl * getDefinition()
bool isLocalVarDeclOrParm() const
Similar to isLocalVarDecl but also includes parameters.
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
const VarDecl * getActingDefinition() const
const Expr * getAnyInitializer() const
Get the initializer for this variable, no matter which declaration it is attached to.
void setExceptionVariable(bool EV)
bool isKnownToBeDefined() const
VarDecl * getPreviousDeclImpl() override
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
void demoteThisDefinitionToDeclaration()
This is a definition which should be demoted to a declaration.
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this variable is an instantiation of a static data member of a class template specialization,...
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Defines the Linkage enumeration and various utility functions.
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ OO_None
Not an overloaded operator.
ConstexprSpecKind
Define the kind of constexpr specifier.
InClassInitStyle
In-class initialization styles for non-static data members.
@ ICIS_CopyInit
Copy initialization.
@ ICIS_ListInit
Direct list-initialization.
@ ICIS_NoInit
No in-class initializer.
LazyOffsetPtr< Stmt, uint64_t, &ExternalASTSource::GetExternalDeclStmt > LazyDeclStmtPtr
A lazy pointer to a statement.
bool IsEnumDeclComplete(EnumDecl *ED)
Check if the given decl is complete.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
LanguageLinkage
Describes the different kinds of language linkage (C++ [dcl.link]) that an entity may have.
StorageClass
Storage classes.
ThreadStorageClassSpecifier
Thread storage-class-specifier.
@ TSCS_thread_local
C++11 thread_local.
static constexpr StringRef getOpenMPVariantManglingSeparatorStr()
OpenMP variants are mangled early based on their OpenMP context selector.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
@ Asm
Assembly: we accept this only so that we can preprocess it.
StorageDuration
The storage duration for an object (per C++ [basic.stc]).
@ SD_Thread
Thread storage duration.
@ SD_Static
Static storage duration.
@ SD_Automatic
Automatic storage duration (most local variables).
TagTypeKind
The kind of a tag type.
@ Interface
The "__interface" keyword.
@ Struct
The "struct" keyword.
@ Class
The "class" keyword.
@ Union
The "union" keyword.
@ Enum
The "enum" keyword.
bool IsEnumDeclScoped(EnumDecl *ED)
Check if the given decl is scoped.
RecordArgPassingKind
Enum that represents the different ways arguments are passed to and returned from function calls.
@ CanPassInRegs
The argument of this type can be passed directly in registers.
@ CanNeverPassInRegs
The argument of this type cannot be passed directly in registers.
@ CannotPassInRegs
The argument of this type cannot be passed directly in registers.
const FunctionProtoType * T
bool isExternalFormalLinkage(Linkage L)
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
@ None
The alignment was not explicit in code.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
bool IsArmStreamingFunction(const FunctionDecl *FD, bool IncludeLocallyStreaming)
Returns whether the given FunctionDecl has an __arm[_locally]_streaming attribute.
bool isExternallyVisible(Linkage L)
ImplicitParamKind
Defines the kind of the implicit parameter: is this an implicit parameter with pointer to 'this',...
@ CXXThis
Parameter for C++ 'this' argument.
@ ThreadPrivateVar
Parameter for Thread private variable.
@ Other
Other implicit parameter.
@ CXXVTT
Parameter for C++ virtual table pointers.
@ ObjCSelf
Parameter for Objective-C 'self' argument.
@ ObjCCmd
Parameter for Objective-C '_cmd' argument.
@ CapturedContext
Parameter for captured context.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
@ EST_None
no exception specification
Visibility
Describes the different kinds of visibility that a declaration may have.
Diagnostic wrappers for TextAPI types for error reporting.
Represents an explicit template argument list in C++, e.g., the "" in "sort".
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Structure used to store a statement, the constant value to which it was evaluated (if any),...
bool HasConstantDestruction
Whether this variable is known to have constant destruction.
bool WasEvaluated
Whether this statement was already evaluated.
bool IsEvaluating
Whether this statement is being evaluated.
bool HasConstantInitialization
Whether this variable is known to have constant initialization.
bool HasICEInit
In C++98, whether the initializer is an ICE.
Describes how types, statements, expressions, and declarations should be printed.
A struct with extended info about a syntactic name qualifier, to be used for the case of out-of-line ...
QualifierInfo & operator=(const QualifierInfo &)=delete
TemplateParameterList ** TemplParamLists
A new-allocated array of size NumTemplParamLists, containing pointers to the "outer" template paramet...
NestedNameSpecifierLoc QualifierLoc
QualifierInfo(const QualifierInfo &)=delete
unsigned NumTemplParamLists
The number of "outer" template parameter lists.
void setTemplateParameterListsInfo(ASTContext &Context, ArrayRef< TemplateParameterList * > TPLists)
Sets info about "outer" template parameter lists.