clang: include/clang/AST/ASTContext.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_CLANG_AST_ASTCONTEXT_H
15#define LLVM_CLANG_AST_ASTCONTEXT_H
16
31#include "llvm/ADT/DenseMap.h"
32#include "llvm/ADT/DenseSet.h"
33#include "llvm/ADT/FoldingSet.h"
34#include "llvm/ADT/IntrusiveRefCntPtr.h"
35#include "llvm/ADT/MapVector.h"
36#include "llvm/ADT/PointerIntPair.h"
37#include "llvm/ADT/PointerUnion.h"
38#include "llvm/ADT/SetVector.h"
39#include "llvm/ADT/SmallVector.h"
40#include "llvm/ADT/StringMap.h"
41#include "llvm/ADT/StringRef.h"
42#include "llvm/ADT/StringSet.h"
43#include "llvm/ADT/TinyPtrVector.h"
44#include "llvm/Support/TypeSize.h"
45#include
46
47namespace llvm {
48
49class APFixedPoint;
51struct fltSemantics;
52template <typename T, unsigned N> class SmallPtrSet;
53
54}
55
57
58class APValue;
59class ASTMutationListener;
60class ASTRecordLayout;
61class AtomicExpr;
62class BlockExpr;
63struct BlockVarCopyInit;
64class BuiltinTemplateDecl;
65class CharUnits;
66class ConceptDecl;
68class CXXConstructorDecl;
69class CXXMethodDecl;
70class CXXRecordDecl;
71class DiagnosticsEngine;
72class DynTypedNodeList;
73class Expr;
75class GlobalDecl;
76class IdentifierTable;
77class LangOptions;
78class MangleContext;
79class MangleNumberingContext;
80class MemberSpecializationInfo;
81class Module;
82struct MSGuidDeclParts;
83class NestedNameSpecifier;
84class NoSanitizeList;
85class ObjCCategoryDecl;
86class ObjCCategoryImplDecl;
87class ObjCContainerDecl;
88class ObjCImplDecl;
89class ObjCImplementationDecl;
90class ObjCInterfaceDecl;
91class ObjCIvarDecl;
92class ObjCMethodDecl;
93class ObjCPropertyDecl;
94class ObjCPropertyImplDecl;
95class ObjCProtocolDecl;
96class ObjCTypeParamDecl;
97class OMPTraitInfo;
98class ParentMapContext;
99struct ParsedTargetAttr;
100class Preprocessor;
101class ProfileList;
102class StoredDeclsMap;
103class TargetAttr;
104class TargetInfo;
105class TemplateDecl;
106class TemplateParameterList;
107class TemplateTemplateParmDecl;
108class TemplateTypeParmDecl;
109class TypeConstraint;
110class UnresolvedSetIterator;
111class UsingShadowDecl;
112class VarTemplateDecl;
113class VTableContextBase;
114class XRayFunctionFilter;
115
116
118
119namespace Builtin {
120
122
123}
124
127
128namespace comments {
129
131
132}
133
134namespace interp {
135
137
138}
139
140namespace serialization {
142}
143
145
147
148
150
151
153
154
156};
157
162
169 }
170};
171
176
183 }
184};
185
186
187
190
192 mutable llvm::FoldingSet ExtQualNodes;
193 mutable llvm::FoldingSet ComplexTypes;
194 mutable llvm::FoldingSet PointerTypes{GeneralTypesLog2InitSize};
195 mutable llvm::FoldingSet AdjustedTypes;
196 mutable llvm::FoldingSet BlockPointerTypes;
197 mutable llvm::FoldingSet LValueReferenceTypes;
198 mutable llvm::FoldingSet RValueReferenceTypes;
199 mutable llvm::FoldingSet MemberPointerTypes;
200 mutable llvm::ContextualFoldingSet<ConstantArrayType, ASTContext &>
201 ConstantArrayTypes;
202 mutable llvm::FoldingSet IncompleteArrayTypes;
203 mutable std::vector<VariableArrayType*> VariableArrayTypes;
204 mutable llvm::ContextualFoldingSet<DependentSizedArrayType, ASTContext &>
205 DependentSizedArrayTypes;
206 mutable llvm::ContextualFoldingSet<DependentSizedExtVectorType, ASTContext &>
207 DependentSizedExtVectorTypes;
208 mutable llvm::ContextualFoldingSet<DependentAddressSpaceType, ASTContext &>
209 DependentAddressSpaceTypes;
210 mutable llvm::FoldingSet VectorTypes;
211 mutable llvm::ContextualFoldingSet<DependentVectorType, ASTContext &>
212 DependentVectorTypes;
213 mutable llvm::FoldingSet MatrixTypes;
214 mutable llvm::ContextualFoldingSet<DependentSizedMatrixType, ASTContext &>
215 DependentSizedMatrixTypes;
216 mutable llvm::FoldingSet FunctionNoProtoTypes;
217 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>
218 FunctionProtoTypes;
219 mutable llvm::ContextualFoldingSet<DependentTypeOfExprType, ASTContext &>
220 DependentTypeOfExprTypes;
221 mutable llvm::ContextualFoldingSet<DependentDecltypeType, ASTContext &>
222 DependentDecltypeTypes;
223
224 mutable llvm::FoldingSet DependentPackIndexingTypes;
225
226 mutable llvm::FoldingSet TemplateTypeParmTypes;
227 mutable llvm::FoldingSet ObjCTypeParamTypes;
228 mutable llvm::FoldingSet
229 SubstTemplateTypeParmTypes;
230 mutable llvm::FoldingSet
231 SubstTemplateTypeParmPackTypes;
232 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>
233 TemplateSpecializationTypes;
234 mutable llvm::FoldingSet ParenTypes{GeneralTypesLog2InitSize};
235 mutable llvm::FoldingSet UsingTypes;
236 mutable llvm::FoldingSet TypedefTypes;
237 mutable llvm::FoldingSet ElaboratedTypes{
238 GeneralTypesLog2InitSize};
239 mutable llvm::FoldingSet DependentNameTypes;
240 mutable llvm::ContextualFoldingSet<DependentTemplateSpecializationType,
242 DependentTemplateSpecializationTypes;
243 mutable llvm::FoldingSet PackExpansionTypes;
244 mutable llvm::FoldingSet ObjCObjectTypes;
245 mutable llvm::FoldingSet ObjCObjectPointerTypes;
246 mutable llvm::FoldingSet
247 DependentUnaryTransformTypes;
248
249
250
251
252 mutable llvm::DenseMap<llvm::FoldingSetNodeID, AutoType *> AutoTypes;
253 mutable llvm::FoldingSet
254 DeducedTemplateSpecializationTypes;
255 mutable llvm::FoldingSet AtomicTypes;
256 mutable llvm::FoldingSet AttributedTypes;
257 mutable llvm::FoldingSet PipeTypes;
258 mutable llvm::FoldingSet BitIntTypes;
259 mutable llvm::ContextualFoldingSet<DependentBitIntType, ASTContext &>
260 DependentBitIntTypes;
261 mutable llvm::FoldingSet BTFTagAttributedTypes;
262 llvm::FoldingSet HLSLAttributedResourceTypes;
263
264 mutable llvm::FoldingSet CountAttributedTypes;
265
266 mutable llvm::FoldingSet QualifiedTemplateNames;
267 mutable llvm::FoldingSet DependentTemplateNames;
268 mutable llvm::FoldingSet
269 SubstTemplateTemplateParms;
270 mutable llvm::ContextualFoldingSet<SubstTemplateTemplateParmPackStorage,
272 SubstTemplateTemplateParmPacks;
273 mutable llvm::ContextualFoldingSet<DeducedTemplateStorage, ASTContext &>
274 DeducedTemplates;
275
276 mutable llvm::ContextualFoldingSet<ArrayParameterType, ASTContext &>
277 ArrayParameterTypes;
278
279
280
281
282 mutable llvm::FoldingSet NestedNameSpecifiers;
284
285
286
287
288 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>
289 ASTRecordLayouts;
290 mutable llvm::DenseMap<const ObjCContainerDecl*, const ASTRecordLayout*>
291 ObjCLayouts;
292
293
294 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
295 mutable TypeInfoMap MemoizedTypeInfo;
296
297
298
299
300 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
301 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
302
303
304 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
305
306
307 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;
308
309
310
311 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;
312
313
314 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
315
316
317 mutable llvm::FoldingSet MSGuidDecls;
318
319
320 mutable llvm::FoldingSet
321 UnnamedGlobalConstantDecls;
322
323
324 mutable llvm::FoldingSet TemplateParamObjectDecls;
325
326
327
328
329
330 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
331
332
333
334
335
336
337
338 unsigned NextStringLiteralVersion = 0;
339
340
341
342 mutable std::string CUIDHash;
343
344
345
346 class CanonicalTemplateTemplateParm : public llvm::FoldingSetNode {
347 TemplateTemplateParmDecl *Parm;
348
349 public:
350 CanonicalTemplateTemplateParm(TemplateTemplateParmDecl *Parm)
351 : Parm(Parm) {}
352
353 TemplateTemplateParmDecl *getParam() const { return Parm; }
354
355 void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C) {
357 }
358
359 static void Profile(llvm::FoldingSetNodeID &ID,
360 const ASTContext &C,
361 TemplateTemplateParmDecl *Parm);
362 };
363 mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,
365 CanonTemplateTemplateParms;
366
367 TemplateTemplateParmDecl *
368 getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP) const;
369
370
371 mutable TypedefDecl *Int128Decl = nullptr;
372
373
374 mutable TypedefDecl *UInt128Decl = nullptr;
375
376
377
378 mutable TypedefDecl *BuiltinVaListDecl = nullptr;
379
380
381 mutable TypedefDecl *BuiltinMSVaListDecl = nullptr;
382
383
384 mutable TypedefDecl *ObjCIdDecl = nullptr;
385
386
387 mutable TypedefDecl *ObjCSelDecl = nullptr;
388
389
390 mutable TypedefDecl *ObjCClassDecl = nullptr;
391
392
393 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl = nullptr;
394
395
396 mutable TypedefDecl *BOOLDecl = nullptr;
397
398
399
400 QualType ObjCIdRedefinitionType;
401 QualType ObjCClassRedefinitionType;
402 QualType ObjCSelRedefinitionType;
403
404
405 mutable IdentifierInfo *BoolName = nullptr;
406
407
408 mutable IdentifierInfo *NSObjectName = nullptr;
409
410
411 IdentifierInfo *NSCopyingName = nullptr;
412
413
414 mutable IdentifierInfo *MakeIntegerSeqName = nullptr;
415
416
417 mutable IdentifierInfo *TypePackElementName = nullptr;
418
419
420 mutable IdentifierInfo *BuiltinCommonTypeName = nullptr;
421
422 QualType ObjCConstantStringType;
423 mutable RecordDecl *CFConstantStringTagDecl = nullptr;
424 mutable TypedefDecl *CFConstantStringTypeDecl = nullptr;
425
426 mutable QualType ObjCSuperType;
427
428 QualType ObjCNSStringType;
429
430
431 TypedefDecl *ObjCInstanceTypeDecl = nullptr;
432
433
434 TypeDecl *FILEDecl = nullptr;
435
436
437 TypeDecl *jmp_bufDecl = nullptr;
438
439
440 TypeDecl *sigjmp_bufDecl = nullptr;
441
442
443 TypeDecl *ucontext_tDecl = nullptr;
444
445
446
447
448
449 mutable RecordDecl *BlockDescriptorType = nullptr;
450
451
452
453
454
455 mutable RecordDecl *BlockDescriptorExtendedType = nullptr;
456
457
458 FunctionDecl *cudaConfigureCallDecl = nullptr;
459
460
461
462
463
464 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;
465
466
467
468
469 llvm::DenseMap<Decl*, Decl*> MergedDecls;
470
471
472
473
474 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;
475
476
477
478
479
480 struct PerModuleInitializers {
483
484 void resolve(ASTContext &Ctx);
485 };
486 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
487
488
489 Module *CurrentCXXNamedModule = nullptr;
490
491
492
493
494
495
496 llvm::StringMap<const Module *> PrimaryModuleNameMap;
497 llvm::DenseMap<const Module *, const Module *> SameModuleLookupSet;
498
499 static constexpr unsigned ConstantArrayTypesLog2InitSize = 8;
500 static constexpr unsigned GeneralTypesLog2InitSize = 9;
501 static constexpr unsigned FunctionProtoTypesLog2InitSize = 12;
502
503 ASTContext &this_() { return *this; }
504
505public:
506
508 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;
509
510private:
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>
549 TemplateOrInstantiation;
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;
575
576
577
578
579
580
581
582
583 llvm::DenseMap<UsingEnumDecl *, UsingEnumDecl *>
584 InstantiatedFromUsingEnumDecl;
585
586
587 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>
588 InstantiatedFromUsingShadowDecl;
589
590 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;
591
592
593
594
595
596
597
598 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;
599 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
600
601
602
603
604 llvm::DenseMap<const DeclContext *, std::unique_ptr>
605 MangleNumberingContexts;
606 llvm::DenseMap<const Decl *, std::unique_ptr>
607 ExtraMangleNumberingContexts;
608
609
610
611 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;
612 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;
613
614 mutable llvm::DenseMap<const CXXRecordDecl *, unsigned>
615 DeviceLambdaManglingNumbers;
616
617
618
619 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;
620 ParameterIndexTable ParamIndices;
621
622 ImportDecl *FirstLocalImport = nullptr;
623 ImportDecl *LastLocalImport = nullptr;
624
630
631
633
634
635
637
638
639
640 std::unique_ptr NoSanitizeL;
641
642
643
644 std::unique_ptr XRayFilter;
645
646
647
648 std::unique_ptr ProfList;
649
650
651
652
653
654 mutable llvm::BumpPtrAllocator BumpAlloc;
655
656
658
659
660 std::unique_ptr ABI;
662
663
664
665 bool AddrSpaceMapMangling;
666
667
668 mutable bool AnyFunctionEffects = false;
669
671 const TargetInfo *AuxTarget = nullptr;
673 std::unique_ptrinterp::Context InterpContext;
674 std::unique_ptr ParentMapCtx;
675
676
678
679public:
687
688
690
692
701 }
703 };
704
705
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
728
729
730
732
735 }
736
739 }
740
743
744
745
746
747
749
751 return BumpAlloc;
752 }
753
754 void *Allocate(size_t Size, unsigned Align = 8) const {
755 return BumpAlloc.Allocate(Size, Align);
756 }
757 template T *Allocate(size_t Num = 1) const {
758 return static_cast<T *>(Allocate(Num * sizeof(T), alignof(T)));
759 }
761
762 llvm::StringRef backupStr(llvm::StringRef S) const {
763 char *Buf = new (*this) char[S.size()];
764 std::copy(S.begin(), S.end(), Buf);
765 return llvm::StringRef(Buf, S.size());
766 }
767
768
769
771 if (DeclListNode *Alloc = ListNodeFreeList) {
772 ListNodeFreeList = Alloc->Rest.dyn_cast<DeclListNode*>();
773 Alloc->D = ND;
774 Alloc->Rest = nullptr;
775 return Alloc;
776 }
778 }
779
780
782 N->Rest = ListNodeFreeList;
783 ListNodeFreeList = N;
784 }
785
786
787
789 return BumpAlloc.getTotalMemory();
790 }
791
792
794
796 return DiagAllocator;
797 }
798
801
803 const auto *CurrentBT = cast(ElementType);
804 switch (CurrentBT->getKind()) {
805 case BuiltinType::Kind::Half:
806 case BuiltinType::Kind::Float16:
808 case BuiltinType::Kind::Float:
809 case BuiltinType::Kind::BFloat16:
811 case BuiltinType::Kind::Double:
813 default:
814 return ElementType;
815 }
816 return ElementType;
817 }
818
819
820
821
822
824 unsigned Signed) const;
825
826
827
828
831
833
835
836
837
838
839
841 return LangOpts.CPlusPlus || LangOpts.RecoveryAST;
842 }
843
845
848
850 return *XRayFilter;
851 }
852
854
856
859 }
860
861
862
863
865
866
868
869
871
872
873
874
875
876 mutable llvm::DenseMap<const Decl *, const RawComment *> DeclRawComments;
877
878
879
880
881
882
884
885
886
887
888
889
890
891
893
894
895
896 mutable llvm::DenseMap<const Decl *, comments::FullComment *> ParsedComments;
897
898
899
900
901
902
905
906
907
908
909
910
913 const std::map<unsigned, RawComment *> &CommentsInFile) const;
914
915
916
918
919public:
921
922
923
924
925
926
929 const Decl **OriginalDecl = nullptr) const;
930
931
932
933
934
935
936
937
940
941
942
943
944
945
948
949
950
951
953
956
957private:
959
960
961 class import_iterator {
963
964 public:
968 using difference_type = int;
969 using iterator_category = std::forward_iterator_tag;
970
971 import_iterator() = default;
972 explicit import_iterator(ImportDecl *Import) : Import(Import) {}
973
974 reference operator*() const { return Import; }
975 pointer operator->() const { return Import; }
976
977 import_iterator &operator++() {
979 return *this;
980 }
981
982 import_iterator operator++(int) {
983 import_iterator Other(*this);
984 ++(*this);
986 }
987
988 friend bool operator==(import_iterator X, import_iterator Y) {
989 return X.Import == Y.Import;
990 }
991
992 friend bool operator!=(import_iterator X, import_iterator Y) {
993 return X.Import != Y.Import;
994 }
995 };
996
997public:
999 return CommentCommandTraits;
1000 }
1001
1002
1004
1005
1007
1008
1009
1010
1011
1014
1015
1016
1020
1023
1026
1027
1028
1030
1031
1032
1034
1035
1036
1038
1039
1040
1043
1047
1049
1051
1052
1056
1059
1061
1063 llvm::iterator_range<overridden_cxx_method_iterator>;
1064
1066
1067
1068
1071
1072
1073
1074
1075
1076
1077
1078
1082
1083
1084
1086
1088 return Import->getNextLocalImport();
1089 }
1090
1092
1094 return import_range(import_iterator(FirstLocalImport), import_iterator());
1095 }
1096
1100 }
1102 MergedDecls[D] = Primary;
1103 }
1104
1105
1106
1108 bool NotifyListeners = true);
1109
1110
1111
1113
1114
1115
1117
1118
1119
1120
1121
1123
1125
1126
1128
1129
1131
1132
1134
1135
1136
1137
1138
1140
1143 }
1147 if (TraversalScope.empty() || TraversalScope.back() == TUDecl)
1148 TraversalScope = {NewTUDecl};
1149 if (TUDecl)
1151 TUDecl = NewTUDecl;
1152 }
1153
1158
1159
1194#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1195 CanQualType SingletonId;
1196#include "clang/Basic/OpenCLImageTypes.def"
1202#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1203 CanQualType Id##Ty;
1204#include "clang/Basic/OpenCLExtensionTypes.def"
1205#define SVE_TYPE(Name, Id, SingletonId) \
1206 CanQualType SingletonId;
1207#include "clang/Basic/AArch64SVEACLETypes.def"
1208#define PPC_VECTOR_TYPE(Name, Id, Size) \
1209 CanQualType Id##Ty;
1210#include "clang/Basic/PPCTypes.def"
1211#define RVV_TYPE(Name, Id, SingletonId) \
1212 CanQualType SingletonId;
1213#include "clang/Basic/RISCVVTypes.def"
1214#define WASM_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1215#include "clang/Basic/WebAssemblyReferenceTypes.def"
1216#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \
1217 CanQualType SingletonId;
1218#include "clang/Basic/AMDGPUTypes.def"
1219#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) CanQualType SingletonId;
1220#include "clang/Basic/HLSLIntangibleTypes.def"
1221
1222
1225
1226
1227
1229
1230
1232
1233
1234
1235
1236
1238
1239
1240
1242
1243
1244
1246
1247
1248
1249
1250 llvm::DenseMap<CanQualType, SYCLKernelInfo> SYCLKernels;
1251
1252
1253
1254
1255
1257
1264
1265
1266
1267
1268
1269
1271
1272
1273
1276 }
1277
1278
1279
1280
1281
1282
1285 }
1286
1287
1288
1290
1293
1296
1297
1298
1300 StringRef Name,
1302
1303
1305
1306
1308
1309
1311
1312
1313
1314
1315
1316private:
1317
1319
1321
1323
1324public:
1325
1326
1327
1328
1329
1330
1332
1333
1334
1335
1336
1337
1339
1340
1341
1342 uint16_t
1344
1345
1347
1348
1349
1350
1351
1354 bool allowOnPointerType = false) const;
1355
1356
1357
1358
1359
1360
1362
1363
1364
1366
1367
1368
1369
1370
1371
1374 }
1375
1376
1377
1378
1379
1380
1383 }
1384
1385
1386
1387
1388
1389
1390
1391
1393
1394
1395
1396
1399
1400
1403
1404
1405
1408
1409
1411
1412
1414
1415
1416
1417
1418
1421
1422
1423
1425
1426
1427
1430 bool AsWritten = false);
1431
1432
1433
1434
1436
1437
1438
1440
1441
1442
1444
1445
1446
1448
1449
1450
1454 }
1455
1456
1457
1461 }
1462
1465 bool OrNull,
1467
1468
1469
1474 }
1475
1476
1477
1478
1482 }
1483
1484
1486
1487
1488
1490
1491
1492
1494
1495
1496
1498
1499
1500
1502
1503
1505
1506
1508
1509
1510
1512
1513
1514
1516
1517
1518
1520
1521
1523
1524
1526
1527
1531 }
1532
1534 cudaConfigureCallDecl = FD;
1535 }
1536
1538 return cudaConfigureCallDecl;
1539 }
1540
1541
1543
1544
1545
1546
1549 bool &HasByrefExtendedLayout) const;
1550
1551
1552
1554 const;
1555
1556
1557
1559
1560
1561
1562
1563
1565
1566
1567
1571
1572
1573
1574
1575
1576
1579 unsigned IndexTypeQuals,
1581
1582
1583
1585 unsigned IndexTypeQuals) const;
1586
1587
1588
1591 unsigned IndexTypeQuals) const;
1592
1593
1594
1596
1597
1599
1600
1608 };
1609
1610
1611
1612 BuiltinVectorTypeInfo
1614
1615
1616
1617
1618
1619
1620
1622 unsigned NumFields = 1) const;
1623
1624
1626
1627
1628
1629
1630
1633
1634
1638
1639
1640
1641
1642
1644
1645
1646
1647
1648
1649
1651 Expr *SizeExpr,
1653
1654
1655
1656
1657
1658
1660 unsigned NumColumns) const;
1661
1662
1663
1665 Expr *ColumnExpr,
1667
1669 Expr *AddrSpaceExpr,
1671
1672
1675
1678 }
1679
1680
1683 return getFunctionTypeInternal(ResultTy, Args, EPI, false);
1684 }
1685
1687
1688private:
1689
1692 bool OnlyWantCanonical) const;
1695 bool IsDependent, bool IsPack = false,
1696 ConceptDecl *TypeConstraintConcept = nullptr,
1698 bool IsCanon = false) const;
1699
1700public:
1701
1702
1704 const TypeDecl *PrevDecl = nullptr) const {
1705 assert(Decl && "Passed null for Decl param");
1706 if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0);
1707
1708 if (PrevDecl) {
1709 assert(PrevDecl->TypeForDecl && "previous decl has no TypeForDecl");
1710 Decl->TypeForDecl = PrevDecl->TypeForDecl;
1711 return QualType(PrevDecl->TypeForDecl, 0);
1712 }
1713
1714 return getTypeDeclTypeSlow(Decl);
1715 }
1716
1719
1720
1721
1724
1726
1728
1729
1730
1731
1733 unsigned NumPositiveBits, QualType &BestType,
1734 QualType &BestPromotionType);
1735
1738
1740
1743 const Attr *attr = nullptr) const;
1744
1746 QualType equivalentType) const;
1747
1750
1753
1757
1760 unsigned Index,
1761 std::optional PackIndex,
1765 unsigned Index, bool Final,
1767
1770 bool ParameterPack,
1772
1776
1780
1784
1789
1791
1794
1797 TagDecl *OwnedTagDecl = nullptr) const;
1802
1809
1811
1812
1813
1814
1815
1816
1817
1818
1820 std::optional NumExpansions,
1821 bool ExpectPackInType = true) const;
1822
1825
1826
1829 unsigned NumProtocols) const;
1830
1834 bool isKindOf) const;
1835
1840
1842
1843
1844
1845
1848
1849
1851
1852
1855
1857
1858
1860
1862 bool FullySubstituted = false,
1864 int Index = -1) const;
1865
1866
1869
1870
1872 bool IsDependent, bool IsPack = false,
1873 ConceptDecl *TypeConstraintConcept = nullptr,
1874 ArrayRef TypeConstraintArgs ={}) const;
1875
1876
1878
1879
1881
1882
1883
1885
1886
1888 QualType DeducedType,
1889 bool IsDependent) const;
1890
1891private:
1892 QualType getDeducedTemplateSpecializationTypeInternal(TemplateName Template,
1893 QualType DeducedType,
1894 bool IsDependent,
1895 QualType Canon) const;
1896
1897public:
1898
1899
1901
1902
1903
1904
1905
1907
1908
1909
1911
1912
1913
1915
1916
1917
1919
1920
1921
1923
1924
1925
1926
1928
1929
1930
1931
1933
1934
1935
1936
1938
1939
1940
1942
1943
1944
1946
1947
1948
1950
1951
1952
1954
1955
1956
1957
1959
1960
1961
1963
1964
1966
1967
1970
1971
1972
1974 if (CFConstantStringTypeDecl)
1977 }
1981
1982
1985 return ObjCConstantStringType;
1986 }
1987
1989 return ObjCNSStringType;
1990 }
1991
1993 ObjCNSStringType = T;
1994 }
1995
1996
1997
1999 if (ObjCIdRedefinitionType.isNull())
2001 return ObjCIdRedefinitionType;
2002 }
2003
2004
2006 ObjCIdRedefinitionType = RedefType;
2007 }
2008
2009
2010
2012 if (ObjCClassRedefinitionType.isNull())
2014 return ObjCClassRedefinitionType;
2015 }
2016
2017
2019 ObjCClassRedefinitionType = RedefType;
2020 }
2021
2022
2023
2025 if (ObjCSelRedefinitionType.isNull())
2027 return ObjCSelRedefinitionType;
2028 }
2029
2030
2032 ObjCSelRedefinitionType = RedefType;
2033 }
2034
2035
2037 if (!NSObjectName) {
2038 NSObjectName = &Idents.get("NSObject");
2039 }
2040
2041 return NSObjectName;
2042 }
2043
2044
2046 if (!NSCopyingName) {
2047 NSCopyingName = &Idents.get("NSCopying");
2048 }
2049
2050 return NSCopyingName;
2051 }
2052
2054
2056
2057
2059 if (!BoolName)
2061 return BoolName;
2062 }
2063
2065 if (!MakeIntegerSeqName)
2066 MakeIntegerSeqName = &Idents.get("__make_integer_seq");
2067 return MakeIntegerSeqName;
2068 }
2069
2071 if (!TypePackElementName)
2072 TypePackElementName = &Idents.get("__type_pack_element");
2073 return TypePackElementName;
2074 }
2075
2077 if (!BuiltinCommonTypeName)
2078 BuiltinCommonTypeName = &Idents.get("__builtin_common_type");
2079 return BuiltinCommonTypeName;
2080 }
2081
2082
2083
2086 }
2087
2088
2089
2091
2092
2094
2095
2097 if (FILEDecl)
2100 }
2101
2102
2104 this->jmp_bufDecl = jmp_bufDecl;
2105 }
2106
2107
2109 if (jmp_bufDecl)
2112 }
2113
2114
2116 this->sigjmp_bufDecl = sigjmp_bufDecl;
2117 }
2118
2119
2121 if (sigjmp_bufDecl)
2124 }
2125
2126
2128 this->ucontext_tDecl = ucontext_tDecl;
2129 }
2130
2131
2133 if (ucontext_tDecl)
2136 }
2137
2138
2141 }
2142
2143
2144
2145
2146
2149 QualType *NotEncodedT=nullptr) const;
2150
2151
2152
2154
2156
2157
2159 std::string &S) const;
2160
2161
2162
2163
2164
2165
2166
2168
2169
2170
2172 bool Extended = false) const;
2173
2174
2176
2177
2178
2179
2180
2182 const Decl *Container) const;
2183
2186
2189 const Decl *Container) const;
2190
2191
2192
2194
2195
2196
2198
2199
2200
2201
2202
2205 }
2206
2207
2208
2210
2211
2212
2215 }
2216
2217
2218
2220
2221
2222
2223
2224
2227 }
2228
2229
2230
2232
2233
2235 return BOOLDecl;
2236 }
2237
2238
2240 BOOLDecl = TD;
2241 }
2242
2243
2246 }
2247
2248
2251 }
2252
2253
2254
2256
2257
2260 }
2261
2262
2263
2264
2266
2267
2268
2270
2271
2274 }
2275
2276
2278
2279
2281 assert(MSGuidTagDecl && "asked for GUID type but MS extensions disabled");
2283 }
2284
2285
2286
2288
2289
2290
2293 }
2294
2295
2298 }
2299
2300
2306 return getExtQualType(Ptr, Qc);
2307 }
2308
2309
2313 return getExtQualType(T, Qs);
2314 }
2315
2316
2317
2318
2323
2327 }
2328
2329
2330
2332 if (.getTypePtr()->isObjCObjectPointerType() ||
2333 .getQualifiers().hasObjCLifetime())
2334 return type;
2338 }
2339
2340
2343 assert(PointerAuth);
2344
2348 }
2349
2355
2358
2362
2364 bool TemplateKeyword,
2366
2373 unsigned Index,
2374 std::optional PackIndex) const;
2376 Decl *AssociatedDecl,
2377 unsigned Index,
2378 bool Final) const;
2379
2380
2381
2382
2383
2384
2385
2388
2390
2392
2393
2395
2396
2398
2399
2401
2402
2405
2408 bool &RequireICE, bool AllowTypeModifiers) const;
2409
2410
2411
2412
2413
2414
2416 unsigned *IntegerConstantArgs = nullptr) const;
2417
2418
2419
2421
2422private:
2425
2426
2427
2428
2429
2430public:
2431
2432
2434
2435
2436
2437
2438
2439
2441
2442
2443
2444
2446
2447
2448
2450
2451
2452
2453
2455
2456
2457
2458
2459
2461
2462
2463
2464
2466
2467
2468
2471 }
2472
2473
2474
2475
2476
2477
2478
2480
2481
2484
2485
2487
2488
2491
2492
2495 }
2496
2497
2499
2500
2502
2503
2504
2507
2510 return std::nullopt;
2512 }
2513
2516 }
2517
2518
2519
2522
2523
2524
2525
2526
2527
2530 }
2532
2533
2534
2535
2536
2537
2539 bool NeedsPreferredAlignment = false) const;
2540
2541
2542
2545
2546
2547
2550 }
2551
2552
2553
2554
2557
2558
2559
2561
2564
2565
2566
2569
2570
2572
2573
2574
2575
2576
2577
2578
2579
2582 }
2584
2585
2586
2588
2589
2590
2591
2593
2594
2595
2596
2598
2599
2600
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2614
2615
2616
2617
2619
2620
2621
2622
2624
2625
2626
2628 const;
2629
2631 bool Simple = false) const;
2632
2633
2634
2635
2636
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2651
2652
2653
2654
2655
2656
2657
2658
2659
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2672
2673
2675
2676
2680
2681
2682
2684
2686
2688
2689
2691
2692
2693
2694
2695
2697
2700
2704
2705
2706
2707 bool
2709 bool CheckIfTriviallyCopyable = true) const;
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2725 }
2726
2729 }
2730
2731
2732
2733
2734
2735
2737
2738
2741 }
2744 }
2745
2746
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2766 }
2767
2768
2769
2773 }
2774
2776 bool IsParam) const {
2779 if (SubTnullability.has_value() == SuperTnullability.has_value()) {
2780
2781 if (!SubTnullability)
2782 return true;
2783
2784 if (*SubTnullability == *SuperTnullability ||
2787 return true;
2788
2789 if (IsParam) {
2790
2791
2794 }
2795
2796
2799 }
2800 return true;
2801 }
2802
2805
2807 bool AllowPiMismatch = true) const;
2809 bool AllowPiMismatch = true) const;
2810
2811
2812
2813
2814
2815
2816
2817
2819
2820
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2848
2849
2851 bool IsCXXMethod,
2852 bool IsBuiltin = false) const;
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2873 bool IgnoreDeduced = false) const;
2874
2875
2876
2878 bool IgnoreDeduced = false) const;
2879
2880
2882
2883
2884
2887
2888
2889
2891
2892
2893
2894
2895
2896
2898
2899
2900
2903
2904
2905
2908
2909
2910
2911
2912
2913
2915 const;
2916
2917
2918
2919
2920
2923 return dyn_cast_or_null(getAsArrayType(T));
2924 }
2926 return dyn_cast_or_null(getAsArrayType(T));
2927 }
2929 return dyn_cast_or_null(getAsArrayType(T));
2930 }
2932 const {
2933 return dyn_cast_or_null(getAsArrayType(T));
2934 }
2935
2936
2937
2938
2940
2941
2942
2944
2945
2947
2948
2949 uint64_t
2951
2952
2953
2954
2955
2956
2958
2959
2960
2961
2963
2965
2966
2967
2968
2969
2970
2971
2972
2973
2975
2976
2977
2979
2980
2981
2983
2984
2985
2986
2987
2988
2990
2991
2992
2993
2994
2996
2997
2998
2999
3000
3001
3003
3004
3005
3006
3008
3010
3012
3013
3014
3016
3019 }
3020
3022
3023
3024
3025
3030 bool AcceptDependent);
3031
3032
3033
3034
3035
3036
3039
3040private:
3041
3042 unsigned getIntegerRank(const Type *T) const;
3043
3044public:
3045
3046
3047
3048
3049
3051 bool CompareUnqualified = false);
3052
3055
3057 if (const auto *ET = dyn_cast(T))
3058 T = ET->getNamedType();
3060 }
3061
3063 if (const auto *ET = dyn_cast(T))
3064 T = ET->getNamedType();
3066 }
3067
3069 if (const auto *ET = dyn_cast(T))
3070 T = ET->getNamedType();
3072 }
3073
3076 bool ForCompare);
3077
3080
3081
3089 bool BlockReturnType);
3094
3095
3097 bool Unqualified = false, bool BlockReturnType = false,
3098 bool IsConditionalOperator = false);
3100 bool Unqualified = false, bool AllowCXX = false,
3101 bool IsConditionalOperator = false);
3103 bool OfBlockPointer = false,
3106 bool OfBlockPointer=false,
3108
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3133 bool &CanUseFirst, bool &CanUseSecond,
3135
3137
3138
3139
3140
3141
3142
3143
3145
3146
3147
3148
3149
3150
3151
3153
3154
3155
3156
3157
3158
3159
3161
3162
3163
3165
3166
3167
3169
3170
3171
3172
3173
3175
3176
3177
3178
3179
3180
3181
3183
3184
3188 if (Width != Res.getBitWidth())
3189 return Res.extOrTrunc(Width);
3190 return Res;
3191 }
3192
3194
3195
3196
3198
3199
3200
3202
3203
3205 return !ObjCImpls.empty();
3206 }
3207
3208
3211
3212
3215
3216
3217
3220
3223
3224
3225
3226
3228
3229
3230
3232
3233
3234
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3249
3250
3251
3252
3256
3257
3258
3259
3260
3261
3262
3263
3265
3266
3267
3269 if (!std::is_trivially_destructible::value) {
3270 auto DestroyPtr = [](void *V) { static_cast<T *>(V)->~T(); };
3272 }
3273 }
3274
3277
3278
3279
3280
3281
3282
3283
3285
3286
3287
3290 llvm::function_ref<void(FunctionDecl *)> Pred) const;
3291
3294
3297
3299
3301
3303
3305
3308 bool ForAuxTarget = false) const;
3309
3312
3313
3314
3319
3321
3322
3323
3325
3326
3327
3329
3330
3331
3332
3334
3335
3336
3338
3339
3340
3342
3343
3344
3347
3348
3349
3352
3353
3354
3356
3361
3362
3363
3364
3365
3366
3367
3369
3370
3371
3372
3374
3375
3376
3377
3379
3380
3381
3382
3383
3384
3386
3387
3388
3390
3391
3393
3394
3395
3397
3398
3400
3401
3402
3404
3405
3407
3408
3409
3411
3412
3414
3415
3416
3418
3419
3421
3422
3423
3425
3426public:
3427
3428
3429
3430
3431
3432
3434 const TargetInfo *AuxTarget = nullptr);
3435
3436private:
3438
3439 class ObjCEncOptions {
3440 unsigned Bits;
3441
3442 ObjCEncOptions(unsigned Bits) : Bits(Bits) {}
3443
3444 public:
3445 ObjCEncOptions() : Bits(0) {}
3446
3447#define OPT_LIST(V) \
3448 V(ExpandPointedToStructures, 0) \
3449 V(ExpandStructures, 1) \
3450 V(IsOutermostType, 2) \
3451 V(EncodingProperty, 3) \
3452 V(IsStructField, 4) \
3453 V(EncodeBlockParameters, 5) \
3454 V(EncodeClassNames, 6) \
3455
3456#define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
3458#undef V
3459
3460#define V(N,I) bool N() const { return Bits & 1 << I; }
3462#undef V
3463
3464#undef OPT_LIST
3465
3466 [[nodiscard]] ObjCEncOptions keepingOnly(ObjCEncOptions Mask) const {
3467 return Bits & Mask.Bits;
3468 }
3469
3470 [[nodiscard]] ObjCEncOptions forComponentType() const {
3471 ObjCEncOptions Mask = ObjCEncOptions()
3472 .setIsOutermostType()
3473 .setIsStructField();
3474 return Bits & ~Mask.Bits;
3475 }
3476 };
3477
3478
3479 void getObjCEncodingForTypeImpl(QualType t, std::string &S,
3480 ObjCEncOptions Options,
3481 const FieldDecl *Field,
3482 QualType *NotEncodedT = nullptr) const;
3483
3484
3485 void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
3486 const FieldDecl *Field,
3487 bool includeVBases = true,
3488 QualType *NotEncodedT=nullptr) const;
3489
3490public:
3491
3493 QualType T, std::string& S,
3494 bool Extended) const;
3495
3496
3497
3499
3501
3503
3504
3506
3507
3509
3510
3512 };
3513
3514
3515
3516
3517
3518
3521
3522private:
3525
3529
3530
3531
3532
3533
3534
3535
3536
3537
3541
3542
3543
3544
3545 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;
3546
3547 std::vector<Decl *> TraversalScope;
3548
3549 std::unique_ptr VTContext;
3550
3551 void ReleaseDeclContextMaps();
3552
3553public:
3562 };
3563
3568
3574 };
3575
3577
3578
3580
3581
3583
3584
3586
3587
3588
3592 StringRef MangledName);
3593
3595
3596private:
3597
3598
3600
3601 llvm::DenseMap<GlobalDecl, llvm::StringSet<>> ThunksToBeAbbreviated;
3602};
3603
3604
3607
3608
3612}
3613
3614
3618}
3619
3620}
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3653 size_t Alignment ) {
3654 return C.Allocate(Bytes, Alignment);
3655}
3656
3657
3658
3659
3660
3661
3662
3664 C.Deallocate(Ptr);
3665}
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3691 size_t Alignment ) {
3692 return C.Allocate(Bytes, Alignment);
3693}
3694
3695
3696
3697
3698
3699
3700
3702 C.Deallocate(Ptr);
3703}
3704
3705
3706template <typename Owner, typename T,
3711
3712
3713
3717}
3718
3719#endif
Forward declaration of all AST node types.
static bool CanThrow(Expr *E, ASTContext &Ctx)
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
enum clang::sema::@1725::IndirectLocalPathEntry::EntryKind Kind
static CGCXXABI * createCXXABI(CodeGenModule &CGM)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::Target Target
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
This file declares types used to describe SYCL kernels.
Defines the clang::SourceLocation class and associated facilities.
#define CXXABI(Name, Str)
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 ...
bool getByrefLifetime(QualType Ty, Qualifiers::ObjCLifetime &Lifetime, bool &HasByrefExtendedLayout) const
Returns true, if given type has a known lifetime.
MSGuidDecl * getMSGuidDecl(MSGuidDeclParts Parts) const
Return a declaration for the global GUID object representing the given GUID value.
QualType getUsingType(const UsingShadowDecl *Found, QualType Underlying) const
BuiltinVectorTypeInfo getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const
Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector...
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, const ObjCMethodDecl *MethodImp)
CanQualType ObjCBuiltinSelTy
SourceManager & getSourceManager()
TranslationUnitDecl * getTranslationUnitDecl() const
const ConstantArrayType * getAsConstantArrayType(QualType T) const
CanQualType getCanonicalFunctionResultType(QualType ResultType) const
Adjust the given function result type.
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
bool areLaxCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible SVE vector types, false otherwise.
llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo
A type synonym for the TemplateOrInstantiation mapping.
LangAS getOpenCLTypeAddrSpace(const Type *T) const
Get address space for OpenCL type.
CharUnits getTypeAlignInChars(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in characters.
void InitBuiltinTypes(const TargetInfo &Target, const TargetInfo *AuxTarget=nullptr)
Initialize built-in types.
ParentMapContext & getParentMapContext()
Returns the dynamic AST node parent map context.
QualType getParenType(QualType NamedType) const
size_t getSideTableAllocatedMemory() const
Return the total memory used for various side tables.
MemberSpecializationInfo * getInstantiatedFromStaticDataMember(const VarDecl *Var)
If this variable is an instantiated static data member of a class template specialization,...
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
CanQualType ARCUnbridgedCastTy
uint64_t getTypeSize(const Type *T) const
QualType getDependentSizedMatrixType(QualType ElementType, Expr *RowExpr, Expr *ColumnExpr, SourceLocation AttrLoc) const
Return the unique reference to the matrix type of the specified element type and size.
QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr, QualType Wrapped) const
llvm::DenseMap< const Decl *, comments::FullComment * > ParsedComments
Mapping from declarations to parsed comments attached to any redeclaration.
BuiltinTemplateDecl * getBuiltinCommonTypeDecl() const
unsigned getManglingNumber(const NamedDecl *ND, bool ForAuxTarget=false) const
const SmallVectorImpl< Type * > & getTypes() const
unsigned getIntWidth(QualType T) const
CanQualType getCanonicalParamType(QualType T) const
Return the canonical parameter type corresponding to the specific potentially non-canonical one.
const FunctionType * adjustFunctionType(const FunctionType *Fn, FunctionType::ExtInfo EInfo)
Change the ExtInfo on a function type.
TemplateOrSpecializationInfo getTemplateOrSpecializationInfo(const VarDecl *Var)
InlineVariableDefinitionKind
@ None
Not an inline variable.
@ Weak
Weak definition of inline variable.
@ Strong
Strong definition.
@ WeakUnknown
Weak for now, might become strong later in this TU.
const ProfileList & getProfileList() const
void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)
TypedefDecl * getObjCClassDecl() const
Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.
TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)
TypedefDecl * getCFConstantStringDecl() const
CanQualType SatUnsignedFractTy
CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const
BuiltinTemplateDecl * getMakeIntegerSeqDecl() const
void setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern)
Remember that the using decl Inst is an instantiation of the using decl Pattern of a class template.
bool areCompatibleRVVTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an RISC-V vector builtin type and a VectorType that is a fixed-len...
ExternCContextDecl * getExternCContextDecl() const
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
ParsedTargetAttr filterFunctionTargetAttrs(const TargetAttr *TD) const
Parses the target attributes passed in, and returns only the ones that are valid feature names.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
TypedefDecl * getObjCSelDecl() const
Retrieve the typedef corresponding to the predefined 'SEL' type in Objective-C.
llvm::iterator_range< import_iterator > import_range
bool AnyObjCImplementation()
Return true if there is at least one @implementation in the TU.
CanQualType UnsignedShortAccumTy
TypedefDecl * getObjCInstanceTypeDecl()
Retrieve the typedef declaration corresponding to the Objective-C "instancetype" type.
uint64_t getFieldOffset(const ValueDecl *FD) const
Get the offset of a FieldDecl or IndirectFieldDecl, in bits.
void DeallocateDeclListNode(DeclListNode *N)
Deallcates a DeclListNode by returning it to the ListNodeFreeList pool.
DeclListNode * AllocateDeclListNode(clang::NamedDecl *ND)
Allocates a DeclListNode or returns one from the ListNodeFreeList pool.
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef< TemplateArgumentLoc > Args) const
QualType adjustFunctionResultType(QualType FunctionType, QualType NewResultType)
Change the result type of a function type, preserving sugar such as attributed types.
void setTemplateOrSpecializationInfo(VarDecl *Inst, TemplateOrSpecializationInfo TSI)
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
TypedefDecl * buildImplicitTypedef(QualType T, StringRef Name) const
Create a new implicit TU-level typedef declaration.
unsigned getTypeAlign(const Type *T) const
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
void adjustObjCTypeParamBoundType(const ObjCTypeParamDecl *Orig, ObjCTypeParamDecl *New) const
llvm::StringMap< SectionInfo > SectionInfos
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
QualType getAutoRRefDeductType() const
C++11 deduction pattern for 'auto &&' type.
TypedefDecl * getBuiltinMSVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_ms_va_list type.
bool ObjCQualifiedIdTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS, bool ForCompare)
ObjCQualifiedIdTypesAreCompatible - We know that one of lhs/rhs is an ObjCQualifiedIDType.
QualType getTagDeclType(const TagDecl *Decl) const
Return the unique reference to the type for the specified TagDecl (struct/union/class/enum) decl.
QualType getMemberPointerType(QualType T, const Type *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
QualType getBuiltinVaListType() const
Retrieve the type of the __builtin_va_list type.
QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool AllowCXX=false, bool IsConditionalOperator=false)
NamedDecl * getInstantiatedFromUsingDecl(NamedDecl *Inst)
If the given using decl Inst is an instantiation of another (possibly unresolved) using decl,...
DeclarationNameTable DeclarationNames
comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const
QualType getUnresolvedUsingType(const UnresolvedUsingTypenameDecl *Decl) const
CharUnits getObjCEncodingTypeSize(QualType T) const
Return the size of type T for Objective-C encoding purpose, in characters.
int getIntegerTypeOrder(QualType LHS, QualType RHS) const
Return the highest ranked integer type, see C99 6.3.1.8p1.
QualType getObjCClassType() const
Represents the Objective-C Class type.
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType, const Attr *attr=nullptr) const
TypedefDecl * getObjCIdDecl() const
Retrieve the typedef corresponding to the predefined id type in Objective-C.
void setCurrentNamedModule(Module *M)
Set the (C++20) module we are building.
QualType getRawCFConstantStringType() const
Get the structure type used to representation CFStrings, or NULL if it hasn't yet been built.
QualType getProcessIDType() const
Return the unique type for "pid_t" defined in <sys/types.h>.
CharUnits getMemberPointerPathAdjustment(const APValue &MP) const
Find the 'this' offset for the member path in a pointer-to-member APValue.
bool mayExternalize(const Decl *D) const
Whether a C++ static variable or CUDA/HIP kernel may be externalized.
QualType getTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon=QualType()) const
std::unique_ptr< MangleNumberingContext > createMangleNumberingContext() const
QualType getUnsignedPointerDiffType() const
Return the unique unsigned counterpart of "ptrdiff_t" integer type.
QualType getucontext_tType() const
Retrieve the C ucontext_t type.
QualType getRecordType(const RecordDecl *Decl) const
std::optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const
QualType getScalableVectorType(QualType EltTy, unsigned NumElts, unsigned NumFields=1) const
Return the unique reference to a scalable vector type of the specified element type and scalable numb...
bool hasSameExpr(const Expr *X, const Expr *Y) const
Determine whether the given expressions X and Y are equivalent.
void getObjCEncodingForType(QualType T, std::string &S, const FieldDecl *Field=nullptr, QualType *NotEncodedT=nullptr) const
Emit the Objective-CC type encoding for the given type T into S.
QualType getBuiltinMSVaListType() const
Retrieve the type of the __builtin_ms_va_list type.
MangleContext * createMangleContext(const TargetInfo *T=nullptr)
If T is null pointer, assume the target in ASTContext.
QualType getRealTypeForBitwidth(unsigned DestWidth, FloatModeKind ExplicitType) const
getRealTypeForBitwidth - sets floating point QualTy according to specified bitwidth.
QualType getInjectedClassNameType(CXXRecordDecl *Decl, QualType TST) const
getInjectedClassNameType - Return the unique reference to the injected class name type for the specif...
QualType getVariableArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a variable array of the specified element type.
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
IdentifierInfo * getBuiltinCommonTypeName() const
unsigned NumImplicitCopyAssignmentOperatorsDeclared
The number of implicitly-declared copy assignment operators for which declarations were built.
uint64_t getTargetNullPointerValue(QualType QT) const
Get target-dependent integer value for null pointer which is used for constant folding.
unsigned getTypeUnadjustedAlign(QualType T) const
Return the ABI-specified natural alignment of a (complete) type T, before alignment adjustments,...
unsigned char getFixedPointIBits(QualType Ty) const
QualType getCorrespondingSignedFixedPointType(QualType Ty) const
IntrusiveRefCntPtr< ExternalASTSource > ExternalSource
QualType getArrayParameterType(QualType Ty) const
Return the uniqued reference to a specified array parameter type from the original array type.
QualType getCountAttributedType(QualType T, Expr *CountExpr, bool CountInBytes, bool OrNull, ArrayRef< TypeCoupledDeclRefInfo > DependentDecls) const
void setObjCIdRedefinitionType(QualType RedefType)
Set the user-written type that redefines id.
bool isObjCIdType(QualType T) const
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D,...
DynTypedNodeList getParents(const NodeT &Node)
Forwards to get node parents from the ParentMapContext.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
unsigned NumImplicitDestructorsDeclared
The number of implicitly-declared destructors for which declarations were built.
bool isObjCClassType(QualType T) const
void setObjCNSStringType(QualType T)
bool mergeExtParameterInfo(const FunctionProtoType *FirstFnType, const FunctionProtoType *SecondFnType, bool &CanUseFirst, bool &CanUseSecond, SmallVectorImpl< FunctionProtoType::ExtParameterInfo > &NewParamInfos)
This function merges the ExtParameterInfo lists of two functions.
bool ObjCQualifiedClassTypesAreCompatible(const ObjCObjectPointerType *LHS, const ObjCObjectPointerType *RHS)
ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and Class<pr1, ...>.
bool shouldExternalize(const Decl *D) const
Whether a C++ static variable or CUDA/HIP kernel should be externalized.
FullSourceLoc getFullLoc(SourceLocation Loc) const
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
bool propertyTypesAreCompatible(QualType, QualType)
void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateName Template) const
Retrieve the template name that represents a qualified template name such as std::vector.
QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc, VectorKind VecKind) const
Return the unique reference to the type for a dependently sized vector of the specified element type.
comments::CommandTraits & getCommentCommandTraits() const
CanQualType SatLongAccumTy
const XRayFunctionFilter & getXRayFilter() const
CanQualType getIntMaxType() const
Return the unique type for "intmax_t" (C99 7.18.1.5), defined in <stdint.h>.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
OpenCLTypeKind getOpenCLTypeKind(const Type *T) const
Map an AST Type to an OpenCLTypeKind enum value.
QualType getFILEType() const
Retrieve the C FILE type.
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
void getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT, std::string &S) const
Put the string version of the type qualifiers QT into S.
unsigned getPreferredTypeAlign(QualType T) const
Return the "preferred" alignment of the specified type T for the current target, in bits.
void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl)
Set the type for the C sigjmp_buf type.
std::string getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, bool Extended=false) const
Emit the encoded type for the method declaration Decl into S.
void DumpRecordLayout(const RecordDecl *RD, raw_ostream &OS, bool Simple=false) const
bool DeclMustBeEmitted(const Decl *D)
Determines if the decl can be CodeGen'ed or deserialized from PCH lazily, only when used; this is onl...
CanQualType OMPArrayShapingTy
ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)
QualType getReadPipeType(QualType T) const
Return a read_only pipe type for the specified type.
std::string getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
getObjCEncodingForPropertyDecl - Return the encoded type for this method declaration.
TemplateName getCanonicalTemplateName(TemplateName Name, bool IgnoreDeduced=false) const
Retrieves the "canonical" template name that refers to a given template.
unsigned getStaticLocalNumber(const VarDecl *VD) const
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
void addComment(const RawComment &RC)
void getLegacyIntegralTypeEncoding(QualType &t) const
getLegacyIntegralTypeEncoding - Another legacy compatibility encoding: 32-bit longs are encoded as 'l...
bool isSameTypeConstraint(const TypeConstraint *XTC, const TypeConstraint *YTC) const
Determine whether two type contraint are similar enough that they could used in declarations of the s...
CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod, bool IsBuiltin=false) const
Retrieves the default calling convention for the current target.
RecordDecl * buildImplicitRecord(StringRef Name, RecordDecl::TagKind TK=RecordDecl::TagKind::Struct) const
Create a new implicit TU-level CXXRecordDecl or RecordDecl declaration.
void setObjCSelRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
void setFILEDecl(TypeDecl *FILEDecl)
Set the type for the C FILE type.
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex, SubstTemplateTypeParmTypeFlag Flag=SubstTemplateTypeParmTypeFlag::None) const
Retrieve a substitution-result type.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
QualType getMSGuidType() const
Retrieve the implicitly-predeclared 'struct _GUID' type.
const CXXMethodDecl * getCurrentKeyFunction(const CXXRecordDecl *RD)
Get our current best idea for the key function of the given record decl, or nullptr if there isn't on...
const ASTRecordLayout & getASTObjCImplementationLayout(const ObjCImplementationDecl *D) const
Get or compute information about the layout of the specified Objective-C implementation.
CanQualType UnsignedLongFractTy
QualType getEnumType(const EnumDecl *Decl) const
overridden_method_range overridden_methods(const CXXMethodDecl *Method) const
QualType getDependentBitIntType(bool Unsigned, Expr *BitsExpr) const
Return a dependent bit-precise integer type with the specified signedness and bit count.
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
StringRef getCUIDHash() const
bool isMSStaticDataMemberInlineDefinition(const VarDecl *VD) const
Returns true if this is an inline-initialized static data member which is treated as a definition for...
bool canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT)
canAssignObjCInterfaces - Return true if the two interface types are compatible for assignment from R...
QualType getReferenceQualifiedType(const Expr *e) const
getReferenceQualifiedType - Given an expr, will return the type for that expression,...
bool hasSameFunctionTypeIgnoringExceptionSpec(QualType T, QualType U) const
Determine whether two function types are the same, ignoring exception specifications in cases where t...
bool isObjCSelType(QualType T) const
QualType getBlockDescriptorExtendedType() const
Gets the struct used to keep track of the extended descriptor for pointer to blocks.
void Deallocate(void *Ptr) const
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
IdentifierInfo * getMakeIntegerSeqName() const
bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)
QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt...
void addLazyModuleInitializers(Module *M, ArrayRef< GlobalDeclID > IDs)
bool isSameConstraintExpr(const Expr *XCE, const Expr *YCE) const
Determine whether two 'requires' expressions are similar enough that they may be used in re-declarati...
IdentifierInfo * getTypePackElementName() const
bool BlockRequiresCopying(QualType Ty, const VarDecl *D)
Returns true iff we need copy/dispose helpers for the given type.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
CanQualType OMPIteratorTy
std::vector< Decl * > getTraversalScope() const
TemplateName getSubstTemplateTemplateParm(TemplateName replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex) const
Builtin::Context & BuiltinInfo
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, const Expr *SizeExpr, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type.
void addModuleInitializer(Module *M, Decl *Init)
Add a declaration to the list of declarations that are initialized for a module.
const LangOptions & getLangOpts() const
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
QualType getFunctionTypeWithoutPtrSizes(QualType T)
Get a function type and produce the equivalent function type where pointer size address spaces in the...
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
SelectorTable & Selectors
bool isTypeIgnoredBySanitizer(const SanitizerMask &Mask, const QualType &Ty) const
Check if a type can have its sanitizer instrumentation elided based on its presence within an ignorel...
unsigned getMinGlobalAlignOfVar(uint64_t Size, const VarDecl *VD) const
Return the minimum alignement as specified by the target.
RawCommentList Comments
All comments in this translation unit.
bool isSameDefaultTemplateArgument(const NamedDecl *X, const NamedDecl *Y) const
Determine whether two default template arguments are similar enough that they may be used in declarat...
QualType applyObjCProtocolQualifiers(QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
Apply Objective-C protocol qualifiers to the given type.
QualType getMacroQualifiedType(QualType UnderlyingTy, const IdentifierInfo *MacroII) const
QualType removePtrSizeAddrSpace(QualType T) const
Remove the existing address space on the type if it is a pointer size address space and return the ty...
bool areLaxCompatibleRVVTypes(QualType FirstType, QualType SecondType)
Return true if the given vector types are lax-compatible RISC-V vector types as defined by -flax-vect...
void setObjCSuperType(QualType ST)
TypedefDecl * getBOOLDecl() const
Retrieve declaration of 'BOOL' typedef.
CanQualType SatShortFractTy
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
bool canBindObjCObjectType(QualType To, QualType From)
unsigned getNextStringLiteralVersion()
Return the next version number to be used for a string literal evaluated as part of constant evaluati...
int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const
Compare the rank of two floating point types as above, but compare equal if both types have the same ...
QualType getUIntPtrType() const
Return a type compatible with "uintptr_t" (C99 7.18.1.4), as defined by the target.
void setParameterIndex(const ParmVarDecl *D, unsigned index)
Used by ParmVarDecl to store on the side the index of the parameter when it exceeds the size of the n...
QualType getFunctionTypeWithExceptionSpec(QualType Orig, const FunctionProtoType::ExceptionSpecInfo &ESI) const
Get a function type and produce the equivalent function type with the specified exception specificati...
bool hasSameType(const Type *T1, const Type *T2) const
QualType getObjCInstanceType()
Retrieve the Objective-C "instancetype" type, if already known; otherwise, returns a NULL type;.
Qualifiers::GC getObjCGCAttrKind(QualType Ty) const
Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.
PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()
void setASTMutationListener(ASTMutationListener *Listener)
Attach an AST mutation listener to the AST context.
bool hasUniqueObjectRepresentations(QualType Ty, bool CheckIfTriviallyCopyable=true) const
Return true if the specified type has unique object representations according to (C++17 [meta....
const QualType GetHigherPrecisionFPType(QualType ElementType) const
bool typesAreBlockPointerCompatible(QualType, QualType)
CanQualType SatUnsignedAccumTy
bool useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl, StringRef MangledName)
const ASTRecordLayout & getASTObjCInterfaceLayout(const ObjCInterfaceDecl *D) const
Get or compute information about the layout of the specified Objective-C interface.
QualType getObjCProtoType() const
Retrieve the type of the Objective-C Protocol class.
void forEachMultiversionedFunctionVersion(const FunctionDecl *FD, llvm::function_ref< void(FunctionDecl *)> Pred) const
Visits all versions of a multiversioned function with the passed predicate.
void setInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst, UsingEnumDecl *Pattern)
Remember that the using enum decl Inst is an instantiation of the using enum decl Pattern of a class ...
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
Decl * getPrimaryMergedDecl(Decl *D)
QualType getSignatureParameterType(QualType T) const
Retrieve the parameter type as adjusted for use in the signature of a function, decaying array and fu...
CanQualType ArraySectionTy
QualType getCanonicalTemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args) const
CanQualType ObjCBuiltinIdTy
overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const
VTableContextBase * getVTableContext()
void setBOOLDecl(TypedefDecl *TD)
Save declaration of 'BOOL' typedef.
llvm::SetVector< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost
Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.
ComparisonCategories CompCategories
Types and expressions required to build C++2a three-way comparisons using operator<=>,...
int getFloatingTypeOrder(QualType LHS, QualType RHS) const
Compare the rank of the two specified floating point types, ignoring the domain of the type (i....
unsigned CountNonClassIvars(const ObjCInterfaceDecl *OI) const
ASTContext(const ASTContext &)=delete
ObjCPropertyImplDecl * getObjCPropertyImplDeclForPropertyDecl(const ObjCPropertyDecl *PD, const Decl *Container) const
bool isNearlyEmpty(const CXXRecordDecl *RD) const
void cacheRawCommentForDecl(const Decl &OriginalD, const RawComment &Comment) const
Attaches Comment to OriginalD and to its redeclaration chain and removes the redeclaration chain from...
void attachCommentsToJustParsedDecls(ArrayRef< Decl * > Decls, const Preprocessor *PP)
Searches existing comments for doc comments that should be attached to Decls.
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth,...
llvm::BumpPtrAllocator & getAllocator() const
void setStaticLocalNumber(const VarDecl *VD, unsigned Number)
QualType getCFConstantStringType() const
Return the C structure type used to represent constant CFStrings.
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
const NoSanitizeList & getNoSanitizeList() const
struct clang::ASTContext::CUDAConstantEvalContext CUDAConstantEvalCtx
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
UsingEnumDecl * getInstantiatedFromUsingEnumDecl(UsingEnumDecl *Inst)
If the given using-enum decl Inst is an instantiation of another using-enum decl, return it.
RecordDecl * getCFConstantStringTagDecl() const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
QualType getDeducedTemplateSpecializationType(TemplateName Template, QualType DeducedType, bool IsDependent) const
C++17 deduced class template specialization type.
std::string getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const
Emit the encoded type for the function Decl into S.
QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
Retrieve the template type parameter type for a template parameter or parameter pack with the given d...
bool addressSpaceMapManglingFor(LangAS AS) const
CanQualType UnsignedFractTy
QualType getjmp_bufType() const
Retrieve the C jmp_buf type.
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
QualType mergeFunctionParameterTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeFunctionParameterTypes - merge two types which appear as function parameter types
QualType getsigjmp_bufType() const
Retrieve the C sigjmp_buf type.
void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)
Note that the given C++ Method overrides the given Overridden method.
const TargetInfo * getAuxTargetInfo() const
CanQualType ObjCBuiltinClassTy
unsigned NumImplicitDefaultConstructorsDeclared
The number of implicitly-declared default constructors for which declarations were built.
CanQualType UnresolvedTemplateTy
void setucontext_tDecl(TypeDecl *ucontext_tDecl)
Set the type for the C ucontext_t type.
OMPTraitInfo & getNewOMPTraitInfo()
Return a new OMPTraitInfo object owned by this context.
CanQualType UnsignedLongTy
llvm::DenseSet< const FunctionDecl * > CUDAImplicitHostDeviceFunUsedByDevice
Keep track of CUDA/HIP implicit host device functions used on device side in device compilation.
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass, SmallVectorImpl< const ObjCIvarDecl * > &Ivars) const
DeepCollectObjCIvars - This routine first collects all declared, but not synthesized,...
bool computeBestEnumTypes(bool IsPacked, unsigned NumNegativeBits, unsigned NumPositiveBits, QualType &BestType, QualType &BestPromotionType)
Compute BestType and BestPromotionType for an enum based on the highest number of negative and positi...
llvm::APFixedPoint getFixedPointMin(QualType Ty) const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
QualType adjustType(QualType OldType, llvm::function_ref< QualType(QualType)> Adjust) const
Rebuild a type, preserving any existing type sugar.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
bool hasAnyFunctionEffects() const
const TranslationUnitKind TUKind
QualType getQualifiedType(const Type *T, Qualifiers Qs) const
Return a type with additional qualifiers.
CanQualType UnsignedLongAccumTy
QualType AutoRRefDeductTy
QualType getRestrictType(QualType T) const
Return the uniqued reference to the type for a restrict qualified type.
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
TypeInfo getTypeInfo(const Type *T) const
Get the size and alignment of the specified complete type in bits.
QualType getStringLiteralArrayType(QualType EltTy, unsigned Length) const
Return a type for a constant array for a string literal of the specified element type and length.
QualType getCorrespondingSaturatedType(QualType Ty) const
bool isSameEntity(const NamedDecl *X, const NamedDecl *Y) const
Determine whether the two declarations refer to the same entity.
QualType getBOOLType() const
type of 'BOOL' type.
TypeSourceInfo * getTemplateSpecializationTypeInfo(TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &Args, QualType Canon=QualType()) const
QualType getSubstTemplateTypeParmPackType(Decl *AssociatedDecl, unsigned Index, bool Final, const TemplateArgument &ArgPack)
Retrieve a.
llvm::DenseMap< const CXXMethodDecl *, CXXCastPath > LambdaCastPaths
For capturing lambdas with an explicit object parameter whose type is derived from the lambda type,...
CanQualType BoundMemberTy
CanQualType SatUnsignedShortFractTy
QualType removeAddrSpaceQualType(QualType T) const
Remove any existing address space on the type and returns the type with qualifiers intact (or that's ...
bool hasSameFunctionTypeIgnoringParamABI(QualType T, QualType U) const
Determine if two function types are the same, ignoring parameter ABI annotations.
TypedefDecl * getInt128Decl() const
Retrieve the declaration for the 128-bit signed integer type.
unsigned getOpenMPDefaultSimdAlign(QualType T) const
Get default simd alignment of the specified complete type in bits.
QualType getObjCSuperType() const
Returns the C struct type for objc_super.
QualType getBlockDescriptorType() const
Gets the struct used to keep track of the descriptor for pointer to blocks.
bool CommentsLoaded
True if comments are already loaded from ExternalASTSource.
BlockVarCopyInit getBlockVarCopyInit(const VarDecl *VD) const
Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.
unsigned NumImplicitMoveConstructorsDeclared
The number of implicitly-declared move constructors for which declarations were built.
unsigned NumImplicitCopyConstructorsDeclared
The number of implicitly-declared copy constructors for which declarations were built.
llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost
Keep track of CUDA/HIP device-side variables ODR-used by host code.
CanQualType PseudoObjectTy
QualType getWebAssemblyExternrefType() const
Return a WebAssembly externref type.
void setTraversalScope(const std::vector< Decl * > &)
CharUnits getTypeUnadjustedAlignInChars(QualType T) const
getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type, in characters,...
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
CanQualType getComplexType(CanQualType T) const
friend class NestedNameSpecifier
unsigned getAlignOfGlobalVar(QualType T, const VarDecl *VD) const
Return the alignment in bits that should be given to a global variable with type T.
TypeInfoChars getTypeInfoDataSizeInChars(QualType T) const
MangleNumberingContext & getManglingNumberContext(const DeclContext *DC)
Retrieve the context for computing mangling numbers in the given DeclContext.
comments::FullComment * getLocalCommentForDeclUncached(const Decl *D) const
Return parsed documentation comment attached to a given declaration.
unsigned NumImplicitDestructors
The number of implicitly-declared destructors.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl=nullptr) const
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
bool areComparableObjCPointerTypes(QualType LHS, QualType RHS)
MangleContext * createDeviceMangleContext(const TargetInfo &T)
Creates a device mangle context to correctly mangle lambdas in a mixed architecture compile by settin...
CharUnits getExnObjectAlignment() const
Return the alignment (in bytes) of the thrown exception object.
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
ASTMutationListener * Listener
QualType getPackExpansionType(QualType Pattern, std::optional< unsigned > NumExpansions, bool ExpectPackInType=true) const
Form a pack expansion type with the given pattern.
void setNonKeyFunction(const CXXMethodDecl *method)
Observe that the given method cannot be a key function.
CanQualType ObjCBuiltinBoolTy
TypeInfoChars getTypeInfoInChars(const Type *T) const
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
LangAS getDefaultOpenCLPointeeAddrSpace()
Returns default address space based on OpenCL version and enabled features.
TemplateParamObjectDecl * getTemplateParamObjectDecl(QualType T, const APValue &V) const
Return the template parameter object of the given type with the given value.
const SourceManager & getSourceManager() const
CharUnits getDeclAlign(const Decl *D, bool ForAlignof=false) const
Return a conservative estimate of the alignment of the specified decl D.
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
CanQualType OCLClkEventTy
void adjustExceptionSpec(FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten=false)
Change the exception specification on a function once it is delay-parsed, instantiated,...
TypedefDecl * getUInt128Decl() const
Retrieve the declaration for the 128-bit unsigned integer type.
CharUnits getPreferredTypeAlignInChars(QualType T) const
Return the PreferredAlignment of a (complete) type T, in characters.
const clang::PrintingPolicy & getPrintingPolicy() const
ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)
Get the additional modules in which the definition Def has been merged.
static ImportDecl * getNextLocalImport(ImportDecl *Import)
llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const
QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a dependently-sized array of the specified element type...
uint64_t lookupFieldBitOffset(const ObjCInterfaceDecl *OID, const ObjCImplementationDecl *ID, const ObjCIvarDecl *Ivar) const
Get the offset of an ObjCIvarDecl in bits.
CanQualType SatUnsignedShortAccumTy
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false, bool BlockReturnType=false, bool IsConditionalOperator=false)
const RawComment * getRawCommentForAnyRedecl(const Decl *D, const Decl **OriginalDecl=nullptr) const
Return the documentation comment attached to a given declaration.
CharUnits getAlignOfGlobalVarInChars(QualType T, const VarDecl *VD) const
Return the alignment in characters that should be given to a global variable with type T.
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
static bool isObjCNSObjectType(QualType Ty)
Return true if this is an NSObject object with its NSObject attribute set.
GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const
UsingShadowDecl * getInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst)
QualType getWCharType() const
Return the unique wchar_t type available in C++ (and available as __wchar_t as a Microsoft extension)...
QualType getObjCIdType() const
Represents the Objective-CC id type.
Decl * getVaListTagDecl() const
Retrieve the C type declaration corresponding to the predefined __va_list_tag type used to help defin...
QualType getUnsignedWCharType() const
Return the type of "unsigned wchar_t".
QualType getFunctionTypeWithoutParamABIs(QualType T) const
Get or construct a function type that is equivalent to the input type except that the parameter ABI a...
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
QualType getCorrespondingUnsaturatedType(QualType Ty) const
comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const
Return parsed documentation comment attached to a given declaration.
FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs(FunctionProtoType::ExceptionSpecInfo ESI1, FunctionProtoType::ExceptionSpecInfo ESI2, SmallVectorImpl< QualType > &ExceptionTypeStorage, bool AcceptDependent)
TemplateArgument getInjectedTemplateArg(NamedDecl *ParamDecl) const
unsigned getTargetDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
llvm::DenseMap< CanQualType, SYCLKernelInfo > SYCLKernels
Map of SYCL kernels indexed by the unique type used to name the kernel.
bool isSameTemplateParameterList(const TemplateParameterList *X, const TemplateParameterList *Y) const
Determine whether two template parameter lists are similar enough that they may be used in declaratio...
QualType getWritePipeType(QualType T) const
Return a write_only pipe type for the specified type.
const CXXRecordDecl * baseForVTableAuthentication(const CXXRecordDecl *ThisClass)
Resolve the root record to be used to derive the vtable pointer authentication policy for the specifi...
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
CanQualType UnsignedInt128Ty
ObjCInterfaceDecl * getObjCProtocolDecl() const
Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.
unsigned NumImplicitDefaultConstructors
The number of implicitly-declared default constructors.
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
unsigned NumImplicitMoveAssignmentOperatorsDeclared
The number of implicitly-declared move assignment operators for which declarations were built.
void setManglingNumber(const NamedDecl *ND, unsigned Number)
llvm::DenseMap< const Decl *, const RawComment * > DeclRawComments
Mapping from declaration to directly attached comment.
TypedefDecl * getBuiltinVaListDecl() const
Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.
TypeInfo getTypeInfo(QualType T) const
CanQualType UnsignedCharTy
CanQualType UnsignedShortFractTy
BuiltinTemplateDecl * buildBuiltinTemplateDecl(BuiltinTemplateKind BTK, const IdentifierInfo *II) const
void * Allocate(size_t Size, unsigned Align=8) const
bool canBuiltinBeRedeclared(const FunctionDecl *) const
Return whether a declaration to a builtin is allowed to be overloaded/redeclared.
CanQualType UnsignedIntTy
TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const
Retrieve the template name that represents a dependent template name such as MetaFun::template apply.
unsigned NumImplicitMoveConstructors
The number of implicitly-declared move constructors.
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl * > protocols) const
QualType getVolatileType(QualType T) const
Return the uniqued reference to the type for a volatile qualified type.
void getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT, QualType T, std::string &S, bool Extended) const
getObjCEncodingForMethodParameter - Return the encoded type for a single method parameter or return t...
void addDeclaratorForUnnamedTagDecl(TagDecl *TD, DeclaratorDecl *DD)
unsigned overridden_methods_size(const CXXMethodDecl *Method) const
std::string getObjCEncodingForBlock(const BlockExpr *blockExpr) const
Return the encoded type for this block declaration.
TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const
Allocate an uninitialized TypeSourceInfo.
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
TagDecl * getMSGuidTagDecl() const
Retrieve the implicitly-predeclared 'struct _GUID' declaration.
QualType getExceptionObjectType(QualType T) const
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
Note that the static data member Inst is an instantiation of the static data member template Tmpl of ...
FieldDecl * getInstantiatedFromUnnamedFieldDecl(FieldDecl *Field) const
DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)
bool ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *Decl)
ObjCObjectAdoptsQTypeProtocols - Checks that protocols in IC's protocol list adopt all protocols in Q...
QualType getFunctionNoProtoType(QualType ResultTy) const
CanQualType UnsignedLongLongTy
QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const
Return the type for the specified builtin.
QualType getCommonSugaredType(QualType X, QualType Y, bool Unqualified=false)
CanQualType OCLReserveIDTy
bool isSameTemplateParameter(const NamedDecl *X, const NamedDecl *Y) const
Determine whether two template parameters are similar enough that they may be used in declarations of...
void registerSYCLEntryPointFunction(FunctionDecl *FD)
Generates and stores SYCL kernel metadata for the provided SYCL kernel entry point function.
size_t getASTAllocatedMemory() const
Return the total amount of physical memory allocated for representing AST nodes and type information.
QualType getArrayDecayedType(QualType T) const
Return the properly qualified result of decaying the specified array type to a pointer.
overridden_cxx_method_iterator overridden_methods_begin(const CXXMethodDecl *Method) const
CanQualType UnsignedShortTy
unsigned getTypeAlignIfKnown(QualType T, bool NeedsPreferredAlignment=false) const
Return the alignment of a type, in bits, or 0 if the type is incomplete and we cannot determine the a...
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true) const
Attempt to unwrap two types that may both be array types with the same bound (or both be array types ...
QualType getObjCConstantStringInterface() const
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon=QualType()) const
const SYCLKernelInfo & getSYCLKernelInfo(QualType T) const
Given a type used as a SYCL kernel name, returns a reference to the metadata generated from the corre...
bool canAssignObjCInterfacesInBlockPointer(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, bool BlockReturnType)
canAssignObjCInterfacesInBlockPointer - This routine is specifically written for providing type-safet...
CanQualType SatUnsignedLongFractTy
void setcudaConfigureCallDecl(FunctionDecl *FD)
CanQualType getDecayedType(CanQualType T) const
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *RD)
QualType getDependentAddressSpaceType(QualType PointeeType, Expr *AddrSpaceExpr, SourceLocation AttrLoc) const
QualType getPackIndexingType(QualType Pattern, Expr *IndexExpr, bool FullySubstituted=false, ArrayRef< QualType > Expansions={}, int Index=-1) const
RawComment * getRawCommentForDeclNoCache(const Decl *D) const
Return the documentation comment attached to a given declaration, without looking into cache.
QualType getPromotedIntegerType(QualType PromotableType) const
Return the type that PromotableType will promote to: C99 6.3.1.1p2, assuming that PromotableType is a...
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const
Make an APSInt of the appropriate width and signedness for the given Value and integer Type.
const VariableArrayType * getAsVariableArrayType(QualType T) const
QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const
Unary type transforms.
const Type * getCanonicalType(const Type *T) const
void setExternalSource(IntrusiveRefCntPtr< ExternalASTSource > Source)
Attach an external AST source to the AST context.
const ObjCInterfaceDecl * getObjContainingInterface(const NamedDecl *ND) const
Returns the Objective-C interface that ND belongs to if it is an Objective-C method/property/ivar etc...
StringLiteral * getPredefinedStringLiteralFromCache(StringRef Key) const
Return a string representing the human readable name for the specified function declaration or file n...
bool hasSimilarType(QualType T1, QualType T2) const
Determine if two types are similar, according to the C++ rules.
llvm::APFixedPoint getFixedPointMax(QualType Ty) const
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type.
bool areCompatibleSveTypes(QualType FirstType, QualType SecondType)
Return true if the given types are an SVE builtin and a VectorType that is a fixed-length representat...
void setObjCClassRedefinitionType(QualType RedefType)
Set the user-written type that redefines 'SEL'.
bool hasDirectOwnershipQualifier(QualType Ty) const
Return true if the type has been explicitly qualified with ObjC ownership.
Qualifiers::ObjCLifetime getInnerObjCOwnership(QualType T) const
Recurses in pointer/array types until it finds an Objective-C retainable type and returns its ownersh...
void addCopyConstructorForExceptionObject(CXXRecordDecl *RD, CXXConstructorDecl *CD)
FunctionDecl * getcudaConfigureCallDecl()
DiagnosticsEngine & getDiagnostics() const
llvm::StringRef backupStr(llvm::StringRef S) const
QualType getAdjustedParameterType(QualType T) const
Perform adjustment on the parameter type of a function.
QualType getUnqualifiedObjCPointerType(QualType type) const
getUnqualifiedObjCPointerType - Returns version of Objective-C pointer type with lifetime qualifier r...
void ResetObjCLayout(const ObjCContainerDecl *CD)
interp::Context & getInterpContext()
Returns the clang bytecode interpreter context.
QualType getCVRQualifiedType(QualType T, unsigned CVR) const
Return a type with additional const, volatile, or restrict qualifiers.
UnnamedGlobalConstantDecl * getUnnamedGlobalConstantDecl(QualType Ty, const APValue &Value) const
Return a declaration for a uniquified anonymous global constant corresponding to a given APValue.
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size.
bool areCompatibleVectorTypes(QualType FirstVec, QualType SecondVec)
Return true if the given vector types are of the same unqualified type or if they are equivalent to t...
void getOverriddenMethods(const NamedDecl *Method, SmallVectorImpl< const NamedDecl * > &Overridden) const
Return C++ or ObjC overridden methods for the given Method.
DeclarationNameInfo getNameForTemplate(TemplateName Name, SourceLocation NameLoc) const
bool hasSameTemplateName(const TemplateName &X, const TemplateName &Y, bool IgnoreDeduced=false) const
Determine whether the given template names refer to the same template.
CanQualType SatLongFractTy
const TargetInfo & getTargetInfo() const
void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)
CanQualType SatShortAccumTy
QualType getAutoDeductType() const
C++11 deduction pattern for 'auto' type.
unsigned NumImplicitCopyConstructors
The number of implicitly-declared copy constructors.
CharUnits toCharUnitsFromBits(int64_t BitSize) const
Convert a size in bits to a size in characters.
CanQualType IncompleteMatrixIdxTy
std::optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const
void getFunctionFeatureMap(llvm::StringMap< bool > &FeatureMap, const FunctionDecl *) const
CanQualType getNSIntegerType() const
QualType getCorrespondingUnsignedType(QualType T) const
void setBlockVarCopyInit(const VarDecl *VD, Expr *CopyExpr, bool CanThrow)
Set the copy initialization expression of a block var decl.
QualType getLifetimeQualifiedType(QualType type, Qualifiers::ObjCLifetime lifetime)
Return a type with the given lifetime qualifier.
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin, UnresolvedSetIterator End) const
Retrieve the template name that corresponds to a non-empty lookup.
bool typesAreCompatible(QualType T1, QualType T2, bool CompareUnqualified=false)
Compatibility predicates used to check assignment expressions.
TemplateName getSubstTemplateTemplateParmPack(const TemplateArgument &ArgPack, Decl *AssociatedDecl, unsigned Index, bool Final) const
QualType getObjCNSStringType() const
TargetCXXABI::Kind getCXXABIKind() const
Return the C++ ABI kind that should be used.
void setjmp_bufDecl(TypeDecl *jmp_bufDecl)
Set the type for the C jmp_buf type.
QualType getHLSLAttributedResourceType(QualType Wrapped, QualType Contained, const HLSLAttributedResourceType::Attributes &Attrs)
void addDestruction(T *Ptr) const
If T isn't trivially destructible, calls AddDeallocation to register it for destruction.
bool UnwrapSimilarTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true) const
Attempt to unwrap two types that may be similar (C++ [conv.qual]).
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
BuiltinTemplateDecl * getTypePackElementDecl() const
CanQualType SatUnsignedLongAccumTy
QualType getUnconstrainedType(QualType T) const
Remove any type constraints from a template parameter type, for equivalence comparison of template pa...
QualType getTypeOfType(QualType QT, TypeOfKind Kind) const
getTypeOfType - Unlike many "get" functions, we don't unique TypeOfType nodes.
QualType getCorrespondingSignedType(QualType T) const
QualType mergeObjCGCQualifiers(QualType, QualType)
mergeObjCGCQualifiers - This routine merges ObjC's GC attribute of 'LHS' and 'RHS' attributes and ret...
QualType getQualifiedType(QualType T, Qualifiers Qs) const
Return a type with additional qualifiers.
llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains
Keeps track of redeclaration chains that don't have any comment attached.
uint64_t getArrayInitLoopExprElementCount(const ArrayInitLoopExpr *AILE) const
Return number of elements initialized in an ArrayInitLoopExpr.
void deduplicateMergedDefinitonsFor(NamedDecl *ND)
Clean up the merged definition list.
unsigned getTargetAddressSpace(LangAS AS) const
QualType getWideCharType() const
Return the type of wide characters.
QualType getIntPtrType() const
Return a type compatible with "intptr_t" (C99 7.18.1.4), as defined by the target.
void mergeDefinitionIntoModule(NamedDecl *ND, Module *M, bool NotifyListeners=true)
Note that the definition ND has been merged into module M, and should be visible whenever M is visibl...
void addTranslationUnitDecl()
bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const
void getObjCEncodingForPropertyType(QualType T, std::string &S) const
Emit the Objective-C property type encoding for the given type T into S.
unsigned NumImplicitCopyAssignmentOperators
The number of implicitly-declared copy assignment operators.
void CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet< ObjCProtocolDecl *, 8 > &Protocols)
CollectInheritedProtocols - Collect all protocols in current class and those inherited by it.
bool isPromotableIntegerType(QualType T) const
More type predicates useful for type checking/promotion.
T * Allocate(size_t Num=1) const
llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments
Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.
CanQualType getSignedSizeType() const
Return the unique signed counterpart of the integer type corresponding to size_t.
void adjustDeducedFunctionResultType(FunctionDecl *FD, QualType ResultType)
Change the result type of a function type once it is deduced.
QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const
Return the uniqued reference to the type for an Objective-C gc-qualified type.
QualType getPointerAuthType(QualType Ty, PointerAuthQualifier PointerAuth)
Return a type with the given __ptrauth qualifier.
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const
C++11 decltype.
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const
Retrieves the "canonical" nested name specifier for a given nested name specifier.
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Underlying=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
InlineVariableDefinitionKind getInlineVariableDefinitionKind(const VarDecl *VD) const
Determine whether a definition of this inline variable should be treated as a weak or strong definiti...
void setPrimaryMergedDecl(Decl *D, Decl *Primary)
CanQualType getUIntMaxType() const
Return the unique type for "uintmax_t" (C99 7.18.1.5), defined in <stdint.h>.
IdentifierInfo * getBoolName() const
Retrieve the identifier 'bool'.
uint16_t getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD)
Return the "other" discriminator used for the pointer auth schema used for vtable pointers in instanc...
CharUnits getOffsetOfBaseWithVBPtr(const CXXRecordDecl *RD) const
Loading virtual member pointers using the virtual inheritance model always results in an adjustment u...
LangAS getLangASForBuiltinAddressSpace(unsigned AS) const
bool hasSameFunctionTypeIgnoringPtrSizes(QualType T, QualType U)
Determine whether two function types are the same, ignoring pointer sizes in the return type and para...
unsigned char getFixedPointScale(QualType Ty) const
QualType getIncompleteArrayType(QualType EltTy, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a unique reference to the type for an incomplete array of the specified element type.
QualType getDependentSizedExtVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc) const
QualType DecodeTypeStr(const char *&Str, const ASTContext &Context, ASTContext::GetBuiltinTypeError &Error, bool &RequireICE, bool AllowTypeModifiers) const
TemplateName getAssumedTemplateName(DeclarationName Name) const
Retrieve a template name representing an unqualified-id that has been assumed to name a template for ...
@ GE_Missing_stdio
Missing a type from <stdio.h>
@ GE_Missing_type
Missing a type.
@ GE_Missing_ucontext
Missing a type from <ucontext.h>
@ GE_Missing_setjmp
Missing a type from <setjmp.h>
QualType adjustStringLiteralBaseType(QualType StrLTy) const
uint16_t getPointerAuthTypeDiscriminator(QualType T)
Return the "other" type-specific discriminator for the given type.
QualType getTypeOfExprType(Expr *E, TypeOfKind Kind) const
C23 feature and GCC extension.
QualType getSignedWCharType() const
Return the type of "signed wchar_t".
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals) const
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
bool hasCvrSimilarType(QualType T1, QualType T2)
Determine if two types are similar, ignoring only CVR qualifiers.
TemplateName getDeducedTemplateName(TemplateName Underlying, DefaultArguments DefaultArgs) const
Represents a TemplateName which had some of its default arguments deduced.
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
CanQualType UnsignedAccumTy
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
void addTypedefNameForUnnamedTagDecl(TagDecl *TD, TypedefNameDecl *TND)
bool isDependenceAllowed() const
QualType getConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns) const
Return the unique reference to the matrix type of the specified element type and size.
QualType getWIntType() const
In C99, this returns a type compatible with the type defined in <stddef.h> as defined by the target.
QualType getVariableArrayDecayedType(QualType Ty) const
Returns a vla type where known sizes are replaced with [*].
bool isInSameModule(const Module *M1, const Module *M2)
If the two module M1 and M2 are in the same module.
void setCFConstantStringType(QualType T)
const SYCLKernelInfo * findSYCLKernelInfo(QualType T) const
Returns a pointer to the metadata generated from the corresponding SYCLkernel entry point if the prov...
ASTContext & operator=(const ASTContext &)=delete
Module * getCurrentNamedModule() const
Get module under construction, nullptr if this is not a C++20 module.
unsigned getParameterIndex(const ParmVarDecl *D) const
Used by ParmVarDecl to retrieve on the side the index of the parameter when it exceeds the size of th...
void setPrintingPolicy(const clang::PrintingPolicy &Policy)
void AddDeallocation(void(*Callback)(void *), void *Data) const
Add a deallocation callback that will be invoked when the ASTContext is destroyed.
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
CXXMethodVector::const_iterator overridden_cxx_method_iterator
RawComment * getRawCommentForDeclNoCacheImpl(const Decl *D, const SourceLocation RepresentativeLocForDecl, const std::map< unsigned, RawComment * > &CommentsInFile) const
unsigned getTypeAlign(QualType T) const
Return the ABI-specified alignment of a (complete) type T, in bits.
QualType mergeTransparentUnionType(QualType, QualType, bool OfBlockPointer=false, bool Unqualified=false)
mergeTransparentUnionType - if T is a transparent union type and a member of T is compatible with Sub...
QualType isPromotableBitField(Expr *E) const
Whether this is a promotable bitfield reference according to C99 6.3.1.1p2, bullet 2 (and GCC extensi...
bool isSentinelNullExpr(const Expr *E)
CanQualType getNSUIntegerType() const
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
uint64_t getCharWidth() const
Return the size of the character type, in bits.
CanQualType getPointerType(CanQualType T) const
QualType getUnqualifiedArrayType(QualType T) const
import_range local_imports() const
QualType getBitIntType(bool Unsigned, unsigned NumBits) const
Return a bit-precise integer type with the specified signedness and bit count.
const DependentSizedArrayType * getAsDependentSizedArrayType(QualType T) const
unsigned NumImplicitMoveAssignmentOperators
The number of implicitly-declared move assignment operators.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Reads an AST files chain containing the contents of a translation unit.
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Writes an AST file containing the contents of a translation unit.
Represents a loop initializing the elements of an array.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Attr - This represents one attribute.
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
This class is used for builtin types like 'int'.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
Implements C++ ABI-specific semantic analysis functions.
Represents a C++ constructor within a class.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
static CanQual< Type > CreateUnsafe(QualType Other)
Builds a canonical type from a QualType.
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
CharUnits - This is an opaque type for sizes expressed in character units.
Declaration of a C++20 concept.
Represents the canonical version of C arrays with a specified constant size.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
A list storing NamedDecls in the lookup tables.
Decl - This represents one declaration (or definition), e.g.
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
The name of a declaration.
Represents a ValueDecl that came out of a declarator.
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
Represents an array type in C++ whose size is a value-dependent expression.
An allocator for DiagnosticStorage objects, which uses a small cache to objects, used to reduce mallo...
Concrete class used by the front-end to report problems and issues.
Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.
This represents one expression.
Declaration context for names declared as extern "C" in C++.
Abstract interface for external sources of AST nodes.
Represents a member of a struct/union/class.
A SourceLocation and its associated SourceManager.
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
A class which abstracts out some details necessary for making a call.
FunctionType - C99 6.7.5.3 - Function Declarators.
GlobalDecl - represents a global declaration.
One of these records is kept for each identifier that is lexed.
Implements an efficient mapping from strings to IdentifierInfo nodes.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Represents a C array with an unspecified size.
Provides support for incremental compilation.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
Provides information a specialization of a member of a class template, which may be a member function...
Describes a module or submodule.
This represents a decl that may have a name.
Represents a C++ nested name specifier, such as "\::std::vector::".
Helper data structure representing the traits in a match clause of an declare variant or metadirectiv...
ObjCCategoryDecl - Represents a category declaration.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
ObjCContainerDecl - Represents a container for method declarations.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Represents an ObjC class declaration.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCMethodDecl - Represents an instance or class method declaration.
Represents a pointer to an Objective C object.
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Represents an Objective-C protocol declaration.
Represents the declaration of an Objective-C type parameter.
Represents a parameter to a function.
Pointer-authentication qualifiers.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
A (possibly-)qualified type.
PointerAuthQualifier getPointerAuth() const
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
A qualifier set is used to build a set of qualifiers.
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
The collection of all-type qualifiers we support.
@ OCL_None
There is no lifetime qualification on this type.
void removeObjCLifetime()
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
unsigned getFastQualifiers() const
static Qualifiers fromCVRMask(unsigned CVR)
void setPointerAuth(PointerAuthQualifier Q)
void addObjCLifetime(ObjCLifetime type)
Represents a struct/union/class.
void setPreviousDecl(decl_type *PrevDecl)
Set the previous declaration.
This table allows us to fully hide how we implement multi-keyword caching.
Selector getSelector(unsigned NumArgs, const IdentifierInfo **IIV)
Can create any sort of selector.
Smart pointer class that efficiently represents Objective-C method names.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
StringLiteral - This represents a string literal expression, e.g.
Represents the declaration of a struct/union/class/enum.
Kind
The basic C++ ABI kind.
Exposes information about the current target.
A convenient class for passing around template argument information.
Represents a template argument.
Represents a C++ template name within the type system.
A template parameter object.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Declaration of a template type parameter.
The top declaration context.
static TranslationUnitDecl * Create(ASTContext &C)
Models the abbreviated syntax to constrain a template type parameter: template <convertible_to<string...
Represents a declaration of a type.
A container of type source information.
The base class of the type hierarchy.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
bool isObjCNSObjectType() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
QualType getCanonicalTypeInternal() const
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types,...
std::optional< NullabilityKind > getNullability() const
Determine the nullability of the given type.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Base class for declarations which introduce a typedef-name.
An artificial decl, representing a global anonymous constant value which is uniquified by value withi...
The iterator over UnresolvedSets.
Represents a dependent using declaration which was marked with typename.
Represents a C++ using-enum-declaration.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a GCC generic vector type.
Holds all information required to evaluate constexpr code in a module.
bool operator!=(const CommonEntityInfo &LHS, const CommonEntityInfo &RHS)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr
Matches a reference to a block.
llvm::FixedPointSemantics FixedPointSemantics
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
GVALinkage
A more specific kind of linkage than enum Linkage.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
bool isTargetAddressSpace(LangAS AS)
OpenCLTypeKind
OpenCL type kinds.
NullabilityKind
Describes the nullability of a particular type.
@ Nullable
Values of this type can be null.
@ Unspecified
Whether values of this type can be null is (explicitly) unspecified.
@ NonNull
Values of this type can never be null.
TypeOfKind
The kind of 'typeof' expression we're after.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
@ Result
The result type of a method or function.
ArraySizeModifier
Capture whether this is a normal array (e.g.
SubstTemplateTypeParmTypeFlag
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
TagTypeKind
The kind of a tag type.
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
LangAS
Defines the address space values used by the address space qualifier of QualType.
TranslationUnitKind
Describes the kind of translation unit being processed.
@ TU_Incremental
The translation unit is a is a complete translation unit that we might incrementally extend later.
const FunctionProtoType * T
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
CallingConv
CallingConv - Specifies the calling convention that a function uses.
@ None
The alignment was not explicit in code.
@ RequiredByEnum
The alignment comes from an alignment attribute on a enum type.
@ RequiredByTypedef
The alignment comes from an alignment attribute on a typedef.
@ RequiredByRecord
The alignment comes from an alignment attribute on a record type.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, unsigned NumVectors)
bool NoWrongSidedVars
Do not allow wrong-sided variables in constant expressions.
SourceLocation PragmaSectionLocation
SectionInfo(NamedDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)
Copy initialization expr of a __block variable and a boolean flag that indicates whether the expressi...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
Holds information about the various types of exception specification.
Extra information about a function prototype.
A cache of the value of this pointer, in the most recent generation in which we queried it.
A lazy value (of type T) that is within an AST node of type Owner, where the value might change in la...
llvm::PointerUnion< T, LazyData * > ValueType
Parts of a decomposed MSGuidDecl.
Contains information gathered from parsing the contents of TargetAttr.
Describes how types, statements, expressions, and declarations should be printed.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
const Type * Ty
The locally-unqualified type.
Qualifiers Quals
The local qualifiers.
AlignRequirementKind AlignRequirement
TypeInfoChars(CharUnits Width, CharUnits Align, AlignRequirementKind AlignRequirement)
AlignRequirementKind AlignRequirement
TypeInfo(uint64_t Width, unsigned Align, AlignRequirementKind AlignRequirement)