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

32#include "llvm/ADT/DenseMap.h"

33#include "llvm/ADT/DenseMapInfo.h"

34#include "llvm/ADT/DenseSet.h"

35#include "llvm/ADT/FoldingSet.h"

36#include "llvm/ADT/IntrusiveRefCntPtr.h"

37#include "llvm/ADT/MapVector.h"

38#include "llvm/ADT/PointerIntPair.h"

39#include "llvm/ADT/PointerUnion.h"

40#include "llvm/ADT/SetVector.h"

41#include "llvm/ADT/SmallVector.h"

42#include "llvm/ADT/StringMap.h"

43#include "llvm/ADT/StringRef.h"

44#include "llvm/ADT/StringSet.h"

45#include "llvm/ADT/TinyPtrVector.h"

46#include "llvm/Support/TypeSize.h"

47#include

48

49namespace llvm {

50

51class APFixedPoint;

53struct fltSemantics;

54template <typename T, unsigned N> class SmallPtrSet;

55

66

67

68

71 return {DenseMapInfoclang::QualType::getEmptyKey(), ~0U, ~0U};

72 }

74 return {DenseMapInfoclang::QualType::getTombstoneKey(), ~0U, ~0U};

75 }

77 return hash_combine(DenseMapInfoclang::QualType::getHashValue(Val.EltTy),

79 }

82 return LHS == RHS;

83 }

84};

85

86}

87

89

135class TargetAttr;

147

148

150

156

159

165

171

174}

175

177

179

180

182

183

185

186

188};

189

203

217

218

219

220class ASTContext : public RefCountedBase {

222

224 mutable llvm::FoldingSet ExtQualNodes;

225 mutable llvm::FoldingSet ComplexTypes;

226 mutable llvm::FoldingSet PointerTypes{GeneralTypesLog2InitSize};

227 mutable llvm::FoldingSet AdjustedTypes;

228 mutable llvm::FoldingSet BlockPointerTypes;

229 mutable llvm::FoldingSet LValueReferenceTypes;

230 mutable llvm::FoldingSet RValueReferenceTypes;

231 mutable llvm::FoldingSet MemberPointerTypes;

232 mutable llvm::ContextualFoldingSet<ConstantArrayType, ASTContext &>

233 ConstantArrayTypes;

234 mutable llvm::FoldingSet IncompleteArrayTypes;

235 mutable std::vector<VariableArrayType*> VariableArrayTypes;

236 mutable llvm::ContextualFoldingSet<DependentSizedArrayType, ASTContext &>

237 DependentSizedArrayTypes;

238 mutable llvm::ContextualFoldingSet<DependentSizedExtVectorType, ASTContext &>

239 DependentSizedExtVectorTypes;

240 mutable llvm::ContextualFoldingSet<DependentAddressSpaceType, ASTContext &>

241 DependentAddressSpaceTypes;

242 mutable llvm::FoldingSet VectorTypes;

243 mutable llvm::ContextualFoldingSet<DependentVectorType, ASTContext &>

244 DependentVectorTypes;

245 mutable llvm::FoldingSet MatrixTypes;

246 mutable llvm::ContextualFoldingSet<DependentSizedMatrixType, ASTContext &>

247 DependentSizedMatrixTypes;

248 mutable llvm::FoldingSet FunctionNoProtoTypes;

249 mutable llvm::ContextualFoldingSet<FunctionProtoType, ASTContext&>

250 FunctionProtoTypes;

251 mutable llvm::ContextualFoldingSet<DependentTypeOfExprType, ASTContext &>

252 DependentTypeOfExprTypes;

253 mutable llvm::ContextualFoldingSet<DependentDecltypeType, ASTContext &>

254 DependentDecltypeTypes;

255

256 mutable llvm::ContextualFoldingSet<PackIndexingType, ASTContext &>

257 DependentPackIndexingTypes;

258

259 mutable llvm::FoldingSet TemplateTypeParmTypes;

260 mutable llvm::FoldingSet ObjCTypeParamTypes;

261 mutable llvm::FoldingSet

262 SubstTemplateTypeParmTypes;

263 mutable llvm::FoldingSet

264 SubstTemplateTypeParmPackTypes;

265 mutable llvm::FoldingSet

266 SubstBuiltinTemplatePackTypes;

267 mutable llvm::ContextualFoldingSet<TemplateSpecializationType, ASTContext&>

268 TemplateSpecializationTypes;

269 mutable llvm::FoldingSet ParenTypes{GeneralTypesLog2InitSize};

270 mutable llvm::FoldingSet TagTypes;

271 mutable llvm::FoldingSet<FoldingSetPlaceholder>

272 UnresolvedUsingTypes;

273 mutable llvm::FoldingSet UsingTypes;

274 mutable llvm::FoldingSet<FoldingSetPlaceholder> TypedefTypes;

275 mutable llvm::FoldingSet DependentNameTypes;

276 mutable llvm::FoldingSet PackExpansionTypes;

277 mutable llvm::FoldingSet ObjCObjectTypes;

278 mutable llvm::FoldingSet ObjCObjectPointerTypes;

279 mutable llvm::FoldingSet UnaryTransformTypes;

280

281

282

283

284 mutable llvm::DenseMap<llvm::FoldingSetNodeID, AutoType *> AutoTypes;

285 mutable llvm::FoldingSet

286 DeducedTemplateSpecializationTypes;

287 mutable llvm::FoldingSet AtomicTypes;

288 mutable llvm::FoldingSet AttributedTypes;

289 mutable llvm::FoldingSet PipeTypes;

290 mutable llvm::FoldingSet BitIntTypes;

291 mutable llvm::ContextualFoldingSet<DependentBitIntType, ASTContext &>

292 DependentBitIntTypes;

293 mutable llvm::FoldingSet BTFTagAttributedTypes;

294 llvm::FoldingSet HLSLAttributedResourceTypes;

295 llvm::FoldingSet HLSLInlineSpirvTypes;

296

297 mutable llvm::FoldingSet CountAttributedTypes;

298

299 mutable llvm::FoldingSet QualifiedTemplateNames;

300 mutable llvm::FoldingSet DependentTemplateNames;

301 mutable llvm::FoldingSet

302 SubstTemplateTemplateParms;

303 mutable llvm::ContextualFoldingSet<SubstTemplateTemplateParmPackStorage,

305 SubstTemplateTemplateParmPacks;

306 mutable llvm::ContextualFoldingSet<DeducedTemplateStorage, ASTContext &>

307 DeducedTemplates;

308

309 mutable llvm::ContextualFoldingSet<ArrayParameterType, ASTContext &>

310 ArrayParameterTypes;

311

312

313 mutable std::array<Type *,

315 PredefinedSugarTypes{};

316

317

318

319

320 mutable llvm::FoldingSet

321 NamespaceAndPrefixStorages;

322

323

324

325

326 mutable llvm::DenseMap<const RecordDecl*, const ASTRecordLayout*>

327 ASTRecordLayouts;

328 mutable llvm::DenseMap<const ObjCInterfaceDecl *, const ASTRecordLayout *>

329 ObjCLayouts;

330

331

332 using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;

333 mutable TypeInfoMap MemoizedTypeInfo;

334

335

336

337

338 using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;

339 mutable UnadjustedAlignMap MemoizedUnadjustedAlign;

340

341

342 llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;

343

344

345 llvm::DenseMap<ObjCContainerDecl*, ObjCImplDecl*> ObjCImpls;

346

347

348

349 llvm::DenseMap<const ObjCMethodDecl*,const ObjCMethodDecl*> ObjCMethodRedecls;

350

351

352 llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;

353

354

355 mutable llvm::FoldingSet MSGuidDecls;

356

357

358 mutable llvm::FoldingSet

359 UnnamedGlobalConstantDecls;

360

361

362 mutable llvm::FoldingSet TemplateParamObjectDecls;

363

364

365

366

367

368 mutable llvm::StringMap<StringLiteral *> StringLiteralCache;

369

370 mutable llvm::DenseSet<const FunctionDecl *> DestroyingOperatorDeletes;

371 mutable llvm::DenseSet<const FunctionDecl *> TypeAwareOperatorNewAndDeletes;

372

373

374

375

376 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>

377 OperatorDeletesForVirtualDtor;

378 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>

379 GlobalOperatorDeletesForVirtualDtor;

380 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>

381 ArrayOperatorDeletesForVirtualDtor;

382 mutable llvm::DenseMap<const CXXDestructorDecl *, FunctionDecl *>

383 GlobalArrayOperatorDeletesForVirtualDtor;

384

385

386 llvm::DenseSet<const CXXRecordDecl *> RequireVectorDeletingDtor;

387

388

389

390

391

392

393

394 unsigned NextStringLiteralVersion = 0;

395

396

397

398 mutable std::string CUIDHash;

399

400

401

402 class CanonicalTemplateTemplateParm : public llvm::FoldingSetNode {

403 TemplateTemplateParmDecl *Parm;

404

405 public:

406 CanonicalTemplateTemplateParm(TemplateTemplateParmDecl *Parm)

407 : Parm(Parm) {}

408

409 TemplateTemplateParmDecl *getParam() const { return Parm; }

410

411 void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C) {

412 Profile(ID, C, Parm);

413 }

414

415 static void Profile(llvm::FoldingSetNodeID &ID,

417 TemplateTemplateParmDecl *Parm);

418 };

419 mutable llvm::ContextualFoldingSet<CanonicalTemplateTemplateParm,

421 CanonTemplateTemplateParms;

422

423

424 mutable TypedefDecl *Int128Decl = nullptr;

425

426

427 mutable TypedefDecl *UInt128Decl = nullptr;

428

429

430

431 mutable TypedefDecl *BuiltinVaListDecl = nullptr;

432

433

434 mutable TypedefDecl *BuiltinMSVaListDecl = nullptr;

435

436

437 mutable TypedefDecl *ObjCIdDecl = nullptr;

438

439

440 mutable TypedefDecl *ObjCSelDecl = nullptr;

441

442

443 mutable TypedefDecl *ObjCClassDecl = nullptr;

444

445

446 mutable ObjCInterfaceDecl *ObjCProtocolClassDecl = nullptr;

447

448

449 mutable TypedefDecl *BOOLDecl = nullptr;

450

451

452

453 QualType ObjCIdRedefinitionType;

454 QualType ObjCClassRedefinitionType;

455 QualType ObjCSelRedefinitionType;

456

457

458 mutable IdentifierInfo *BoolName = nullptr;

459

460

461 mutable IdentifierInfo *NSObjectName = nullptr;

462

463

464 IdentifierInfo *NSCopyingName = nullptr;

465

466#define BuiltinTemplate(BTName) mutable IdentifierInfo *Name##BTName = nullptr;

467#include "clang/Basic/BuiltinTemplates.inc"

468

469 QualType ObjCConstantStringType;

470 mutable RecordDecl *CFConstantStringTagDecl = nullptr;

471 mutable TypedefDecl *CFConstantStringTypeDecl = nullptr;

472

473 mutable QualType ObjCSuperType;

474

475 QualType ObjCNSStringType;

476

477

478 TypedefDecl *ObjCInstanceTypeDecl = nullptr;

479

480

481 TypeDecl *FILEDecl = nullptr;

482

483

484 TypeDecl *jmp_bufDecl = nullptr;

485

486

487 TypeDecl *sigjmp_bufDecl = nullptr;

488

489

490 TypeDecl *ucontext_tDecl = nullptr;

491

492

493

494

495

496 mutable RecordDecl *BlockDescriptorType = nullptr;

497

498

499

500

501

502 mutable RecordDecl *BlockDescriptorExtendedType = nullptr;

503

504

505 FunctionDecl *cudaConfigureCallDecl = nullptr;

506

507 FunctionDecl *cudaGetParameterBufferDecl = nullptr;

508

509 FunctionDecl *cudaLaunchDeviceDecl = nullptr;

510

511

512

513

514

515 llvm::DenseMap<const Decl*, AttrVec*> DeclAttrs;

516

517

518

519

520 llvm::DenseMap<Decl*, Decl*> MergedDecls;

521

522

523

524

525 llvm::DenseMap<NamedDecl*, llvm::TinyPtrVector<Module*>> MergedDefModules;

526

527

528

529

530

531 struct PerModuleInitializers {

534

536 };

537 llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;

538

539

540 Module *CurrentCXXNamedModule = nullptr;

541

542

543

544

545

546

547 mutable llvm::StringMap<const Module *> PrimaryModuleNameMap;

548 mutable llvm::DenseMap<const Module *, const Module *> SameModuleLookupSet;

549

550 static constexpr unsigned ConstantArrayTypesLog2InitSize = 8;

551 static constexpr unsigned GeneralTypesLog2InitSize = 9;

552 static constexpr unsigned FunctionProtoTypesLog2InitSize = 12;

553

554

555 llvm::DenseMap<const ObjCInterfaceDecl *,

556 SmallVector<const ObjCInterfaceDecl *, 4>>

557 ObjCSubClasses;

558

559

560 mutable llvm::DenseMap<llvm::ScalableVecTyKey, QualType> ScalableVecTyMap;

561

562 ASTContext &this_() { return *this; }

563

564public:

565

567 llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>;

568

569private:

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607 llvm::DenseMap<const VarDecl *, TemplateOrSpecializationInfo>

608 TemplateOrInstantiation;

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633 llvm::DenseMap<NamedDecl *, NamedDecl *> InstantiatedFromUsingDecl;

634

635

636

637

638

639

640

641

642 llvm::DenseMap<UsingEnumDecl *, UsingEnumDecl *>

643 InstantiatedFromUsingEnumDecl;

644

645

646 llvm::DenseMap<UsingShadowDecl*, UsingShadowDecl*>

647 InstantiatedFromUsingShadowDecl;

648

649 llvm::DenseMap<FieldDecl *, FieldDecl *> InstantiatedFromUnnamedFieldDecl;

650

651

652

653

654

655

656

657 using CXXMethodVector = llvm::TinyPtrVector<const CXXMethodDecl *>;

658 llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;

659

660

661

662

663 llvm::DenseMap<const DeclContext *, std::unique_ptr>

664 MangleNumberingContexts;

665 llvm::DenseMap<const Decl *, std::unique_ptr>

666 ExtraMangleNumberingContexts;

667

668

669

670 llvm::MapVector<const NamedDecl *, unsigned> MangleNumbers;

671 llvm::MapVector<const VarDecl *, unsigned> StaticLocalNumbers;

672

673 mutable llvm::DenseMap<const CXXRecordDecl *, unsigned>

674 DeviceLambdaManglingNumbers;

675

676

677

678 using ParameterIndexTable = llvm::DenseMap<const VarDecl *, unsigned>;

679 ParameterIndexTable ParamIndices;

680

681public:

686 std::optional

690

691

692

693

694

695

697 if (!isPointerAuthenticationAvailable())

698 return false;

699 return findPointerAuthContent(T) != PointerAuthContent::None;

700 }

701

702

703

704

705

706

708 if (!isPointerAuthenticationAvailable())

709 return false;

710 return findPointerAuthContent(T) != PointerAuthContent::None;

711 }

712

713private:

714 llvm::DenseMap<const CXXRecordDecl *, CXXRecordDeclRelocationInfo>

715 RelocatableClasses;

716

717

718 enum class PointerAuthContent : uint8_t {

720 AddressDiscriminatedVTable,

721 AddressDiscriminatedData

722 };

723

724

725 bool isPointerAuthenticationAvailable() const {

726 return LangOpts.PointerAuthCalls || LangOpts.PointerAuthIntrinsics;

727 }

728 PointerAuthContent findPointerAuthContent(QualType T) const;

729 mutable llvm::DenseMap<const RecordDecl *, PointerAuthContent>

730 RecordContainsAddressDiscriminatedPointerAuth;

731

732 ImportDecl *FirstLocalImport = nullptr;

733 ImportDecl *LastLocalImport = nullptr;

734

735 TranslationUnitDecl *TUDecl = nullptr;

736 mutable ExternCContextDecl *ExternCContext = nullptr;

737

738#define BuiltinTemplate(BTName) \

739 mutable BuiltinTemplateDecl *Decl##BTName = nullptr;

740#include "clang/Basic/BuiltinTemplates.inc"

741

742

743 SourceManager &SourceMgr;

744

745

746

747 LangOptions &LangOpts;

748

749

750

751 std::unique_ptr NoSanitizeL;

752

753

754

755 std::unique_ptr XRayFilter;

756

757

758

759 std::unique_ptr ProfList;

760

761

762

763

764

765 mutable llvm::BumpPtrAllocator BumpAlloc;

766

767

769

770

771 std::unique_ptr ABI;

772 CXXABI *createCXXABI(const TargetInfo &T);

773

774

775

776 bool AddrSpaceMapMangling;

777

778

779 mutable bool AnyFunctionEffects = false;

780

781 const TargetInfo *Target = nullptr;

782 const TargetInfo *AuxTarget = nullptr;

783 clang::PrintingPolicy PrintingPolicy;

784 std::unique_ptrinterp::Context InterpContext;

785 std::unique_ptr ParentMapCtx;

786

787

788 DeclListNode *ListNodeFreeList = nullptr;

789

790public:

798

799

801

815

816

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

839

840

841

843

845 return PrintingPolicy;

846 }

847

849 PrintingPolicy = Policy;

850 }

851

854

855

856

857

858

860

862 return BumpAlloc;

863 }

864

865 void *Allocate(size_t Size, unsigned Align = 8) const {

866 return BumpAlloc.Allocate(Size, Align);

867 }

872

873 llvm::StringRef backupStr(llvm::StringRef S) const {

874 char *Buf = new (*this) char[S.size()];

875 llvm::copy(S, Buf);

876 return llvm::StringRef(Buf, S.size());

877 }

878

879

880

882 if (DeclListNode *Alloc = ListNodeFreeList) {

883 ListNodeFreeList = dyn_cast_if_present<DeclListNode *>(Alloc->Rest);

884 Alloc->D = ND;

885 Alloc->Rest = nullptr;

886 return Alloc;

887 }

889 }

890

891

893 N->Rest = ListNodeFreeList;

894 ListNodeFreeList = N;

895 }

896

897

898

900 return BumpAlloc.getTotalMemory();

901 }

902

903

905

907 return DiagAllocator;

908 }

909

912

915 switch (CurrentBT->getKind()) {

916 case BuiltinType::Kind::Half:

917 case BuiltinType::Kind::Float16:

919 case BuiltinType::Kind::Float:

920 case BuiltinType::Kind::BFloat16:

922 case BuiltinType::Kind::Double:

924 default:

925 return ElementType;

926 }

927 return ElementType;

928 }

929

930

931

932

933

935 unsigned Signed) const;

936

937

938

939

942

944

946

947

948

949

950

952 return LangOpts.CPlusPlus || LangOpts.RecoveryAST;

953 }

954

956

959

961 return *XRayFilter;

962 }

963

965

967

971

972

973

974

976

977

979

980

982

983

984

985

986

987 mutable llvm::DenseMap<const Decl *, const RawComment *> DeclRawComments;

988

989

990

991

992

993

995

996

997

998

999

1000

1001

1002

1004

1005

1006

1007 mutable llvm::DenseMap<const Decl *, comments::FullComment *> ParsedComments;

1008

1009

1010

1011

1012

1013

1016

1017

1018

1019

1020

1021

1024 const std::map<unsigned, RawComment *> &CommentsInFile) const;

1025

1026

1027

1029

1030public:

1032

1033

1034

1035

1036

1037

1040 const Decl **OriginalDecl = nullptr) const;

1041

1042

1043

1044

1045

1046

1047

1048

1051

1052

1053

1054

1055

1056

1059

1060

1061

1062

1064

1066 const Decl *D) const;

1067

1068private:

1070

1071

1072 class import_iterator {

1074

1075 public:

1079 using difference_type = int;

1080 using iterator_category = std::forward_iterator_tag;

1081

1082 import_iterator() = default;

1083 explicit import_iterator(ImportDecl *Import) : Import(Import) {}

1084

1085 reference operator*() const { return Import; }

1086 pointer operator->() const { return Import; }

1087

1088 import_iterator &operator++() {

1090 return *this;

1091 }

1092

1093 import_iterator operator++(int) {

1094 import_iterator Other(*this);

1095 ++(*this);

1097 }

1098

1099 friend bool operator==(import_iterator X, import_iterator Y) {

1100 return X.Import == Y.Import;

1101 }

1102

1103 friend bool operator!=(import_iterator X, import_iterator Y) {

1104 return X.Import != Y.Import;

1105 }

1106 };

1107

1108public:

1110 return CommentCommandTraits;

1111 }

1112

1113

1115

1116

1118

1119

1120

1121

1122

1125

1126

1127

1131

1134

1137

1138

1139

1141

1142

1143

1145

1146

1147

1149

1150

1151

1154

1158

1160

1162

1163

1167

1170

1172

1174 llvm::iterator_range<overridden_cxx_method_iterator>;

1175

1177

1178

1179

1182

1183

1184

1185

1186

1187

1188

1189

1193

1194

1195

1197

1199 return Import->getNextLocalImport();

1200 }

1201

1203

1205 return import_range(import_iterator(FirstLocalImport), import_iterator());

1206 }

1207

1213 MergedDecls[D] = Primary;

1214 }

1215

1216

1217

1219 bool NotifyListeners = true);

1220

1221

1222

1224

1225

1226

1228

1229

1230

1231

1232

1234

1236

1237

1239

1240

1242

1243

1245

1246

1247

1248

1249

1251

1253 assert(TUDecl->getMostRecentDecl() == TUDecl &&

1254 "The active TU is not current one!");

1255 return TUDecl->getMostRecentDecl();

1256 }

1260 if (TraversalScope.empty() || TraversalScope.back() == TUDecl)

1261 TraversalScope = {NewTUDecl};

1262 if (TUDecl)

1264 TUDecl = NewTUDecl;

1265 }

1266

1268

1269#define BuiltinTemplate(BTName) BuiltinTemplateDecl *get##BTName##Decl() const;

1270#include "clang/Basic/BuiltinTemplates.inc"

1271

1272

1278 CanQualType WIntTy;

1307#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \

1308 CanQualType SingletonId;

1309#include "clang/Basic/OpenCLImageTypes.def"

1315#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \

1316 CanQualType Id##Ty;

1317#include "clang/Basic/OpenCLExtensionTypes.def"

1318#define SVE_TYPE(Name, Id, SingletonId) \

1319 CanQualType SingletonId;

1320#include "clang/Basic/AArch64ACLETypes.def"

1321#define PPC_VECTOR_TYPE(Name, Id, Size) \

1322 CanQualType Id##Ty;

1323#include "clang/Basic/PPCTypes.def"

1324#define RVV_TYPE(Name, Id, SingletonId) \

1325 CanQualType SingletonId;

1326#include "clang/Basic/RISCVVTypes.def"

1327#define WASM_TYPE(Name, Id, SingletonId) CanQualType SingletonId;

1328#include "clang/Basic/WebAssemblyReferenceTypes.def"

1329#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \

1330 CanQualType SingletonId;

1331#include "clang/Basic/AMDGPUTypes.def"

1332#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) CanQualType SingletonId;

1333#include "clang/Basic/HLSLIntangibleTypes.def"

1334

1335

1338

1339

1340

1342

1343

1345

1346

1348

1349

1350

1351

1352

1354

1355

1356

1358

1359

1360

1362

1363

1364

1365

1366 llvm::DenseMap<CanQualType, SYCLKernelInfo> SYCLKernels;

1367

1368

1369

1370

1371

1373

1380

1381

1382

1383

1384

1385

1387

1388

1389

1393

1394

1395

1399

1400

1401

1402

1403

1404

1408

1409

1410

1412

1415

1418

1419

1420

1422 StringRef Name,

1424

1425

1427

1428

1430

1431

1433

1434

1435

1436

1437

1438private:

1439

1441

1443

1444public:

1445

1446

1447

1448

1449

1450

1452

1453

1454

1455

1456

1457

1459

1460

1461

1462 uint16_t

1464

1465

1467

1468

1469

1470

1471

1474 bool allowOnPointerType = false) const;

1475

1476

1477

1478

1479

1480

1482

1483

1484

1486

1487

1488

1489

1490

1491

1495

1496

1497

1498

1499

1500

1504

1505

1506

1507

1508

1509

1510

1511

1513

1514

1515

1516

1519

1520

1523

1524

1525

1528

1529

1531

1532

1534

1535

1536

1537

1538

1541

1542

1543

1545

1546

1547

1550 bool AsWritten = false);

1551

1552

1553

1554

1556

1557

1558

1560

1561

1562

1564

1565

1566

1568

1569

1570

1575

1576

1577

1582

1585 bool OrNull,

1587

1588

1589

1595

1596

1597

1598

1603

1604

1606

1607

1608

1610

1611

1612

1614

1615

1616

1618

1619

1620

1622

1623

1625

1626

1628

1629

1630

1632

1633

1634

1636

1638

1639

1640

1642

1643

1645

1646

1648

1649

1654

1656 cudaConfigureCallDecl = FD;

1657 }

1658

1660 return cudaConfigureCallDecl;

1661 }

1662

1664 cudaGetParameterBufferDecl = FD;

1665 }

1666

1668 return cudaGetParameterBufferDecl;

1669 }

1670

1672

1674

1675

1677

1678

1679

1680

1683 bool &HasByrefExtendedLayout) const;

1684

1685

1686

1688 const;

1689

1690

1691

1693

1694

1695

1698

1699

1700

1703 unsigned IndexTypeQuals) const;

1704

1705

1706

1707

1708

1709

1712 unsigned IndexTypeQuals) const;

1713

1714

1715

1717 unsigned IndexTypeQuals) const;

1718

1719

1720

1723 unsigned IndexTypeQuals) const;

1724

1725

1726

1728

1729

1731

1732

1735 llvm::ElementCount EC;

1740 };

1741

1742

1743

1744 BuiltinVectorTypeInfo

1746

1747

1748

1749

1750

1751

1752

1754 unsigned NumFields = 1) const;

1755

1756

1758

1759

1760

1761

1762

1765

1766

1770

1771

1772

1773

1774

1776

1777

1778

1779

1780

1781

1783 Expr *SizeExpr,

1785

1786

1787

1788

1789

1790

1792 unsigned NumColumns) const;

1793

1794

1795

1797 Expr *ColumnExpr,

1799

1801 Expr *AddrSpaceExpr,

1803

1804

1807

1811

1812

1815 return getFunctionTypeInternal(ResultTy, Args, EPI, false);

1816 }

1817

1819

1820private:

1821

1824 bool OnlyWantCanonical) const;

1827 bool IsDependent, bool IsPack = false,

1828 TemplateDecl *TypeConstraintConcept = nullptr,

1830 bool IsCanon = false) const;

1831

1832public:

1835 const TypeDecl *Decl) const;

1836

1837

1838

1840

1841

1846

1848

1852

1853

1854

1855

1856

1860 std::optional TypeMatchesDeclOrNone = std::nullopt) const;

1861

1865 bool OwnsTag) const;

1866

1867private:

1871 const Type *CanonicalType) const;

1872

1875 bool OwnsTag, bool IsInjected,

1876 const Type *CanonicalType,

1877 bool WithFoldingSetNode) const;

1878

1879public:

1880

1881

1882

1884 unsigned NumPositiveBits, QualType &BestType,

1885 QualType &BestPromotionType);

1886

1887

1888

1890

1891

1892

1893 template

1895 unsigned &NumPositiveBits) {

1896 NumNegativeBits = 0;

1897 NumPositiveBits = 0;

1898 bool MembersRepresentableByInt = true;

1899 for (auto *Elem : EnumConstants) {

1900 EnumConstantDecl *ECD = cast_or_null(Elem);

1901 if (!ECD)

1902 continue;

1903

1904 llvm::APSInt InitVal = ECD->getInitVal();

1905 if (InitVal.isUnsigned() || InitVal.isNonNegative()) {

1906

1907

1908 unsigned ActiveBits = InitVal.getActiveBits();

1909 NumPositiveBits = std::max({NumPositiveBits, ActiveBits, 1u});

1910 } else {

1911 NumNegativeBits =

1912 std::max(NumNegativeBits, InitVal.getSignificantBits());

1913 }

1914

1916 }

1917

1918

1919

1920

1921

1922 if (!NumPositiveBits && !NumNegativeBits)

1923 NumPositiveBits = 1;

1924

1925 return MembersRepresentableByInt;

1926 }

1927

1933

1936 const Attr *attr = nullptr) const;

1937

1939 QualType equivalentType) const;

1940

1943

1946

1949 const HLSLAttributedResourceType::Attributes &Attrs);

1950

1952 uint32_t Alignment,

1954

1956 Decl *AssociatedDecl, unsigned Index,

1958 bool Final) const;

1960 unsigned Index, bool Final,

1963

1966 bool ParameterPack,

1968

1972

1978

1984

1992

1994

1997

2001

2003

2004

2005

2006

2007

2008

2009

2010

2012 bool ExpectPackInType = true) const;

2013

2016

2017

2020 unsigned NumProtocols) const;

2021

2025 bool isKindOf) const;

2026

2031

2033

2034

2035

2036

2039

2040

2042

2043

2046

2048

2049

2051

2053 bool FullySubstituted = false,

2055 UnsignedOrNone Index = std::nullopt) const;

2056

2057

2059 UnaryTransformType::UTTKind UKind) const;

2060

2061

2062 QualType

2064 bool IsPack = false,

2065 TemplateDecl *TypeConstraintConcept = nullptr,

2067

2068

2070

2071

2073

2074

2075

2077

2078

2081 QualType DeducedType,

2082 bool IsDependent) const;

2083

2084private:

2085 QualType getDeducedTemplateSpecializationTypeInternal(

2087 QualType DeducedType, bool IsDependent, QualType Canon) const;

2088

2089public:

2090

2091

2092

2093

2095

2097

2098

2099

2101

2102

2103

2105

2106

2107

2109

2110

2111

2113

2114

2115

2116

2118

2119

2120

2121

2123

2124

2125

2126

2128

2129

2130

2132

2133

2134

2136

2137

2138

2140

2141

2142

2144

2145

2146

2147

2149

2150

2151

2153

2154

2156

2157

2160

2161

2162

2164 if (CFConstantStringTypeDecl)

2166 std::nullopt,

2167 CFConstantStringTypeDecl);

2169 }

2173

2174

2177 return ObjCConstantStringType;

2178 }

2179

2181 return ObjCNSStringType;

2182 }

2183

2185 ObjCNSStringType = T;

2186 }

2187

2188

2189

2191 if (ObjCIdRedefinitionType.isNull())

2193 return ObjCIdRedefinitionType;

2194 }

2195

2196

2198 ObjCIdRedefinitionType = RedefType;

2199 }

2200

2201

2202

2204 if (ObjCClassRedefinitionType.isNull())

2206 return ObjCClassRedefinitionType;

2207 }

2208

2209

2211 ObjCClassRedefinitionType = RedefType;

2212 }

2213

2214

2215

2217 if (ObjCSelRedefinitionType.isNull())

2219 return ObjCSelRedefinitionType;

2220 }

2221

2222

2224 ObjCSelRedefinitionType = RedefType;

2225 }

2226

2227

2229 if (!NSObjectName) {

2230 NSObjectName = &Idents.get("NSObject");

2231 }

2232

2233 return NSObjectName;

2234 }

2235

2236

2238 if (!NSCopyingName) {

2239 NSCopyingName = &Idents.get("NSCopying");

2240 }

2241

2242 return NSCopyingName;

2243 }

2244

2246

2248

2249

2251 if (!BoolName)

2252 BoolName = &Idents.get("bool");

2253 return BoolName;

2254 }

2255

2256#define BuiltinTemplate(BTName) \

2257 IdentifierInfo *get##BTName##Name() const { \

2258 if (!Name##BTName) \

2259 Name##BTName = &Idents.get(#BTName); \

2260 return Name##BTName; \

2261 }

2262#include "clang/Basic/BuiltinTemplates.inc"

2263

2264

2267 std::nullopt,

2269 }

2270

2271

2272

2274

2275

2277

2278

2280 if (FILEDecl)

2282 std::nullopt, FILEDecl);

2284 }

2285

2286

2288 this->jmp_bufDecl = jmp_bufDecl;

2289 }

2290

2291

2293 if (jmp_bufDecl)

2295 std::nullopt, jmp_bufDecl);

2297 }

2298

2299

2301 this->sigjmp_bufDecl = sigjmp_bufDecl;

2302 }

2303

2304

2306 if (sigjmp_bufDecl)

2308 std::nullopt, sigjmp_bufDecl);

2310 }

2311

2312

2314 this->ucontext_tDecl = ucontext_tDecl;

2315 }

2316

2317

2319 if (ucontext_tDecl)

2321 std::nullopt, ucontext_tDecl);

2323 }

2324

2325

2329

2330

2331

2332

2333

2336 QualType *NotEncodedT=nullptr) const;

2337

2338

2339

2341

2343

2344

2346 std::string &S) const;

2347

2348

2349

2350

2351

2352

2353

2355

2356

2357

2359 bool Extended = false) const;

2360

2361

2363

2364

2365

2366

2367

2369 const Decl *Container) const;

2370

2373

2376 const Decl *Container) const;

2377

2378

2379

2381

2382

2383

2385

2386

2387

2388

2389

2394

2395

2396

2398

2399

2400

2405

2407

2408

2409

2411

2412

2413

2414

2415

2420

2421

2422

2424

2425

2427 return BOOLDecl;

2428 }

2429

2430

2432 BOOLDecl = TD;

2433 }

2434

2435

2440

2441

2445

2446

2447

2449

2450

2455

2456

2457

2458

2460

2461

2462

2464

2465

2470

2471

2473

2474

2476 assert(MSGuidTagDecl && "asked for GUID type but MS extensions disabled");

2478 }

2479

2480

2487

2488

2489

2491

2492

2493

2497

2498

2502

2503

2509 return getExtQualType(Ptr, Qc);

2510 }

2511

2512

2516 return getExtQualType(T, Qs);

2517 }

2518

2519

2520

2521

2531

2532

2533

2535 if (type.getTypePtr()->isObjCObjectPointerType() ||

2536 type.getQualifiers().hasObjCLifetime())

2537 return type;

2541 }

2542

2543

2546 assert(PointerAuth);

2547

2551 }

2552

2558

2561

2565

2567 bool TemplateKeyword,

2571

2573 Decl *AssociatedDecl,

2574 unsigned Index,

2576 bool Final) const;

2578 Decl *AssociatedDecl,

2579 unsigned Index,

2580 bool Final) const;

2581

2582

2583

2584

2585

2586

2587

2590

2592

2594

2595

2597

2598

2600

2601

2603

2604

2606 };

2607

2610 bool &RequireICE, bool AllowTypeModifiers) const;

2611

2612

2613

2614

2615

2616

2618 unsigned *IntegerConstantArgs = nullptr) const;

2619

2620

2621

2623

2624private:

2627

2628

2629

2630

2631

2632public:

2633

2634

2636

2637

2638

2639

2640

2641

2643

2644

2645

2646

2648

2649

2650

2651

2652

2654

2655

2656

2657

2659

2660

2661

2665

2666

2667

2668

2669

2670

2671

2673

2674

2677

2678

2680

2681

2684

2685

2689

2690

2692

2693

2695

2696

2697

2700

2703 return std::nullopt;

2705 }

2706

2710

2711

2712

2715

2716

2717

2718

2719

2720

2725

2726

2727

2728

2729

2730

2732 bool NeedsPreferredAlignment = false) const;

2733

2734

2735

2738

2739

2740

2744

2745

2746

2747

2750

2751

2752

2754

2757

2758

2759

2762

2763

2765

2766

2767

2768

2769

2770

2771

2772

2777

2778

2779

2781

2782

2783

2784

2786

2787

2788

2789

2791

2792

2793

2795

2796

2797

2798

2799

2800

2801

2802

2803

2804

2805

2807

2808

2809

2810

2812

2813

2814

2816

2817

2818

2819

2821

2822

2823

2825 const;

2826

2828 bool Simple = false) const;

2829

2830

2831

2832

2833

2834

2835

2836

2837

2838

2839

2841

2842

2843

2844

2845

2846

2847

2848

2849

2851

2852

2853

2854

2855

2856

2857

2858

2859

2860

2862

2863

2865

2866

2869

2870

2871

2873

2875

2877

2878

2880

2881

2882

2883

2884

2886

2889

2893

2894

2895

2896 bool

2898 bool CheckIfTriviallyCopyable = true) const;

2899

2900

2901

2902

2903

2904

2905

2906

2907

2908

2909

2910

2911

2915

2917 return T->getCanonicalTypeInternal().getTypePtr();

2918 }

2919

2920

2921

2922

2923

2924

2926

2927

2934

2935

2937

2938

2939

2940

2941

2942

2943

2944

2945

2946

2947

2948

2949

2950

2956

2957

2958

2963

2965 bool IsParam) const {

2968 if (SubTnullability.has_value() == SuperTnullability.has_value()) {

2969

2970 if (!SubTnullability)

2971 return true;

2972

2973 if (*SubTnullability == *SuperTnullability ||

2976 return true;

2977

2978 if (IsParam) {

2979

2980

2983 }

2984

2985

2988 }

2989 return true;

2990 }

2991

2994

2996 bool AllowPiMismatch = true) const;

2998 bool AllowPiMismatch = true) const;

2999

3000

3001

3002

3003

3004

3005

3006

3008

3009

3011

3012

3013

3014

3015

3016

3017

3019 bool IsCXXMethod) const;

3020

3021

3022

3023

3024

3025

3026

3027

3028

3029

3030

3031

3032

3033

3034

3035

3036

3037

3038

3040 bool IgnoreDeduced = false) const;

3041

3042

3043

3045 bool IgnoreDeduced = false) const;

3046

3047

3049

3050

3051

3054

3055

3056

3058

3059

3060

3061

3062

3063

3066

3067

3068

3069

3070

3071

3073

3074

3075

3078

3079

3080

3083

3084

3085

3086

3087

3088

3090 const;

3091

3092

3093

3094

3095 bool

3097

3098

3101

3106

3107

3108

3111

3112

3113

3114

3115

3124 return dyn_cast_or_null(getAsArrayType(T));

3125 }

3127 const {

3128 return dyn_cast_or_null(getAsArrayType(T));

3129 }

3130

3131

3132

3133

3135

3136

3137

3139

3140

3142

3143

3144 uint64_t

3146

3147

3148

3149

3150

3151

3153

3154

3155

3156

3158

3160

3161

3162

3163

3164

3165

3166

3167

3168

3170

3171

3172

3174

3175

3176

3178

3179

3180

3181

3182

3183

3185

3186

3187

3188

3189

3191

3192

3193

3194

3195

3196

3198

3199

3200

3201

3203

3205

3207

3208

3209

3211

3215

3217

3218

3219

3220

3225 bool AcceptDependent) const;

3226

3227

3228

3229

3230

3231

3234

3235private:

3236

3237 unsigned getIntegerRank(const Type *T) const;

3238

3239public:

3240

3241

3242

3243

3244

3246 bool CompareUnqualified = false);

3247

3250

3252

3254

3256

3259 bool ForCompare);

3260

3263

3264

3272 bool BlockReturnType);

3277

3278

3280 bool Unqualified = false, bool BlockReturnType = false,

3281 bool IsConditionalOperator = false);

3283 bool Unqualified = false, bool AllowCXX = false,

3284 bool IsConditionalOperator = false);

3286 bool OfBlockPointer = false,

3289 bool OfBlockPointer=false,

3292

3294

3295

3296

3297

3298

3299

3300

3301

3302

3303

3304

3305

3306

3307

3308

3309

3310

3311

3312

3313

3317 bool &CanUseFirst, bool &CanUseSecond,

3319

3321

3324 ObjCSubClasses[D].push_back(SubClass);

3325 }

3326

3327

3328

3329

3330

3331

3332

3334

3335

3336

3337

3338

3339

3340

3342

3343

3344

3345

3346

3347

3348

3350

3351

3352

3354

3355

3356

3358

3359

3360

3361

3362

3364

3365

3366

3367

3368

3369

3370

3372

3373

3377 if (Width != Res.getBitWidth())

3378 return Res.extOrTrunc(Width);

3379 return Res;

3380 }

3381

3383

3384

3385

3387

3388

3389

3391

3392

3394 return !ObjCImpls.empty();

3395 }

3396

3397

3400

3401

3404

3405

3406

3409

3412

3413

3414

3415

3417

3418

3419

3421

3422

3423

3425

3426

3427

3428

3429

3430

3431

3432

3433

3434

3435

3436

3438

3439

3440

3441

3445

3446

3447

3448

3449

3450

3451

3452

3454

3455

3456

3458 if (!std::is_trivially_destructible::value) {

3459 auto DestroyPtr = [](void *V) { static_cast<T *>(V)->~T(); };

3461 }

3462 }

3463

3466

3467

3468

3469

3470

3471

3472

3474

3475

3476

3479 llvm::function_ref<void(FunctionDecl *)> Pred) const;

3480

3483

3486

3488

3490

3492

3494

3497 bool ForAuxTarget = false) const;

3498

3501

3503 return !TypeAwareOperatorNewAndDeletes.empty();

3504 }

3508 bool IsTypeAware);

3510

3512

3522

3523

3524

3528 const Decl *D);

3529

3531

3532

3533

3535

3536

3537

3539

3540

3541

3542

3544

3545

3546

3548

3549

3550

3552

3553

3554

3557

3558

3559

3562

3563

3564

3566

3571

3572

3573

3574

3575

3576

3577

3579

3580

3581

3582

3584

3585

3586

3587

3589

3590

3591

3592

3593

3594

3596

3597

3598

3600

3601

3603

3604

3605

3607

3608

3610

3611

3612

3614

3615

3617

3618

3619

3621

3622

3624

3625

3626

3628

3629

3631

3632

3633

3635

3636public:

3637

3638

3639

3640

3641

3642

3644 const TargetInfo *AuxTarget = nullptr);

3645

3646private:

3648

3649 class ObjCEncOptions {

3650 unsigned Bits;

3651

3652 ObjCEncOptions(unsigned Bits) : Bits(Bits) {}

3653

3654 public:

3655 ObjCEncOptions() : Bits(0) {}

3656

3657#define OPT_LIST(V) \

3658 V(ExpandPointedToStructures, 0) \

3659 V(ExpandStructures, 1) \

3660 V(IsOutermostType, 2) \

3661 V(EncodingProperty, 3) \

3662 V(IsStructField, 4) \

3663 V(EncodeBlockParameters, 5) \

3664 V(EncodeClassNames, 6) \

3665

3666#define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }

3668#undef V

3669

3670#define V(N,I) bool N() const { return Bits & 1 << I; }

3672#undef V

3673

3674#undef OPT_LIST

3675

3676 [[nodiscard]] ObjCEncOptions keepingOnly(ObjCEncOptions Mask) const {

3677 return Bits & Mask.Bits;

3678 }

3679

3680 [[nodiscard]] ObjCEncOptions forComponentType() const {

3681 ObjCEncOptions Mask = ObjCEncOptions()

3682 .setIsOutermostType()

3683 .setIsStructField();

3684 return Bits & ~Mask.Bits;

3685 }

3686 };

3687

3688

3689 void getObjCEncodingForTypeImpl(QualType t, std::string &S,

3690 ObjCEncOptions Options,

3691 const FieldDecl *Field,

3692 QualType *NotEncodedT = nullptr) const;

3693

3694

3695 void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,

3696 const FieldDecl *Field,

3697 bool includeVBases = true,

3698 QualType *NotEncodedT=nullptr) const;

3699

3700public:

3701

3703 QualType T, std::string& S,

3704 bool Extended) const;

3705

3706

3707

3709

3711

3713

3714

3716

3717

3719

3720

3722 };

3723

3724

3725

3726

3727

3728

3731

3732private:

3735

3737

3738

3739

3740

3741

3742

3743

3744

3745

3746 using DeallocationFunctionsAndArguments =

3748 mutable DeallocationFunctionsAndArguments Deallocations;

3749

3750

3751

3752

3753 llvm::PointerIntPair<StoredDeclsMap *, 1> LastSDM;

3754

3755 std::vector<Decl *> TraversalScope;

3756

3757 std::unique_ptr VTContext;

3758

3759 void ReleaseDeclContextMaps();

3760

3761public:

3771

3783

3785

3786

3788

3789

3791

3792

3794

3795

3796

3799

3801 StringRef MangledName);

3802

3804

3805private:

3806

3807

3809

3810 llvm::DenseMap<GlobalDecl, llvm::StringSet<>> ThunksToBeAbbreviated;

3811};

3812

3813

3816

3817

3822

3823

3828

3829}

3830

3831

3832

3833

3834

3835

3836

3837

3838

3839

3840

3841

3842

3843

3844

3845

3846

3847

3848

3849

3850

3851

3852

3853

3854

3855

3856

3857

3858

3859

3860

3862 size_t Alignment ) {

3863 return C.Allocate(Bytes, Alignment);

3864}

3865

3866

3867

3868

3869

3870

3871

3873 C.Deallocate(Ptr);

3874}

3875

3876

3877

3878

3879

3880

3881

3882

3883

3884

3885

3886

3887

3888

3889

3890

3891

3892

3893

3894

3895

3896

3897

3898

3900 size_t Alignment ) {

3901 return C.Allocate(Bytes, Alignment);

3902}

3903

3904

3905

3906

3907

3908

3909

3911 C.Deallocate(Ptr);

3912}

3913

3914

3915template <typename Owner, typename T,

3927template <> struct llvm::DenseMapInfollvm::FoldingSetNodeID {

3928 static FoldingSetNodeID getEmptyKey() { return FoldingSetNodeID{}; }

3929

3931 FoldingSetNodeID ID;

3932 for (size_t I = 0; I < sizeof(ID) / sizeof(unsigned); ++I) {

3933 ID.AddInteger(std::numeric_limits::max());

3934 }

3935 return ID;

3936 }

3937

3939 return Val.ComputeHash();

3940 }

3941

3942 static bool isEqual(const FoldingSetNodeID &LHS,

3943 const FoldingSetNodeID &RHS) {

3944 return LHS == RHS;

3945 }

3946};

3947

3948#endif

#define OPT_LIST(V)

Definition ASTContext.h:3657

#define V(N, I)

Definition ASTContext.h:3666

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)

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

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)

Allows QualTypes to be sorted and hence used in maps and sets.

__SIZE_TYPE__ size_t

The unsigned integer type of the result of the sizeof operator.

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

Definition ASTContext.h:220

ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind)

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 ...

Definition ASTContext.h:220

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.

CanQualType AccumTy

Definition ASTContext.h:1286

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

Definition ASTContext.h:1305

SourceManager & getSourceManager()

Definition ASTContext.h:852

TranslationUnitDecl * getTranslationUnitDecl() const

Definition ASTContext.h:1252

const ConstantArrayType * getAsConstantArrayType(QualType T) const

Definition ASTContext.h:3117

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.

LangAS getOpenCLTypeAddrSpace(const Type *T) const

Get address space for OpenCL type.

friend class ASTWriter

Definition ASTContext.h:572

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

Definition ASTContext.h:1304

uint64_t getTypeSize(const Type *T) const

Definition ASTContext.h:2683

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.

Definition ASTContext.h:1007

unsigned getManglingNumber(const NamedDecl *ND, bool ForAuxTarget=false) const

static const Type * getCanonicalType(const Type *T)

Definition ASTContext.h:2916

CanQualType LongTy

Definition ASTContext.h:1282

const SmallVectorImpl< Type * > & getTypes() const

Definition ASTContext.h:1414

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)

CanQualType WIntTy

Definition ASTContext.h:1278

InlineVariableDefinitionKind

Definition ASTContext.h:3710

@ Weak

Weak definition of inline variable.

Definition ASTContext.h:3715

@ Strong

Strong definition.

Definition ASTContext.h:3721

@ WeakUnknown

Weak for now, might become strong later in this TU.

Definition ASTContext.h:3718

bool dtorHasOperatorDelete(const CXXDestructorDecl *Dtor, OperatorDeleteKind K) const

const ProfileList & getProfileList() const

Definition ASTContext.h:964

void setObjCConstantStringInterface(ObjCInterfaceDecl *Decl)

TypedefDecl * getObjCClassDecl() const

Retrieve the typedef declaration corresponding to the predefined Objective-C 'Class' type.

TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)

QualType getTypeDeclType(const UnresolvedUsingTypenameDecl *) const =delete

TypedefDecl * getCFConstantStringDecl() const

CanQualType Int128Ty

Definition ASTContext.h:1282

CanQualType SatUnsignedFractTy

Definition ASTContext.h:1295

CanQualType getAdjustedType(CanQualType Orig, CanQualType New) const

Definition ASTContext.h:1591

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 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

Definition ASTContext.h:1202

bool AnyObjCImplementation()

Return true if there is at least one @implementation in the TU.

Definition ASTContext.h:3393

CanQualType UnsignedShortAccumTy

Definition ASTContext.h:1288

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)

Deallocates a DeclListNode by returning it to the ListNodeFreeList pool.

Definition ASTContext.h:892

DeclListNode * AllocateDeclListNode(clang::NamedDecl *ND)

Allocates a DeclListNode or returns one from the ListNodeFreeList pool.

Definition ASTContext.h:881

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 isTypeAwareOperatorNewOrDelete(const FunctionDecl *FD) const

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

Definition ASTContext.h:2714

QualType getCanonicalTemplateSpecializationType(ElaboratedTypeKeyword Keyword, TemplateName T, ArrayRef< TemplateArgument > CanonicalArgs) 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

Definition ASTContext.h:3784

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.

static CanQualType getCanonicalType(QualType T)

Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...

Definition ASTContext.h:2912

QualType getBuiltinVaListType() const

Retrieve the type of the __builtin_va_list type.

Definition ASTContext.h:2451

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

Definition ASTContext.h:795

comments::FullComment * cloneFullComment(comments::FullComment *FC, const Decl *D) const

bool containsNonRelocatablePointerAuth(QualType T)

Examines a given type, and returns whether the type itself or any data it transitively contains has a...

Definition ASTContext.h:707

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.

Definition ASTContext.h:2416

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.

Definition ASTContext.h:2163

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.

std::unique_ptr< MangleNumberingContext > createMangleNumberingContext() const

CanQualType SatAccumTy

Definition ASTContext.h:1291

QualType getUnsignedPointerDiffType() const

Return the unique unsigned counterpart of "ptrdiff_t" integer type.

QualType getucontext_tType() const

Retrieve the C ucontext_t type.

Definition ASTContext.h:2318

std::optional< CharUnits > getTypeSizeInCharsIfKnown(const Type *Ty) const

Definition ASTContext.h:2707

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.

Definition ASTContext.h:2466

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.

ArrayRef< Decl * > getTraversalScope() const

Definition ASTContext.h:837

QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const

Return a K&R style C function type like 'int()'.

CanQualType ShortAccumTy

Definition ASTContext.h:1286

ASTMutationListener * getASTMutationListener() const

Retrieve a pointer to the AST mutation listener associated with this AST context, if any.

Definition ASTContext.h:1411

unsigned NumImplicitCopyAssignmentOperatorsDeclared

The number of implicitly-declared copy assignment operators for which declarations were built.

Definition ASTContext.h:3620

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,...

Definition ASTContext.h:2721

unsigned char getFixedPointIBits(QualType Ty) const

QualType getSubstBuiltinTemplatePack(const TemplateArgument &ArgPack)

QualType getCorrespondingSignedFixedPointType(QualType Ty) const

IntrusiveRefCntPtr< ExternalASTSource > ExternalSource

Definition ASTContext.h:796

CanQualType FloatTy

Definition ASTContext.h:1285

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.

Definition ASTContext.h:2197

bool isObjCIdType(QualType T) const

Definition ASTContext.h:3251

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.

friend class IncrementalParser

Definition ASTContext.h:575

unsigned NumImplicitDestructorsDeclared

The number of implicitly-declared destructors for which declarations were built.

Definition ASTContext.h:3634

bool isObjCClassType(QualType T) const

Definition ASTContext.h:3253

void setObjCNSStringType(QualType T)

Definition ASTContext.h:2184

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

Definition ASTContext.h:968

bool propertyTypesAreCompatible(QualType, QualType)

void setInstantiatedFromUsingShadowDecl(UsingShadowDecl *Inst, UsingShadowDecl *Pattern)

CanQualType DoubleTy

Definition ASTContext.h:1285

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

Definition ASTContext.h:1109

CanQualType SatLongAccumTy

Definition ASTContext.h:1291

const XRayFunctionFilter & getXRayFilter() const

Definition ASTContext.h:960

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.

FunctionDecl * getcudaGetParameterBufferDecl()

Definition ASTContext.h:1667

TemplateName getDependentTemplateName(const DependentTemplateStorage &Name) const

Retrieve the template name that represents a dependent template name such as MetaFun::template operat...

QualType getFILEType() const

Retrieve the C FILE type.

Definition ASTContext.h:2279

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.

Definition ASTContext.h:2773

void setsigjmp_bufDecl(TypeDecl *sigjmp_bufDecl)

Set the type for the C sigjmp_buf type.

Definition ASTContext.h:2300

std::string getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, bool Extended=false) const

Emit the encoded type for the method declaration Decl into S.

bool classNeedsVectorDeletingDestructor(const CXXRecordDecl *RD)

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 LongDoubleTy

Definition ASTContext.h:1285

CanQualType OMPArrayShapingTy

Definition ASTContext.h:1314

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.

CanQualType Char16Ty

Definition ASTContext.h:1280

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 '...

Definition ASTContext.h:2216

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...

void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo)

QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, UnsignedOrNone PackIndex, bool Final) const

Retrieve a substitution-result type.

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'.

Definition ASTContext.h:2223

void setFILEDecl(TypeDecl *FILEDecl)

Set the type for the C FILE type.

Definition ASTContext.h:2276

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

Definition ASTContext.h:3123

bool defaultsToMsStruct() const

Return whether unannotated records are treated as if they have [[gnu::ms_struct]].

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...

CanQualType UnsignedLongFractTy

Definition ASTContext.h:1290

QualType mergeTagDefinitions(QualType, QualType)

overridden_method_range overridden_methods(const CXXMethodDecl *Method) const

void setIsTypeAwareOperatorNewOrDelete(const FunctionDecl *FD, bool IsTypeAware)

bool hasSeenTypeAwareOperatorNewOrDelete() const

Definition ASTContext.h:3502

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...

CanQualType VoidPtrTy

Definition ASTContext.h:1300

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

Definition ASTContext.h:3255

QualType getBlockDescriptorExtendedType() const

Gets the struct used to keep track of the extended descriptor for pointer to blocks.

void Deallocate(void *Ptr) const

Definition ASTContext.h:871

PragmaSectionFlag

Definition ASTContext.h:3762

@ PSF_Implicit

Definition ASTContext.h:3767

@ PSF_None

Definition ASTContext.h:3763

@ PSF_ZeroInit

Definition ASTContext.h:3768

@ PSF_Write

Definition ASTContext.h:3765

@ PSF_Invalid

Definition ASTContext.h:3769

@ PSF_Read

Definition ASTContext.h:3764

@ PSF_Execute

Definition ASTContext.h:3766

QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const

Return the uniqued reference to the type for an lvalue reference to the specified type.

void setClassNeedsVectorDeletingDestructor(const CXXRecordDecl *RD)

CanQualType DependentTy

Definition ASTContext.h:1301

bool QIdProtocolsAdoptObjCObjectProtocols(QualType QT, ObjCInterfaceDecl *IDecl)

QIdProtocolsAdoptObjCObjectProtocols - Checks that protocols in QT's qualified-id protocol list adopt...

FunctionProtoType::ExceptionSpecInfo mergeExceptionSpecs(FunctionProtoType::ExceptionSpecInfo ESI1, FunctionProtoType::ExceptionSpecInfo ESI2, SmallVectorImpl< QualType > &ExceptionTypeStorage, bool AcceptDependent) const

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...

bool BlockRequiresCopying(QualType Ty, const VarDecl *D)

Returns true iff we need copy/dispose helpers for the given type.

QualType getTypeDeclType(const TypeAliasDecl *) const =delete

CanQualType NullPtrTy

Definition ASTContext.h:1300

QualType getUsingType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UsingShadowDecl *D, QualType UnderlyingType=QualType()) const

CanQualType WideCharTy

Definition ASTContext.h:1277

CanQualType OMPIteratorTy

Definition ASTContext.h:1314

IdentifierTable & Idents

Definition ASTContext.h:791

Builtin::Context & BuiltinInfo

Definition ASTContext.h:793

bool computeEnumBits(RangeT EnumConstants, unsigned &NumNegativeBits, unsigned &NumPositiveBits)

Compute NumNegativeBits and NumPositiveBits for an enum based on the constant values of its enumerato...

Definition ASTContext.h:1894

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

Definition ASTContext.h:945

QualType getConstType(QualType T) const

Return the uniqued reference to the type for a const qualified type.

Definition ASTContext.h:1512

bool containsAddressDiscriminatedPointerAuth(QualType T) const

Examines a given type, and returns whether the type itself is address discriminated,...

Definition ASTContext.h:696

QualType getFunctionTypeWithoutPtrSizes(QualType T)

Get a function type and produce the equivalent function type where pointer size address spaces in the...

uint64_t lookupFieldBitOffset(const ObjCInterfaceDecl *OID, const ObjCIvarDecl *Ivar) const

Get the offset of an ObjCIvarDecl in bits.

CanQualType getLogicalOperationType() const

The result type of logical operations, '<', '>', '!=', etc.

Definition ASTContext.h:2326

SelectorTable & Selectors

Definition ASTContext.h:792

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 alignment as specified by the target.

RawCommentList Comments

All comments in this translation unit.

Definition ASTContext.h:978

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)

Definition ASTContext.h:2159

TagDecl * MSTypeInfoTagDecl

Definition ASTContext.h:1347

TypedefDecl * getBOOLDecl() const

Retrieve declaration of 'BOOL' typedef.

Definition ASTContext.h:2426

CanQualType SatShortFractTy

Definition ASTContext.h:1294

QualType getDecayedType(QualType T) const

Return the uniqued reference to the decayed version of the given type.

CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod) const

Retrieves the default calling convention for the current context.

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...

Definition ASTContext.h:3547

TemplateTemplateParmDecl * insertCanonicalTemplateTemplateParmDeclInternal(TemplateTemplateParmDecl *CanonTTP) const

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...

QualType getObjCInstanceType()

Retrieve the Objective-C "instancetype" type.

Definition ASTContext.h:2265

QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier NNS, const IdentifierInfo *Name) const

Qualifiers::GC getObjCGCAttrKind(QualType Ty) const

Return one of the GCNone, Weak or Strong Objective-C garbage collection attributes.

PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()

Definition ASTContext.h:906

static bool hasSameType(const Type *T1, const Type *T2)

Definition ASTContext.h:2931

CanQualType Ibm128Ty

Definition ASTContext.h:1285

void setASTMutationListener(ASTMutationListener *Listener)

Attach an AST mutation listener to the AST context.

Definition ASTContext.h:1405

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

Definition ASTContext.h:913

CanQualType getCanonicalSizeType() const

bool typesAreBlockPointerCompatible(QualType, QualType)

CanQualType SatUnsignedAccumTy

Definition ASTContext.h:1292

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.

friend class ASTReader

Definition ASTContext.h:571

QualType getObjCProtoType() const

Retrieve the type of the Objective-C Protocol class.

Definition ASTContext.h:2442

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)

Definition ASTContext.h:1208

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

Definition ASTContext.h:1313

CanQualType ObjCBuiltinIdTy

Definition ASTContext.h:1305

overridden_cxx_method_iterator overridden_methods_end(const CXXMethodDecl *Method) const

VTableContextBase * getVTableContext()

void setBOOLDecl(TypedefDecl *TD)

Save declaration of 'BOOL' typedef.

Definition ASTContext.h:2431

llvm::SetVector< const ValueDecl * > CUDAExternalDeviceDeclODRUsedByHost

Keep track of CUDA/HIP external kernels or device variables ODR-used by host code.

Definition ASTContext.h:1357

ComparisonCategories CompCategories

Types and expressions required to build C++2a three-way comparisons using operator<=>,...

Definition ASTContext.h:2622

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

PointerAuthQualifier getObjCMemberSelTypePtrAuth()

QualType AutoDeductTy

Definition ASTContext.h:1336

CanQualType BoolTy

Definition ASTContext.h:1274

void setcudaLaunchDeviceDecl(FunctionDecl *FD)

Definition ASTContext.h:1671

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

Definition ASTContext.h:861

void setStaticLocalNumber(const VarDecl *VD, unsigned Number)

friend class ASTDeclReader

Definition ASTContext.h:570

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

Definition ASTContext.h:955

struct clang::ASTContext::CUDAConstantEvalContext CUDAConstantEvalCtx

IdentifierInfo * getNSObjectName() const

Retrieve the identifier 'NSObject'.

Definition ASTContext.h:2228

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.

Definition ASTContext.h:2401

OperatorDeleteKind

Definition ASTContext.h:3511

@ ArrayGlobal

Definition ASTContext.h:3511

@ GlobalRegular

Definition ASTContext.h:3511

@ Regular

Definition ASTContext.h:3511

@ Array

Definition ASTContext.h:3511

std::string getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const

Emit the encoded type for the function Decl into S.

TypeSourceInfo * getTemplateSpecializationTypeInfo(ElaboratedTypeKeyword Keyword, SourceLocation ElaboratedKeywordLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKeywordLoc, TemplateName T, SourceLocation TLoc, const TemplateArgumentListInfo &SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Canon=QualType()) const

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

Definition ASTContext.h:3212

CanQualType UnsignedFractTy

Definition ASTContext.h:1290

QualType getjmp_bufType() const

Retrieve the C jmp_buf type.

Definition ASTContext.h:2292

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.

Definition ASTContext.h:2305

void addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden)

Note that the given C++ Method overrides the given Overridden method.

TemplateTemplateParmDecl * findCanonicalTemplateTemplateParmDeclInternal(TemplateTemplateParmDecl *TTP) const

const TargetInfo * getAuxTargetInfo() const

Definition ASTContext.h:911

CanQualType Float128Ty

Definition ASTContext.h:1285

CanQualType ObjCBuiltinClassTy

Definition ASTContext.h:1305

unsigned NumImplicitDefaultConstructorsDeclared

The number of implicitly-declared default constructors for which declarations were built.

Definition ASTContext.h:3599

CanQualType UnresolvedTemplateTy

Definition ASTContext.h:1301

void setucontext_tDecl(TypeDecl *ucontext_tDecl)

Set the type for the C ucontext_t type.

Definition ASTContext.h:2313

OMPTraitInfo & getNewOMPTraitInfo()

Return a new OMPTraitInfo object owned by this context.

friend class CXXRecordDecl

Definition ASTContext.h:574

CanQualType UnsignedLongTy

Definition ASTContext.h:1283

llvm::DenseSet< const FunctionDecl * > CUDAImplicitHostDeviceFunUsedByDevice

Keep track of CUDA/HIP implicit host device functions used on device side in device compilation.

Definition ASTContext.h:1361

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

Definition ASTContext.h:3216

const TranslationUnitKind TUKind

Definition ASTContext.h:794

QualType getQualifiedType(const Type *T, Qualifiers Qs) const

Return a type with additional qualifiers.

Definition ASTContext.h:2513

Decl * VaListTagDecl

Definition ASTContext.h:1341

CanQualType UnsignedLongAccumTy

Definition ASTContext.h:1288

QualType AutoRRefDeductTy

Definition ASTContext.h:1337

QualType getRestrictType(QualType T) const

Return the uniqued reference to the type for a restrict qualified type.

Definition ASTContext.h:1492

TypeInfo getTypeInfo(const Type *T) const

Get the size and alignment of the specified complete type in bits.

CanQualType ShortFractTy

Definition ASTContext.h:1289

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.

Definition ASTContext.h:2436

QualType getSubstTemplateTypeParmPackType(Decl *AssociatedDecl, unsigned Index, bool Final, const TemplateArgument &ArgPack)

llvm::DenseMap< const CXXMethodDecl *, CXXCastPath > LambdaCastPaths

For capturing lambdas with an explicit object parameter whose type is derived from the lambda type,...

Definition ASTContext.h:1372

CanQualType BoundMemberTy

Definition ASTContext.h:1301

CanQualType SatUnsignedShortFractTy

Definition ASTContext.h:1295

CanQualType CharTy

Definition ASTContext.h:1275

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.

Definition ASTContext.h:981

BlockVarCopyInit getBlockVarCopyInit(const VarDecl *VD) const

Get the copy initialization expression of the VarDecl VD, or nullptr if none exists.

QualType getHLSLInlineSpirvType(uint32_t Opcode, uint32_t Size, uint32_t Alignment, ArrayRef< SpirvOperand > Operands)

unsigned NumImplicitMoveConstructorsDeclared

The number of implicitly-declared move constructors for which declarations were built.

Definition ASTContext.h:3613

bool isInSameModule(const Module *M1, const Module *M2) const

If the two module M1 and M2 are in the same module.

unsigned NumImplicitCopyConstructorsDeclared

The number of implicitly-declared copy constructors for which declarations were built.

Definition ASTContext.h:3606

CanQualType IntTy

Definition ASTContext.h:1282

llvm::DenseSet< const VarDecl * > CUDADeviceVarODRUsedByHost

Keep track of CUDA/HIP device-side variables ODR-used by host code.

Definition ASTContext.h:1353

CanQualType PseudoObjectTy

Definition ASTContext.h:1304

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

Definition ASTContext.h:1572

friend class NestedNameSpecifier

Definition ASTContext.h:221

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.

Definition ASTContext.h:3630

CanQualType Float16Ty

Definition ASTContext.h:1299

QualType getQualifiedType(SplitQualType split) const

Un-split a SplitQualType.

Definition ASTContext.h:2499

bool isAlignmentRequired(const Type *T) const

Determine if the alignment the type has was required using an alignment attribute.

TagDecl * MSGuidTagDecl

Definition ASTContext.h:1344

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.

CanQualType SignedCharTy

Definition ASTContext.h:1282

QualType getObjCObjectPointerType(QualType OIT) const

Return a ObjCObjectPointerType type for the given ObjCObjectType.

ASTMutationListener * Listener

Definition ASTContext.h:797

void setNonKeyFunction(const CXXMethodDecl *method)

Observe that the given method cannot be a key function.

CanQualType ObjCBuiltinBoolTy

Definition ASTContext.h:1306

TypeInfoChars getTypeInfoInChars(const Type *T) const

QualType getPredefinedSugarType(PredefinedSugarType::Kind KD) 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.

Definition ASTContext.h:1650

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

Definition ASTContext.h:853

CanQualType OverloadTy

Definition ASTContext.h:1301

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.

TemplateTemplateParmDecl * getCanonicalTemplateTemplateParmDecl(TemplateTemplateParmDecl *TTP) const

Canonicalize the given TemplateTemplateParmDecl.

CanQualType OCLClkEventTy

Definition ASTContext.h:1310

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.

Definition ASTContext.h:2741

const clang::PrintingPolicy & getPrintingPolicy() const

Definition ASTContext.h:844

void ResetObjCLayout(const ObjCInterfaceDecl *D)

ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)

Get the additional modules in which the definition Def has been merged.

static ImportDecl * getNextLocalImport(ImportDecl *Import)

Definition ASTContext.h:1198

llvm::FixedPointSemantics getFixedPointSemantics(QualType Ty) const

CanQualType SatUnsignedShortAccumTy

Definition ASTContext.h:1292

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.

QualType getPackIndexingType(QualType Pattern, Expr *IndexExpr, bool FullySubstituted=false, ArrayRef< QualType > Expansions={}, UnsignedOrNone Index=std::nullopt) const

static bool isObjCNSObjectType(QualType Ty)

Return true if this is an NSObject object with its NSObject attribute set.

Definition ASTContext.h:2662

GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const

llvm::PointerUnion< VarTemplateDecl *, MemberSpecializationInfo * > TemplateOrSpecializationInfo

A type synonym for the TemplateOrInstantiation mapping.

Definition ASTContext.h:566

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)...

Definition ASTContext.h:2112

QualType getVariableArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals) const

Return a non-unique reference to the type for a variable array of the specified element type.

QualType getObjCIdType() const

Represents the Objective-CC id type.

Definition ASTContext.h:2390

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...

QualType getCorrespondingUnsaturatedType(QualType Ty) const

comments::FullComment * getCommentForDecl(const Decl *D, const Preprocessor *PP) const

Return parsed documentation comment attached to a given declaration.

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.

Definition ASTContext.h:1366

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.

QualType getTypeDeclType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypeDecl *Decl) const

bool isDestroyingOperatorDelete(const FunctionDecl *FD) const

uint64_t getTypeSize(QualType T) const

Return the size of the specified (complete) type T, in bits.

Definition ASTContext.h:2682

CanQualType UnsignedInt128Ty

Definition ASTContext.h:1284

CanQualType BuiltinFnTy

Definition ASTContext.h:1303

ObjCInterfaceDecl * getObjCProtocolDecl() const

Retrieve the Objective-C class declaration corresponding to the predefined Protocol class.

unsigned NumImplicitDefaultConstructors

The number of implicitly-declared default constructors.

Definition ASTContext.h:3595

CharUnits getTypeSizeInChars(QualType T) const

Return the size of the specified (complete) type T, in characters.

llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range

Definition ASTContext.h:1173

unsigned NumImplicitMoveAssignmentOperatorsDeclared

The number of implicitly-declared move assignment operators for which declarations were built.

Definition ASTContext.h:3627

void setManglingNumber(const NamedDecl *ND, unsigned Number)

llvm::DenseMap< const Decl *, const RawComment * > DeclRawComments

Mapping from declaration to directly attached comment.

Definition ASTContext.h:987

CanQualType OCLSamplerTy

Definition ASTContext.h:1310

QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, TemplateDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const

C++11 deduced auto type.

TypedefDecl * getBuiltinVaListDecl() const

Retrieve the C type declaration corresponding to the predefined __builtin_va_list type.

TypeInfo getTypeInfo(QualType T) const

Definition ASTContext.h:2676

CanQualType getCanonicalTypeDeclType(const TypeDecl *TD) const

CanQualType VoidTy

Definition ASTContext.h:1273

QualType getPackExpansionType(QualType Pattern, UnsignedOrNone NumExpansions, bool ExpectPackInType=true) const

Form a pack expansion type with the given pattern.

CanQualType UnsignedCharTy

Definition ASTContext.h:1283

CanQualType UnsignedShortFractTy

Definition ASTContext.h:1290

BuiltinTemplateDecl * buildBuiltinTemplateDecl(BuiltinTemplateKind BTK, const IdentifierInfo *II) const

void * Allocate(size_t Size, unsigned Align=8) const

Definition ASTContext.h:865

bool canBuiltinBeRedeclared(const FunctionDecl *) const

Return whether a declaration to a builtin is allowed to be overloaded/redeclared.

CanQualType UnsignedIntTy

Definition ASTContext.h:1283

unsigned NumImplicitMoveConstructors

The number of implicitly-declared move constructors.

Definition ASTContext.h:3609

QualType getTypedefType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypedefNameDecl *Decl, QualType UnderlyingType=QualType(), std::optional< bool > TypeMatchesDeclOrNone=std::nullopt) const

Return the unique reference to the type for the specified typedef-name decl.

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.

Definition ASTContext.h:1501

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.

QualType getTemplateSpecializationType(ElaboratedTypeKeyword Keyword, TemplateName T, ArrayRef< TemplateArgument > SpecifiedArgs, ArrayRef< TemplateArgument > CanonicalArgs, QualType Underlying=QualType()) const

TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const

Allocate an uninitialized TypeSourceInfo.

TagDecl * getMSTypeInfoTagDecl() const

Retrieve the implicitly-predeclared 'struct type_info' declaration.

Definition ASTContext.h:2481

TemplateName getQualifiedTemplateName(NestedNameSpecifier Qualifier, bool TemplateKeyword, TemplateName Template) const

Retrieve the template name that represents a qualified template name such as std::vector.

QualType getObjCClassRedefinitionType() const

Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...

Definition ASTContext.h:2203

TagDecl * getMSGuidTagDecl() const

Retrieve the implicitly-predeclared 'struct _GUID' declaration.

Definition ASTContext.h:2472

bool isSameAssociatedConstraint(const AssociatedConstraint &ACX, const AssociatedConstraint &ACY) const

Determine whether two 'requires' expressions are similar enough that they may be used in re-declarati...

QualType getExceptionObjectType(QualType T) const

CanQualType UnknownAnyTy

Definition ASTContext.h:1302

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

Definition ASTContext.h:1808

CanQualType UnsignedLongLongTy

Definition ASTContext.h:1284

QualType GetBuiltinType(unsigned ID, GetBuiltinTypeError &Error, unsigned *IntegerConstantArgs=nullptr) const

Return the type for the specified builtin.

CanQualType OCLReserveIDTy

Definition ASTContext.h:1311

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.

QualType getTypeDeclType(const TagDecl *) const =delete

Use the normal 'getFooBarType' constructors to obtain these types.

size_t getASTAllocatedMemory() const

Return the total amount of physical memory allocated for representing AST nodes and type information.

Definition ASTContext.h:899

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

Definition ASTContext.h:1283

FunctionDecl * getOperatorDeleteForVDtor(const CXXDestructorDecl *Dtor, OperatorDeleteKind K) const

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

Definition ASTContext.h:2176

bool isRepresentableIntegerValue(llvm::APSInt &Value, QualType T)

Determine whether the given integral value is representable within the given type T.

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.

Definition ASTContext.h:1813

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

Definition ASTContext.h:1296

QualType getMemberPointerType(QualType T, NestedNameSpecifier Qualifier, const CXXRecordDecl *Cls) const

Return the uniqued reference to the type for a member pointer to the specified type in the specified ...

void setcudaConfigureCallDecl(FunctionDecl *FD)

Definition ASTContext.h:1655

CanQualType getDecayedType(CanQualType T) const

Definition ASTContext.h:1600

static bool hasSameType(QualType T1, QualType T2)

Determine whether the given types T1 and T2 are equivalent.

Definition ASTContext.h:2928

QualType getObjCIdRedefinitionType() const

Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...

Definition ASTContext.h:2190

const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *RD)

QualType getDependentAddressSpaceType(QualType PointeeType, Expr *AddrSpaceExpr, SourceLocation AttrLoc) const

RawComment * getRawCommentForDeclNoCache(const Decl *D) const

Return the documentation comment attached to a given declaration, without looking into cache.

QualType getTagType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TagDecl *TD, bool OwnsTag) const

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.

Definition ASTContext.h:3371

CanQualType getMSGuidType() const

Retrieve the implicitly-predeclared 'struct _GUID' type.

Definition ASTContext.h:2475

const VariableArrayType * getAsVariableArrayType(QualType T) const

Definition ASTContext.h:3120

QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType, UnaryTransformType::UTTKind UKind) const

Unary type transforms.

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...

CanQualType ShortTy

Definition ASTContext.h:1282

StringLiteral * getPredefinedStringLiteralFromCache(StringRef Key) const

Return a string representing the human readable name for the specified function declaration or file n...

CanQualType getCanonicalUnresolvedUsingType(const UnresolvedUsingTypenameDecl *D) const

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.

void setObjCClassRedefinitionType(QualType RedefType)

Set the user-written type that redefines 'SEL'.

Definition ASTContext.h:2210

bool hasDirectOwnershipQualifier(QualType Ty) const

Return true if the type has been explicitly qualified with ObjC ownership.

CanQualType FractTy

Definition ASTContext.h:1289

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)

void deduplicateMergedDefinitionsFor(NamedDecl *ND)

Clean up the merged definition list.

FunctionDecl * getcudaConfigureCallDecl()

Definition ASTContext.h:1659

DiagnosticsEngine & getDiagnostics() const

llvm::StringRef backupStr(llvm::StringRef S) const

Definition ASTContext.h:873

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...

Definition ASTContext.h:2534

CanQualType LongAccumTy

Definition ASTContext.h:1287

interp::Context & getInterpContext()

Returns the clang bytecode interpreter context.

CanQualType Char32Ty

Definition ASTContext.h:1281

QualType getSizeType() const

Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.

QualType getCVRQualifiedType(QualType T, unsigned CVR) const

Return a type with additional const, volatile, or restrict qualifiers.

Definition ASTContext.h:2494

UnnamedGlobalConstantDecl * getUnnamedGlobalConstantDecl(QualType Ty, const APValue &Value) const

Return a declaration for a uniquified anonymous global constant corresponding to a given APValue.

CanQualType SatFractTy

Definition ASTContext.h:1294

QualType getExtVectorType(QualType VectorType, unsigned NumElts) const

Return the unique reference to an extended vector type of the specified element type and size.

QualType getUnresolvedUsingType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UnresolvedUsingTypenameDecl *D) const

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

Definition ASTContext.h:1294

NeedExtraManglingDecl_t

Definition ASTContext.h:3526

@ NeedExtraManglingDecl

Definition ASTContext.h:3526

const TargetInfo & getTargetInfo() const

Definition ASTContext.h:910

void setInstantiatedFromUnnamedFieldDecl(FieldDecl *Inst, FieldDecl *Tmpl)

CanQualType OCLQueueTy

Definition ASTContext.h:1311

CanQualType LongFractTy

Definition ASTContext.h:1289

CanQualType SatShortAccumTy

Definition ASTContext.h:1291

QualType getAutoDeductType() const

C++11 deduction pattern for 'auto' type.

CanQualType BFloat16Ty

Definition ASTContext.h:1298

unsigned NumImplicitCopyConstructors

The number of implicitly-declared copy constructors.

Definition ASTContext.h:3602

CharUnits toCharUnitsFromBits(int64_t BitSize) const

Convert a size in bits to a size in characters.

CanQualType IncompleteMatrixIdxTy

Definition ASTContext.h:1312

std::optional< CharUnits > getTypeSizeInCharsIfKnown(QualType Ty) const

Definition ASTContext.h:2701

friend class DeclarationNameTable

Definition ASTContext.h:3733

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.

Definition ASTContext.h:2522

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

Definition ASTContext.h:2180

QualType getDeducedTemplateSpecializationType(ElaboratedTypeKeyword Keyword, TemplateName Template, QualType DeducedType, bool IsDependent) const

C++17 deduced class template specialization type.

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.

Definition ASTContext.h:2287

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.

Definition ASTContext.h:3457

bool UnwrapSimilarTypes(QualType &T1, QualType &T2, bool AllowPiMismatch=true) const

Attempt to unwrap two types that may be similar (C++ [conv.qual]).

IntrusiveRefCntPtr< ExternalASTSource > getExternalSourcePtr() const

Retrieve a pointer to the external AST source associated with this AST context, if any.

Definition ASTContext.h:1396

QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const

Return the uniqued reference to the type for an address space qualified type with the specified type ...

QualType getSignedSizeType() const

Return the unique signed counterpart of the integer type corresponding to size_t.

ExternalASTSource * getExternalSource() const

Retrieve a pointer to the external AST source associated with this AST context, if any.

Definition ASTContext.h:1390

uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const

Return number of constant array elements.

void setcudaGetParameterBufferDecl(FunctionDecl *FD)

Definition ASTContext.h:1663

CanQualType SatUnsignedLongAccumTy

Definition ASTContext.h:1293

QualType getUnconstrainedType(QualType T) const

Remove any type constraints from a template parameter type, for equivalence comparison of template pa...

CanQualType LongLongTy

Definition ASTContext.h:1282

CanQualType getCanonicalTagType(const TagDecl *TD) const

bool isSameTemplateArgument(const TemplateArgument &Arg1, const TemplateArgument &Arg2) const

Determine whether the given template arguments Arg1 and Arg2 are equivalent.

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.

Definition ASTContext.h:2504

llvm::DenseMap< const Decl *, const Decl * > CommentlessRedeclChains

Keeps track of redeclaration chains that don't have any comment attached.

Definition ASTContext.h:1003

uint64_t getArrayInitLoopExprElementCount(const ArrayInitLoopExpr *AILE) const

Return number of elements initialized in an ArrayInitLoopExpr.

unsigned getTargetAddressSpace(LangAS AS) const

QualType getWideCharType() const

Return the type of wide characters.

Definition ASTContext.h:2117

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...

QualType getDependentSizedArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals) const

Return a non-unique reference to the type for a dependently-sized array of the specified element type...

void addTranslationUnitDecl()

Definition ASTContext.h:1257

CanQualType WCharTy

Definition ASTContext.h:1276

bool hasSameNullabilityTypeQualifier(QualType SubT, QualType SuperT, bool IsParam) const

Definition ASTContext.h:2964

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.

Definition ASTContext.h:3616

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

Definition ASTContext.h:868

llvm::DenseMap< const Decl *, const Decl * > RedeclChainComments

Mapping from canonical declaration to the first redeclaration in chain that has a comment attached.

Definition ASTContext.h:994

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.

Definition ASTContext.h:2544

QualType getDecltypeType(Expr *e, QualType UnderlyingType) const

C++11 decltype.

std::optional< CXXRecordDeclRelocationInfo > getRelocationInfoForCXXRecord(const CXXRecordDecl *) const

static bool hasSameUnqualifiedType(QualType T1, QualType T2)

Determine whether the given types are equivalent after cvr-qualifiers have been removed.

Definition ASTContext.h:2959

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)

Definition ASTContext.h:1212

TemplateName getSubstTemplateTemplateParm(TemplateName replacement, Decl *AssociatedDecl, unsigned Index, UnsignedOrNone PackIndex, bool Final) const

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'.

Definition ASTContext.h:2250

friend class DeclContext

Definition ASTContext.h:3734

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...

void addOperatorDeleteForVDtor(const CXXDestructorDecl *Dtor, FunctionDecl *OperatorDelete, OperatorDeleteKind K) const

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

void addObjCSubClass(const ObjCInterfaceDecl *D, const ObjCInterfaceDecl *SubClass)

Definition ASTContext.h:3322

TemplateName getAssumedTemplateName(DeclarationName Name) const

Retrieve a template name representing an unqualified-id that has been assumed to name a template for ...

GetBuiltinTypeError

Definition ASTContext.h:2591

@ GE_None

No error.

Definition ASTContext.h:2593

@ GE_Missing_stdio

Missing a type from <stdio.h>

Definition ASTContext.h:2599

@ GE_Missing_type

Missing a type.

Definition ASTContext.h:2596

@ GE_Missing_ucontext

Missing a type from <ucontext.h>

Definition ASTContext.h:2605

@ GE_Missing_setjmp

Missing a type from <setjmp.h>

Definition ASTContext.h:2602

QualType adjustStringLiteralBaseType(QualType StrLTy) const

uint16_t getPointerAuthTypeDiscriminator(QualType T)

Return the "other" type-specific discriminator for the given type.

bool canonicalizeTemplateArguments(MutableArrayRef< TemplateArgument > Args) const

Canonicalize the given template argument list.

QualType getTypeOfExprType(Expr *E, TypeOfKind Kind) const

C23 feature and GCC extension.

CanQualType Char8Ty

Definition ASTContext.h:1279

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.

QualType getTypeDeclType(const TypedefDecl *) const =delete

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 HalfTy

Definition ASTContext.h:1297

CanQualType UnsignedAccumTy

Definition ASTContext.h:1288

void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)

void addTypedefNameForUnnamedTagDecl(TagDecl *TD, TypedefNameDecl *TND)

bool isDependenceAllowed() const

Definition ASTContext.h:951

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.

Definition ASTContext.h:2131

const CXXRecordDecl * baseForVTableAuthentication(const CXXRecordDecl *ThisClass) const

Resolve the root record to be used to derive the vtable pointer authentication policy for the specifi...

QualType getVariableArrayDecayedType(QualType Ty) const

Returns a vla type where known sizes are replaced with [*].

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.

Definition ASTContext.h:1244

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...

QualType getCommonSugaredType(QualType X, QualType Y, bool Unqualified=false) const

CanQualType OCLEventTy

Definition ASTContext.h:1310

void setPrintingPolicy(const clang::PrintingPolicy &Policy)

Definition ASTContext.h:848

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

Definition ASTContext.h:1164

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.

Definition ASTContext.h:2713

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'.

Definition ASTContext.h:2237

void setIsDestroyingOperatorDelete(const FunctionDecl *FD, bool IsDestroying)

uint64_t getCharWidth() const

Return the size of the character type, in bits.

Definition ASTContext.h:2686

CanQualType getPointerType(CanQualType T) const

Definition ASTContext.h:1579

QualType getUnqualifiedArrayType(QualType T) const

Definition ASTContext.h:2952

import_range local_imports() const

Definition ASTContext.h:1204

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

Definition ASTContext.h:3126

unsigned NumImplicitMoveAssignmentOperators

The number of implicitly-declared move assignment operators.

Definition ASTContext.h:3623

FunctionDecl * getcudaLaunchDeviceDecl()

Definition ASTContext.h:1673

An abstract interface that should be implemented by listeners that want to be notified when an AST en...

ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...

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 C++ destructor 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)

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.

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.

Represents an array type in C++ whose size is a value-dependent expression.

Represents a dependent template name that cannot be resolved prior to template instantiation.

Concrete class used by the front-end to report problems and issues.

Container for either a single DynTypedNode or for an ArrayRef to DynTypedNode.

An instance of this object exists for each enum constant that is defined.

llvm::APSInt getInitVal() const

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.

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.

A C++ nested-name-specifier augmented with source location information.

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 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

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.

The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.

clang::DiagStorageAllocator DiagStorageAllocator

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.

The base class of all kinds of template declarations (e.g., class, function, etc.).

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.

TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.

Declaration of a template type parameter.

The top declaration context.

static TranslationUnitDecl * Create(ASTContext &C)

Represents the declaration of a typedef-name via a C++11 alias-declaration.

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...

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 the dependent type named by a dependently-scoped typename using declaration,...

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.

Declaration of a variable template.

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.

Definition ASTContext.h:173

Definition ASTContext.h:54

Definition ASTContext.h:151

const internal::VariadicAllOfMatcher< Type > type

Matches Types in the clang AST.

const internal::VariadicDynCastAllOfMatcher< Stmt, BlockExpr > blockExpr

Matches a reference to a block.

Definition ASTContext.h:166

llvm::FixedPointSemantics FixedPointSemantics

The JSON file list parser is used to communicate input to InstallAPI.

CanQual< Type > CanQualType

Represents a canonical, potentially-qualified type.

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.

@ TemplateName

The identifier is a template name. FIXME: Add an annotation for that.

TypeOfKind

The kind of 'typeof' expression we're after.

SmallVector< Attr *, 4 > AttrVec

AttrVec - A vector of Attr, which is how they are stored on the AST.

@ 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.

Definition ASTContext.h:3824

@ Result

The result type of a method or function.

ArraySizeModifier

Capture whether this is a normal array (e.g.

const FunctionProtoType * T

@ Template

We are parsing a template declaration.

Selector GetNullarySelector(StringRef name, ASTContext &Ctx)

Utility function for constructing a nullary selector.

Definition ASTContext.h:3818

@ Class

The "class" keyword.

BuiltinTemplateKind

Kinds of BuiltinTemplateDecl.

@ Keyword

The name has been typo-corrected to a keyword.

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.

SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath

A simple array of base specifiers.

Definition ASTContext.h:149

const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)

Insertion operator for diagnostics.

TemplateSpecializationKind

Describes the kind of template specialization that a particular template specialization declaration r...

CallingConv

CallingConv - Specifies the calling convention that a function uses.

U cast(CodeGen::Address addr)

AlignRequirementKind

Definition ASTContext.h:176

@ None

The alignment was not explicit in code.

Definition ASTContext.h:178

@ RequiredByEnum

The alignment comes from an alignment attribute on a enum type.

Definition ASTContext.h:187

@ RequiredByTypedef

The alignment comes from an alignment attribute on a typedef.

Definition ASTContext.h:181

@ RequiredByRecord

The alignment comes from an alignment attribute on a record type.

Definition ASTContext.h:184

ElaboratedTypeKeyword

The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...

@ None

No keyword precedes the qualified type name.

@ Other

Other implicit parameter.

Diagnostic wrappers for TextAPI types for error reporting.

BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, unsigned NumVectors)

Definition ASTContext.h:1737

Definition ASTContext.h:802

Definition ASTContext.h:682

unsigned NumVectors

Definition ASTContext.h:1736

BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, unsigned NumVectors)

Definition ASTContext.h:1737

llvm::ElementCount EC

Definition ASTContext.h:1735

QualType ElementType

Definition ASTContext.h:1734

Definition ASTContext.h:802

bool NoWrongSidedVars

Do not allow wrong-sided variables in constant expressions.

Definition ASTContext.h:804

Definition ASTContext.h:682

unsigned IsRelocatable

Definition ASTContext.h:683

unsigned IsReplaceable

Definition ASTContext.h:684

Definition ASTContext.h:3772

SourceLocation PragmaSectionLocation

Definition ASTContext.h:3774

NamedDecl * Decl

Definition ASTContext.h:3773

SectionInfo(NamedDecl *Decl, SourceLocation PragmaSectionLocation, int SectionFlags)

Definition ASTContext.h:3778

int SectionFlags

Definition ASTContext.h:3775

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.

static ValueType makeValue(const ASTContext &Ctx, T Value)

Create the representation of a LazyGenerationalUpdatePtr.

Definition ASTContext.h:3918

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.

Definition ASTContext.h:204

CharUnits Width

Definition ASTContext.h:205

CharUnits Align

Definition ASTContext.h:206

AlignRequirementKind AlignRequirement

Definition ASTContext.h:207

TypeInfoChars(CharUnits Width, CharUnits Align, AlignRequirementKind AlignRequirement)

Definition ASTContext.h:210

TypeInfoChars()

Definition ASTContext.h:209

bool isAlignRequired()

Definition ASTContext.h:213

Definition ASTContext.h:190

TypeInfo()

Definition ASTContext.h:195

bool isAlignRequired()

Definition ASTContext.h:199

AlignRequirementKind AlignRequirement

Definition ASTContext.h:193

uint64_t Width

Definition ASTContext.h:191

unsigned Align

Definition ASTContext.h:192

TypeInfo(uint64_t Width, unsigned Align, AlignRequirementKind AlignRequirement)

Definition ASTContext.h:196

static ScalableVecTyKey getTombstoneKey()

Definition ASTContext.h:73

static ScalableVecTyKey getEmptyKey()

Definition ASTContext.h:70

static bool isEqual(const ScalableVecTyKey &LHS, const ScalableVecTyKey &RHS)

Definition ASTContext.h:80

static unsigned getHashValue(const ScalableVecTyKey &Val)

Definition ASTContext.h:76

static bool isEqual(const FoldingSetNodeID &LHS, const FoldingSetNodeID &RHS)

Definition ASTContext.h:3942

static FoldingSetNodeID getTombstoneKey()

Definition ASTContext.h:3930

static FoldingSetNodeID getEmptyKey()

Definition ASTContext.h:3928

static unsigned getHashValue(const FoldingSetNodeID &Val)

Definition ASTContext.h:3938

Definition ASTContext.h:56

clang::QualType EltTy

Definition ASTContext.h:57

bool operator==(const ScalableVecTyKey &RHS) const

Definition ASTContext.h:61

unsigned NumElts

Definition ASTContext.h:58

unsigned NumFields

Definition ASTContext.h:59