Coverage Report

Created: 2019-03-22 08:08

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h
Line
Count
Source (jump to first uncovered line)
1
//===- ASTBitCodes.h - Enum values for the PCH bitcode format ---*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This header defines Bitcode enum values for Clang serialized AST files.
10
//
11
// The enum values defined in this file should be considered permanent.  If
12
// new features are added, they should have values added at the end of the
13
// respective lists.
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_CLANG_SERIALIZATION_ASTBITCODES_H
18
#define LLVM_CLANG_SERIALIZATION_ASTBITCODES_H
19
20
#include "clang/AST/DeclarationName.h"
21
#include "clang/AST/Type.h"
22
#include "clang/Basic/IdentifierTable.h"
23
#include "clang/Basic/OperatorKinds.h"
24
#include "clang/Basic/SourceLocation.h"
25
#include "llvm/ADT/DenseMapInfo.h"
26
#include "llvm/Bitcode/BitCodes.h"
27
#include <cassert>
28
#include <cstdint>
29
30
namespace clang {
31
namespace serialization {
32
33
    /// AST file major version number supported by this version of
34
    /// Clang.
35
    ///
36
    /// Whenever the AST file format changes in a way that makes it
37
    /// incompatible with previous versions (such that a reader
38
    /// designed for the previous version could not support reading
39
    /// the new version), this number should be increased.
40
    ///
41
    /// Version 4 of AST files also requires that the version control branch and
42
    /// revision match exactly, since there is no backward compatibility of
43
    /// AST files at this time.
44
    const unsigned VERSION_MAJOR = 7;
45
46
    /// AST file minor version number supported by this version of
47
    /// Clang.
48
    ///
49
    /// Whenever the AST format changes in a way that is still
50
    /// compatible with previous versions (such that a reader designed
51
    /// for the previous version could still support reading the new
52
    /// version by ignoring new kinds of subblocks), this number
53
    /// should be increased.
54
    const unsigned VERSION_MINOR = 0;
55
56
    /// An ID number that refers to an identifier in an AST file.
57
    ///
58
    /// The ID numbers of identifiers are consecutive (in order of discovery)
59
    /// and start at 1. 0 is reserved for NULL.
60
    using IdentifierID = uint32_t;
61
62
    /// An ID number that refers to a declaration in an AST file.
63
    ///
64
    /// The ID numbers of declarations are consecutive (in order of
65
    /// discovery), with values below NUM_PREDEF_DECL_IDS being reserved.
66
    /// At the start of a chain of precompiled headers, declaration ID 1 is
67
    /// used for the translation unit declaration.
68
    using DeclID = uint32_t;
69
70
    // FIXME: Turn these into classes so we can have some type safety when
71
    // we go from local ID to global and vice-versa.
72
    using LocalDeclID = DeclID;
73
    using GlobalDeclID = DeclID;
74
75
    /// An ID number that refers to a type in an AST file.
76
    ///
77
    /// The ID of a type is partitioned into two parts: the lower
78
    /// three bits are used to store the const/volatile/restrict
79
    /// qualifiers (as with QualType) and the upper bits provide a
80
    /// type index. The type index values are partitioned into two
81
    /// sets. The values below NUM_PREDEF_TYPE_IDs are predefined type
82
    /// IDs (based on the PREDEF_TYPE_*_ID constants), with 0 as a
83
    /// placeholder for "no type". Values from NUM_PREDEF_TYPE_IDs are
84
    /// other types that have serialized representations.
85
    using TypeID = uint32_t;
86
87
    /// A type index; the type ID with the qualifier bits removed.
88
    class TypeIdx {
89
      uint32_t Idx = 0;
90
91
    public:
92
157k
      TypeIdx() = default;
93
837k
      explicit TypeIdx(uint32_t index) : Idx(index) {}
94
95
1.50M
      uint32_t getIndex() const { return Idx; }
96
97
1.85M
      TypeID asTypeID(unsigned FastQuals) const {
98
1.85M
        if (Idx == uint32_t(-1))
99
0
          return TypeID(-1);
100
1.85M
101
1.85M
        return (Idx << Qualifiers::FastWidth) | FastQuals;
102
1.85M
      }
103
104
14.1k
      static TypeIdx fromTypeID(TypeID ID) {
105
14.1k
        if (ID == TypeID(-1))
106
0
          return TypeIdx(-1);
107
14.1k
108
14.1k
        return TypeIdx(ID >> Qualifiers::FastWidth);
109
14.1k
      }
110
    };
111
112
    /// A structure for putting "fast"-unqualified QualTypes into a
113
    /// DenseMap.  This uses the standard pointer hash function.
114
    struct UnsafeQualTypeDenseMapInfo {
115
5.68M
      static bool isEqual(QualType A, QualType B) { return A == B; }
116
117
1.65M
      static QualType getEmptyKey() {
118
1.65M
        return QualType::getFromOpaquePtr((void*) 1);
119
1.65M
      }
120
121
1.48M
      static QualType getTombstoneKey() {
122
1.48M
        return QualType::getFromOpaquePtr((void*) 2);
123
1.48M
      }
124
125
1.48M
      static unsigned getHashValue(QualType T) {
126
1.48M
        assert(!T.getLocalFastQualifiers() &&
127
1.48M
               "hash invalid for types with fast quals");
128
1.48M
        uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());
129
1.48M
        return (unsigned(v) >> 4) ^ (unsigned(v) >> 9);
130
1.48M
      }
131
    };
132
133
    /// An ID number that refers to an identifier in an AST file.
134
    using IdentID = uint32_t;
135
136
    /// The number of predefined identifier IDs.
137
    const unsigned int NUM_PREDEF_IDENT_IDS = 1;
138
139
    /// An ID number that refers to a macro in an AST file.
140
    using MacroID = uint32_t;
141
142
    /// A global ID number that refers to a macro in an AST file.
143
    using GlobalMacroID = uint32_t;
144
145
    /// A local to a module ID number that refers to a macro in an
146
    /// AST file.
147
    using LocalMacroID = uint32_t;
148
149
    /// The number of predefined macro IDs.
150
    const unsigned int NUM_PREDEF_MACRO_IDS = 1;
151
152
    /// An ID number that refers to an ObjC selector in an AST file.
153
    using SelectorID = uint32_t;
154
155
    /// The number of predefined selector IDs.
156
    const unsigned int NUM_PREDEF_SELECTOR_IDS = 1;
157
158
    /// An ID number that refers to a set of CXXBaseSpecifiers in an
159
    /// AST file.
160
    using CXXBaseSpecifiersID = uint32_t;
161
162
    /// An ID number that refers to a list of CXXCtorInitializers in an
163
    /// AST file.
164
    using CXXCtorInitializersID = uint32_t;
165
166
    /// An ID number that refers to an entity in the detailed
167
    /// preprocessing record.
168
    using PreprocessedEntityID = uint32_t;
169
170
    /// An ID number that refers to a submodule in a module file.
171
    using SubmoduleID = uint32_t;
172
173
    /// The number of predefined submodule IDs.
174
    const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1;
175
176
    /// Source range/offset of a preprocessed entity.
177
    struct PPEntityOffset {
178
      /// Raw source location of beginning of range.
179
      unsigned Begin;
180
181
      /// Raw source location of end of range.
182
      unsigned End;
183
184
      /// Offset in the AST file.
185
      uint32_t BitOffset;
186
187
      PPEntityOffset(SourceRange R, uint32_t BitOffset)
188
        : Begin(R.getBegin().getRawEncoding()),
189
59.6k
          End(R.getEnd().getRawEncoding()), BitOffset(BitOffset) {}
190
191
51.9k
      SourceLocation getBegin() const {
192
51.9k
        return SourceLocation::getFromRawEncoding(Begin);
193
51.9k
      }
194
195
48.4k
      SourceLocation getEnd() const {
196
48.4k
        return SourceLocation::getFromRawEncoding(End);
197
48.4k
      }
198
    };
199
200
    /// Source range of a skipped preprocessor region
201
    struct PPSkippedRange {
202
      /// Raw source location of beginning of range.
203
      unsigned Begin;
204
      /// Raw source location of end of range.
205
      unsigned End;
206
207
      PPSkippedRange(SourceRange R)
208
        : Begin(R.getBegin().getRawEncoding()),
209
45
          End(R.getEnd().getRawEncoding()) { }
210
211
24
      SourceLocation getBegin() const {
212
24
        return SourceLocation::getFromRawEncoding(Begin);
213
24
      }
214
24
      SourceLocation getEnd() const {
215
24
        return SourceLocation::getFromRawEncoding(End);
216
24
      }
217
    };
218
219
    /// Source range/offset of a preprocessed entity.
220
    struct DeclOffset {
221
      /// Raw source location.
222
      unsigned Loc = 0;
223
224
      /// Offset in the AST file.
225
      uint32_t BitOffset = 0;
226
227
0
      DeclOffset() = default;
228
      DeclOffset(SourceLocation Loc, uint32_t BitOffset)
229
484k
        : Loc(Loc.getRawEncoding()), BitOffset(BitOffset) {}
230
231
0
      void setLocation(SourceLocation L) {
232
0
        Loc = L.getRawEncoding();
233
0
      }
234
235
250k
      SourceLocation getLocation() const {
236
250k
        return SourceLocation::getFromRawEncoding(Loc);
237
250k
      }
238
    };
239
240
    /// The number of predefined preprocessed entity IDs.
241
    const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1;
242
243
    /// Describes the various kinds of blocks that occur within
244
    /// an AST file.
245
    enum BlockIDs {
246
      /// The AST block, which acts as a container around the
247
      /// full AST block.
248
      AST_BLOCK_ID = llvm::bitc::FIRST_APPLICATION_BLOCKID,
249
250
      /// The block containing information about the source
251
      /// manager.
252
      SOURCE_MANAGER_BLOCK_ID,
253
254
      /// The block containing information about the
255
      /// preprocessor.
256
      PREPROCESSOR_BLOCK_ID,
257
258
      /// The block containing the definitions of all of the
259
      /// types and decls used within the AST file.
260
      DECLTYPES_BLOCK_ID,
261
262
      /// The block containing the detailed preprocessing record.
263
      PREPROCESSOR_DETAIL_BLOCK_ID,
264
265
      /// The block containing the submodule structure.
266
      SUBMODULE_BLOCK_ID,
267
268
      /// The block containing comments.
269
      COMMENTS_BLOCK_ID,
270
271
      /// The control block, which contains all of the
272
      /// information that needs to be validated prior to committing
273
      /// to loading the AST file.
274
      CONTROL_BLOCK_ID,
275
276
      /// The block of input files, which were used as inputs
277
      /// to create this AST file.
278
      ///
279
      /// This block is part of the control block.
280
      INPUT_FILES_BLOCK_ID,
281
282
      /// The block of configuration options, used to check that
283
      /// a module is being used in a configuration compatible with the
284
      /// configuration in which it was built.
285
      ///
286
      /// This block is part of the control block.
287
      OPTIONS_BLOCK_ID,
288
289
      /// A block containing a module file extension.
290
      EXTENSION_BLOCK_ID,
291
292
      /// A block with unhashed content.
293
      ///
294
      /// These records should not change the \a ASTFileSignature.  See \a
295
      /// UnhashedControlBlockRecordTypes for the list of records.
296
      UNHASHED_CONTROL_BLOCK_ID,
297
    };
298
299
    /// Record types that occur within the control block.
300
    enum ControlRecordTypes {
301
      /// AST file metadata, including the AST file version number
302
      /// and information about the compiler used to build this AST file.
303
      METADATA = 1,
304
305
      /// Record code for the list of other AST files imported by
306
      /// this AST file.
307
      IMPORTS,
308
309
      /// Record code for the original file that was used to
310
      /// generate the AST file, including both its file ID and its
311
      /// name.
312
      ORIGINAL_FILE,
313
314
      /// The directory that the PCH was originally created in.
315
      ORIGINAL_PCH_DIR,
316
317
      /// Record code for file ID of the file or buffer that was used to
318
      /// generate the AST file.
319
      ORIGINAL_FILE_ID,
320
321
      /// Offsets into the input-files block where input files
322
      /// reside.
323
      INPUT_FILE_OFFSETS,
324
325
      /// Record code for the module name.
326
      MODULE_NAME,
327
328
      /// Record code for the module map file that was used to build this
329
      /// AST file.
330
      MODULE_MAP_FILE,
331
332
      /// Record code for the module build directory.
333
      MODULE_DIRECTORY,
334
    };
335
336
    /// Record types that occur within the options block inside
337
    /// the control block.
338
    enum OptionsRecordTypes {
339
      /// Record code for the language options table.
340
      ///
341
      /// The record with this code contains the contents of the
342
      /// LangOptions structure. We serialize the entire contents of
343
      /// the structure, and let the reader decide which options are
344
      /// actually important to check.
345
      LANGUAGE_OPTIONS = 1,
346
347
      /// Record code for the target options table.
348
      TARGET_OPTIONS,
349
350
      /// Record code for the filesystem options table.
351
      FILE_SYSTEM_OPTIONS,
352
353
      /// Record code for the headers search options table.
354
      HEADER_SEARCH_OPTIONS,
355
356
      /// Record code for the preprocessor options table.
357
      PREPROCESSOR_OPTIONS,
358
    };
359
360
    /// Record codes for the unhashed control block.
361
    enum UnhashedControlBlockRecordTypes {
362
      /// Record code for the signature that identifiers this AST file.
363
      SIGNATURE = 1,
364
365
      /// Record code for the diagnostic options table.
366
      DIAGNOSTIC_OPTIONS,
367
368
      /// Record code for \#pragma diagnostic mappings.
369
      DIAG_PRAGMA_MAPPINGS,
370
    };
371
372
    /// Record code for extension blocks.
373
    enum ExtensionBlockRecordTypes {
374
      /// Metadata describing this particular extension.
375
      EXTENSION_METADATA = 1,
376
377
      /// The first record ID allocated to the extensions themselves.
378
      FIRST_EXTENSION_RECORD_ID = 4
379
    };
380
381
    /// Record types that occur within the input-files block
382
    /// inside the control block.
383
    enum InputFileRecordTypes {
384
      /// An input file.
385
      INPUT_FILE = 1
386
    };
387
388
    /// Record types that occur within the AST block itself.
389
    enum ASTRecordTypes {
390
      /// Record code for the offsets of each type.
391
      ///
392
      /// The TYPE_OFFSET constant describes the record that occurs
393
      /// within the AST block. The record itself is an array of offsets that
394
      /// point into the declarations and types block (identified by
395
      /// DECLTYPES_BLOCK_ID). The index into the array is based on the ID
396
      /// of a type. For a given type ID @c T, the lower three bits of
397
      /// @c T are its qualifiers (const, volatile, restrict), as in
398
      /// the QualType class. The upper bits, after being shifted and
399
      /// subtracting NUM_PREDEF_TYPE_IDS, are used to index into the
400
      /// TYPE_OFFSET block to determine the offset of that type's
401
      /// corresponding record within the DECLTYPES_BLOCK_ID block.
402
      TYPE_OFFSET = 1,
403
404
      /// Record code for the offsets of each decl.
405
      ///
406
      /// The DECL_OFFSET constant describes the record that occurs
407
      /// within the block identified by DECL_OFFSETS_BLOCK_ID within
408
      /// the AST block. The record itself is an array of offsets that
409
      /// point into the declarations and types block (identified by
410
      /// DECLTYPES_BLOCK_ID). The declaration ID is an index into this
411
      /// record, after subtracting one to account for the use of
412
      /// declaration ID 0 for a NULL declaration pointer. Index 0 is
413
      /// reserved for the translation unit declaration.
414
      DECL_OFFSET = 2,
415
416
      /// Record code for the table of offsets of each
417
      /// identifier ID.
418
      ///
419
      /// The offset table contains offsets into the blob stored in
420
      /// the IDENTIFIER_TABLE record. Each offset points to the
421
      /// NULL-terminated string that corresponds to that identifier.
422
      IDENTIFIER_OFFSET = 3,
423
424
      /// This is so that older clang versions, before the introduction
425
      /// of the control block, can read and reject the newer PCH format.
426
      /// *DON'T CHANGE THIS NUMBER*.
427
      METADATA_OLD_FORMAT = 4,
428
429
      /// Record code for the identifier table.
430
      ///
431
      /// The identifier table is a simple blob that contains
432
      /// NULL-terminated strings for all of the identifiers
433
      /// referenced by the AST file. The IDENTIFIER_OFFSET table
434
      /// contains the mapping from identifier IDs to the characters
435
      /// in this blob. Note that the starting offsets of all of the
436
      /// identifiers are odd, so that, when the identifier offset
437
      /// table is loaded in, we can use the low bit to distinguish
438
      /// between offsets (for unresolved identifier IDs) and
439
      /// IdentifierInfo pointers (for already-resolved identifier
440
      /// IDs).
441
      IDENTIFIER_TABLE = 5,
442
443
      /// Record code for the array of eagerly deserialized decls.
444
      ///
445
      /// The AST file contains a list of all of the declarations that should be
446
      /// eagerly deserialized present within the parsed headers, stored as an
447
      /// array of declaration IDs. These declarations will be
448
      /// reported to the AST consumer after the AST file has been
449
      /// read, since their presence can affect the semantics of the
450
      /// program (e.g., for code generation).
451
      EAGERLY_DESERIALIZED_DECLS = 6,
452
453
      /// Record code for the set of non-builtin, special
454
      /// types.
455
      ///
456
      /// This record contains the type IDs for the various type nodes
457
      /// that are constructed during semantic analysis (e.g.,
458
      /// __builtin_va_list). The SPECIAL_TYPE_* constants provide
459
      /// offsets into this record.
460
      SPECIAL_TYPES = 7,
461
462
      /// Record code for the extra statistics we gather while
463
      /// generating an AST file.
464
      STATISTICS = 8,
465
466
      /// Record code for the array of tentative definitions.
467
      TENTATIVE_DEFINITIONS = 9,
468
469
      // ID 10 used to be for a list of extern "C" declarations.
470
471
      /// Record code for the table of offsets into the
472
      /// Objective-C method pool.
473
      SELECTOR_OFFSETS = 11,
474
475
      /// Record code for the Objective-C method pool,
476
      METHOD_POOL = 12,
477
478
      /// The value of the next __COUNTER__ to dispense.
479
      /// [PP_COUNTER_VALUE, Val]
480
      PP_COUNTER_VALUE = 13,
481
482
      /// Record code for the table of offsets into the block
483
      /// of source-location information.
484
      SOURCE_LOCATION_OFFSETS = 14,
485
486
      /// Record code for the set of source location entries
487
      /// that need to be preloaded by the AST reader.
488
      ///
489
      /// This set contains the source location entry for the
490
      /// predefines buffer and for any file entries that need to be
491
      /// preloaded.
492
      SOURCE_LOCATION_PRELOADS = 15,
493
494
      /// Record code for the set of ext_vector type names.
495
      EXT_VECTOR_DECLS = 16,
496
497
      /// Record code for the array of unused file scoped decls.
498
      UNUSED_FILESCOPED_DECLS = 17,
499
500
      /// Record code for the table of offsets to entries in the
501
      /// preprocessing record.
502
      PPD_ENTITIES_OFFSETS = 18,
503
504
      /// Record code for the array of VTable uses.
505
      VTABLE_USES = 19,
506
507
      // ID 20 used to be for a list of dynamic classes.
508
509
      /// Record code for referenced selector pool.
510
      REFERENCED_SELECTOR_POOL = 21,
511
512
      /// Record code for an update to the TU's lexically contained
513
      /// declarations.
514
      TU_UPDATE_LEXICAL = 22,
515
516
      // ID 23 used to be for a list of local redeclarations.
517
518
      /// Record code for declarations that Sema keeps references of.
519
      SEMA_DECL_REFS = 24,
520
521
      /// Record code for weak undeclared identifiers.
522
      WEAK_UNDECLARED_IDENTIFIERS = 25,
523
524
      /// Record code for pending implicit instantiations.
525
      PENDING_IMPLICIT_INSTANTIATIONS = 26,
526
527
      // ID 27 used to be for a list of replacement decls.
528
529
      /// Record code for an update to a decl context's lookup table.
530
      ///
531
      /// In practice, this should only be used for the TU and namespaces.
532
      UPDATE_VISIBLE = 28,
533
534
      /// Record for offsets of DECL_UPDATES records for declarations
535
      /// that were modified after being deserialized and need updates.
536
      DECL_UPDATE_OFFSETS = 29,
537
538
      // ID 30 used to be a decl update record. These are now in the DECLTYPES
539
      // block.
540
541
      // ID 31 used to be a list of offsets to DECL_CXX_BASE_SPECIFIERS records.
542
543
      // ID 32 used to be the code for \#pragma diagnostic mappings.
544
545
      /// Record code for special CUDA declarations.
546
      CUDA_SPECIAL_DECL_REFS = 33,
547
548
      /// Record code for header search information.
549
      HEADER_SEARCH_TABLE = 34,
550
551
      /// Record code for floating point \#pragma options.
552
      FP_PRAGMA_OPTIONS = 35,
553
554
      /// Record code for enabled OpenCL extensions.
555
      OPENCL_EXTENSIONS = 36,
556
557
      /// The list of delegating constructor declarations.
558
      DELEGATING_CTORS = 37,
559
560
      /// Record code for the set of known namespaces, which are used
561
      /// for typo correction.
562
      KNOWN_NAMESPACES = 38,
563
564
      /// Record code for the remapping information used to relate
565
      /// loaded modules to the various offsets and IDs(e.g., source location
566
      /// offests, declaration and type IDs) that are used in that module to
567
      /// refer to other modules.
568
      MODULE_OFFSET_MAP = 39,
569
570
      /// Record code for the source manager line table information,
571
      /// which stores information about \#line directives.
572
      SOURCE_MANAGER_LINE_TABLE = 40,
573
574
      /// Record code for map of Objective-C class definition IDs to the
575
      /// ObjC categories in a module that are attached to that class.
576
      OBJC_CATEGORIES_MAP = 41,
577
578
      /// Record code for a file sorted array of DeclIDs in a module.
579
      FILE_SORTED_DECLS = 42,
580
581
      /// Record code for an array of all of the (sub)modules that were
582
      /// imported by the AST file.
583
      IMPORTED_MODULES = 43,
584
585
      // ID 44 used to be a table of merged canonical declarations.
586
      // ID 45 used to be a list of declaration IDs of local redeclarations.
587
588
      /// Record code for the array of Objective-C categories (including
589
      /// extensions).
590
      ///
591
      /// This array can only be interpreted properly using the Objective-C
592
      /// categories map.
593
      OBJC_CATEGORIES = 46,
594
595
      /// Record code for the table of offsets of each macro ID.
596
      ///
597
      /// The offset table contains offsets into the blob stored in
598
      /// the preprocessor block. Each offset points to the corresponding
599
      /// macro definition.
600
      MACRO_OFFSET = 47,
601
602
      /// A list of "interesting" identifiers. Only used in C++ (where we
603
      /// don't normally do lookups into the serialized identifier table). These
604
      /// are eagerly deserialized.
605
      INTERESTING_IDENTIFIERS = 48,
606
607
      /// Record code for undefined but used functions and variables that
608
      /// need a definition in this TU.
609
      UNDEFINED_BUT_USED = 49,
610
611
      /// Record code for late parsed template functions.
612
      LATE_PARSED_TEMPLATE = 50,
613
614
      /// Record code for \#pragma optimize options.
615
      OPTIMIZE_PRAGMA_OPTIONS = 51,
616
617
      /// Record code for potentially unused local typedef names.
618
      UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES = 52,
619
620
      // ID 53 used to be a table of constructor initializer records.
621
622
      /// Delete expressions that will be analyzed later.
623
      DELETE_EXPRS_TO_ANALYZE = 54,
624
625
      /// Record code for \#pragma ms_struct options.
626
      MSSTRUCT_PRAGMA_OPTIONS = 55,
627
628
      /// Record code for \#pragma ms_struct options.
629
      POINTERS_TO_MEMBERS_PRAGMA_OPTIONS = 56,
630
631
      /// Number of unmatched #pragma clang cuda_force_host_device begin
632
      /// directives we've seen.
633
      CUDA_PRAGMA_FORCE_HOST_DEVICE_DEPTH = 57,
634
635
      /// Record code for types associated with OpenCL extensions.
636
      OPENCL_EXTENSION_TYPES = 58,
637
638
      /// Record code for declarations associated with OpenCL extensions.
639
      OPENCL_EXTENSION_DECLS = 59,
640
641
      MODULAR_CODEGEN_DECLS = 60,
642
643
      /// Record code for \#pragma pack options.
644
      PACK_PRAGMA_OPTIONS = 61,
645
646
      /// The stack of open #ifs/#ifdefs recorded in a preamble.
647
      PP_CONDITIONAL_STACK = 62,
648
649
      /// A table of skipped ranges within the preprocessing record.
650
      PPD_SKIPPED_RANGES = 63
651
    };
652
653
    /// Record types used within a source manager block.
654
    enum SourceManagerRecordTypes {
655
      /// Describes a source location entry (SLocEntry) for a
656
      /// file.
657
      SM_SLOC_FILE_ENTRY = 1,
658
659
      /// Describes a source location entry (SLocEntry) for a
660
      /// buffer.
661
      SM_SLOC_BUFFER_ENTRY = 2,
662
663
      /// Describes a blob that contains the data for a buffer
664
      /// entry. This kind of record always directly follows a
665
      /// SM_SLOC_BUFFER_ENTRY record or a SM_SLOC_FILE_ENTRY with an
666
      /// overridden buffer.
667
      SM_SLOC_BUFFER_BLOB = 3,
668
669
      /// Describes a zlib-compressed blob that contains the data for
670
      /// a buffer entry.
671
      SM_SLOC_BUFFER_BLOB_COMPRESSED = 4,
672
673
      /// Describes a source location entry (SLocEntry) for a
674
      /// macro expansion.
675
      SM_SLOC_EXPANSION_ENTRY = 5
676
    };
677
678
    /// Record types used within a preprocessor block.
679
    enum PreprocessorRecordTypes {
680
      // The macros in the PP section are a PP_MACRO_* instance followed by a
681
      // list of PP_TOKEN instances for each token in the definition.
682
683
      /// An object-like macro definition.
684
      /// [PP_MACRO_OBJECT_LIKE, IdentInfoID, SLoc, IsUsed]
685
      PP_MACRO_OBJECT_LIKE = 1,
686
687
      /// A function-like macro definition.
688
      /// [PP_MACRO_FUNCTION_LIKE, \<ObjectLikeStuff>, IsC99Varargs,
689
      /// IsGNUVarars, NumArgs, ArgIdentInfoID* ]
690
      PP_MACRO_FUNCTION_LIKE = 2,
691
692
      /// Describes one token.
693
      /// [PP_TOKEN, SLoc, Length, IdentInfoID, Kind, Flags]
694
      PP_TOKEN = 3,
695
696
      /// The macro directives history for a particular identifier.
697
      PP_MACRO_DIRECTIVE_HISTORY = 4,
698
699
      /// A macro directive exported by a module.
700
      /// [PP_MODULE_MACRO, SubmoduleID, MacroID, (Overridden SubmoduleID)*]
701
      PP_MODULE_MACRO = 5,
702
    };
703
704
    /// Record types used within a preprocessor detail block.
705
    enum PreprocessorDetailRecordTypes {
706
      /// Describes a macro expansion within the preprocessing record.
707
      PPD_MACRO_EXPANSION = 0,
708
709
      /// Describes a macro definition within the preprocessing record.
710
      PPD_MACRO_DEFINITION = 1,
711
712
      /// Describes an inclusion directive within the preprocessing
713
      /// record.
714
      PPD_INCLUSION_DIRECTIVE = 2
715
    };
716
717
    /// Record types used within a submodule description block.
718
    enum SubmoduleRecordTypes {
719
      /// Metadata for submodules as a whole.
720
      SUBMODULE_METADATA = 0,
721
722
      /// Defines the major attributes of a submodule, including its
723
      /// name and parent.
724
      SUBMODULE_DEFINITION = 1,
725
726
      /// Specifies the umbrella header used to create this module,
727
      /// if any.
728
      SUBMODULE_UMBRELLA_HEADER = 2,
729
730
      /// Specifies a header that falls into this (sub)module.
731
      SUBMODULE_HEADER = 3,
732
733
      /// Specifies a top-level header that falls into this (sub)module.
734
      SUBMODULE_TOPHEADER = 4,
735
736
      /// Specifies an umbrella directory.
737
      SUBMODULE_UMBRELLA_DIR = 5,
738
739
      /// Specifies the submodules that are imported by this
740
      /// submodule.
741
      SUBMODULE_IMPORTS = 6,
742
743
      /// Specifies the submodules that are re-exported from this
744
      /// submodule.
745
      SUBMODULE_EXPORTS = 7,
746
747
      /// Specifies a required feature.
748
      SUBMODULE_REQUIRES = 8,
749
750
      /// Specifies a header that has been explicitly excluded
751
      /// from this submodule.
752
      SUBMODULE_EXCLUDED_HEADER = 9,
753
754
      /// Specifies a library or framework to link against.
755
      SUBMODULE_LINK_LIBRARY = 10,
756
757
      /// Specifies a configuration macro for this module.
758
      SUBMODULE_CONFIG_MACRO = 11,
759
760
      /// Specifies a conflict with another module.
761
      SUBMODULE_CONFLICT = 12,
762
763
      /// Specifies a header that is private to this submodule.
764
      SUBMODULE_PRIVATE_HEADER = 13,
765
766
      /// Specifies a header that is part of the module but must be
767
      /// textually included.
768
      SUBMODULE_TEXTUAL_HEADER = 14,
769
770
      /// Specifies a header that is private to this submodule but
771
      /// must be textually included.
772
      SUBMODULE_PRIVATE_TEXTUAL_HEADER = 15,
773
774
      /// Specifies some declarations with initializers that must be
775
      /// emitted to initialize the module.
776
      SUBMODULE_INITIALIZERS = 16,
777
778
      /// Specifies the name of the module that will eventually
779
      /// re-export the entities in this module.
780
      SUBMODULE_EXPORT_AS = 17,
781
    };
782
783
    /// Record types used within a comments block.
784
    enum CommentRecordTypes {
785
      COMMENTS_RAW_COMMENT = 0
786
    };
787
788
    /// \defgroup ASTAST AST file AST constants
789
    ///
790
    /// The constants in this group describe various components of the
791
    /// abstract syntax tree within an AST file.
792
    ///
793
    /// @{
794
795
    /// Predefined type IDs.
796
    ///
797
    /// These type IDs correspond to predefined types in the AST
798
    /// context, such as built-in types (int) and special place-holder
799
    /// types (the \<overload> and \<dependent> type markers). Such
800
    /// types are never actually serialized, since they will be built
801
    /// by the AST context when it is created.
802
    enum PredefinedTypeIDs {
803
      /// The NULL type.
804
      PREDEF_TYPE_NULL_ID       = 0,
805
806
      /// The void type.
807
      PREDEF_TYPE_VOID_ID       = 1,
808
809
      /// The 'bool' or '_Bool' type.
810
      PREDEF_TYPE_BOOL_ID       = 2,
811
812
      /// The 'char' type, when it is unsigned.
813
      PREDEF_TYPE_CHAR_U_ID     = 3,
814
815
      /// The 'unsigned char' type.
816
      PREDEF_TYPE_UCHAR_ID      = 4,
817
818
      /// The 'unsigned short' type.
819
      PREDEF_TYPE_USHORT_ID     = 5,
820
821
      /// The 'unsigned int' type.
822
      PREDEF_TYPE_UINT_ID       = 6,
823
824
      /// The 'unsigned long' type.
825
      PREDEF_TYPE_ULONG_ID      = 7,
826
827
      /// The 'unsigned long long' type.
828
      PREDEF_TYPE_ULONGLONG_ID  = 8,
829
830
      /// The 'char' type, when it is signed.
831
      PREDEF_TYPE_CHAR_S_ID     = 9,
832
833
      /// The 'signed char' type.
834
      PREDEF_TYPE_SCHAR_ID      = 10,
835
836
      /// The C++ 'wchar_t' type.
837
      PREDEF_TYPE_WCHAR_ID      = 11,
838
839
      /// The (signed) 'short' type.
840
      PREDEF_TYPE_SHORT_ID      = 12,
841
842
      /// The (signed) 'int' type.
843
      PREDEF_TYPE_INT_ID        = 13,
844
845
      /// The (signed) 'long' type.
846
      PREDEF_TYPE_LONG_ID       = 14,
847
848
      /// The (signed) 'long long' type.
849
      PREDEF_TYPE_LONGLONG_ID   = 15,
850
851
      /// The 'float' type.
852
      PREDEF_TYPE_FLOAT_ID      = 16,
853
854
      /// The 'double' type.
855
      PREDEF_TYPE_DOUBLE_ID     = 17,
856
857
      /// The 'long double' type.
858
      PREDEF_TYPE_LONGDOUBLE_ID = 18,
859
860
      /// The placeholder type for overloaded function sets.
861
      PREDEF_TYPE_OVERLOAD_ID   = 19,
862
863
      /// The placeholder type for dependent types.
864
      PREDEF_TYPE_DEPENDENT_ID  = 20,
865
866
      /// The '__uint128_t' type.
867
      PREDEF_TYPE_UINT128_ID    = 21,
868
869
      /// The '__int128_t' type.
870
      PREDEF_TYPE_INT128_ID     = 22,
871
872
      /// The type of 'nullptr'.
873
      PREDEF_TYPE_NULLPTR_ID    = 23,
874
875
      /// The C++ 'char16_t' type.
876
      PREDEF_TYPE_CHAR16_ID     = 24,
877
878
      /// The C++ 'char32_t' type.
879
      PREDEF_TYPE_CHAR32_ID     = 25,
880
881
      /// The ObjC 'id' type.
882
      PREDEF_TYPE_OBJC_ID       = 26,
883
884
      /// The ObjC 'Class' type.
885
      PREDEF_TYPE_OBJC_CLASS    = 27,
886
887
      /// The ObjC 'SEL' type.
888
      PREDEF_TYPE_OBJC_SEL      = 28,
889
890
      /// The 'unknown any' placeholder type.
891
      PREDEF_TYPE_UNKNOWN_ANY   = 29,
892
893
      /// The placeholder type for bound member functions.
894
      PREDEF_TYPE_BOUND_MEMBER  = 30,
895
896
      /// The "auto" deduction type.
897
      PREDEF_TYPE_AUTO_DEDUCT   = 31,
898
899
      /// The "auto &&" deduction type.
900
      PREDEF_TYPE_AUTO_RREF_DEDUCT = 32,
901
902
      /// The OpenCL 'half' / ARM NEON __fp16 type.
903
      PREDEF_TYPE_HALF_ID       = 33,
904
905
      /// ARC's unbridged-cast placeholder type.
906
      PREDEF_TYPE_ARC_UNBRIDGED_CAST = 34,
907
908
      /// The pseudo-object placeholder type.
909
      PREDEF_TYPE_PSEUDO_OBJECT = 35,
910
911
      /// The placeholder type for builtin functions.
912
      PREDEF_TYPE_BUILTIN_FN = 36,
913
914
      /// OpenCL event type.
915
      PREDEF_TYPE_EVENT_ID      = 37,
916
917
      /// OpenCL clk event type.
918
      PREDEF_TYPE_CLK_EVENT_ID  = 38,
919
920
      /// OpenCL sampler type.
921
      PREDEF_TYPE_SAMPLER_ID    = 39,
922
923
      /// OpenCL queue type.
924
      PREDEF_TYPE_QUEUE_ID      = 40,
925
926
      /// OpenCL reserve_id type.
927
      PREDEF_TYPE_RESERVE_ID_ID = 41,
928
929
      /// The placeholder type for OpenMP array section.
930
      PREDEF_TYPE_OMP_ARRAY_SECTION = 42,
931
932
      /// The '__float128' type
933
      PREDEF_TYPE_FLOAT128_ID = 43,
934
935
      /// The '_Float16' type
936
      PREDEF_TYPE_FLOAT16_ID = 44,
937
938
      /// The C++ 'char8_t' type.
939
      PREDEF_TYPE_CHAR8_ID = 45,
940
941
      /// \brief The 'short _Accum' type
942
      PREDEF_TYPE_SHORT_ACCUM_ID    = 46,
943
944
      /// \brief The '_Accum' type
945
      PREDEF_TYPE_ACCUM_ID      = 47,
946
947
      /// \brief The 'long _Accum' type
948
      PREDEF_TYPE_LONG_ACCUM_ID = 48,
949
950
      /// \brief The 'unsigned short _Accum' type
951
      PREDEF_TYPE_USHORT_ACCUM_ID   = 49,
952
953
      /// \brief The 'unsigned _Accum' type
954
      PREDEF_TYPE_UACCUM_ID     = 50,
955
956
      /// \brief The 'unsigned long _Accum' type
957
      PREDEF_TYPE_ULONG_ACCUM_ID    = 51,
958
959
      /// \brief The 'short _Fract' type
960
      PREDEF_TYPE_SHORT_FRACT_ID = 52,
961
962
      /// \brief The '_Fract' type
963
      PREDEF_TYPE_FRACT_ID = 53,
964
965
      /// \brief The 'long _Fract' type
966
      PREDEF_TYPE_LONG_FRACT_ID = 54,
967
968
      /// \brief The 'unsigned short _Fract' type
969
      PREDEF_TYPE_USHORT_FRACT_ID = 55,
970
971
      /// \brief The 'unsigned _Fract' type
972
      PREDEF_TYPE_UFRACT_ID = 56,
973
974
      /// \brief The 'unsigned long _Fract' type
975
      PREDEF_TYPE_ULONG_FRACT_ID = 57,
976
977
      /// \brief The '_Sat short _Accum' type
978
      PREDEF_TYPE_SAT_SHORT_ACCUM_ID = 58,
979
980
      /// \brief The '_Sat _Accum' type
981
      PREDEF_TYPE_SAT_ACCUM_ID = 59,
982
983
      /// \brief The '_Sat long _Accum' type
984
      PREDEF_TYPE_SAT_LONG_ACCUM_ID = 60,
985
986
      /// \brief The '_Sat unsigned short _Accum' type
987
      PREDEF_TYPE_SAT_USHORT_ACCUM_ID = 61,
988
989
      /// \brief The '_Sat unsigned _Accum' type
990
      PREDEF_TYPE_SAT_UACCUM_ID = 62,
991
992
      /// \brief The '_Sat unsigned long _Accum' type
993
      PREDEF_TYPE_SAT_ULONG_ACCUM_ID = 63,
994
995
      /// \brief The '_Sat short _Fract' type
996
      PREDEF_TYPE_SAT_SHORT_FRACT_ID = 64,
997
998
      /// \brief The '_Sat _Fract' type
999
      PREDEF_TYPE_SAT_FRACT_ID = 65,
1000
1001
      /// \brief The '_Sat long _Fract' type
1002
      PREDEF_TYPE_SAT_LONG_FRACT_ID = 66,
1003
1004
      /// \brief The '_Sat unsigned short _Fract' type
1005
      PREDEF_TYPE_SAT_USHORT_FRACT_ID = 67,
1006
1007
      /// \brief The '_Sat unsigned _Fract' type
1008
      PREDEF_TYPE_SAT_UFRACT_ID = 68,
1009
1010
      /// \brief The '_Sat unsigned long _Fract' type
1011
      PREDEF_TYPE_SAT_ULONG_FRACT_ID = 69,
1012
1013
      /// OpenCL image types with auto numeration
1014
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
1015
      PREDEF_TYPE_##Id##_ID,
1016
#include "clang/Basic/OpenCLImageTypes.def"
1017
      /// \brief OpenCL extension types with auto numeration
1018
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
1019
      PREDEF_TYPE_##Id##_ID,
1020
#include "clang/Basic/OpenCLExtensionTypes.def"
1021
    };
1022
1023
    /// The number of predefined type IDs that are reserved for
1024
    /// the PREDEF_TYPE_* constants.
1025
    ///
1026
    /// Type IDs for non-predefined types will start at
1027
    /// NUM_PREDEF_TYPE_IDs.
1028
    const unsigned NUM_PREDEF_TYPE_IDS = 200;
1029
1030
    /// Record codes for each kind of type.
1031
    ///
1032
    /// These constants describe the type records that can occur within a
1033
    /// block identified by DECLTYPES_BLOCK_ID in the AST file. Each
1034
    /// constant describes a record for a specific type class in the
1035
    /// AST. Note that DeclCode values share this code space.
1036
    enum TypeCode {
1037
      /// An ExtQualType record.
1038
      TYPE_EXT_QUAL = 1,
1039
1040
      /// A ComplexType record.
1041
      TYPE_COMPLEX = 3,
1042
1043
      /// A PointerType record.
1044
      TYPE_POINTER = 4,
1045
1046
      /// A BlockPointerType record.
1047
      TYPE_BLOCK_POINTER = 5,
1048
1049
      /// An LValueReferenceType record.
1050
      TYPE_LVALUE_REFERENCE = 6,
1051
1052
      /// An RValueReferenceType record.
1053
      TYPE_RVALUE_REFERENCE = 7,
1054
1055
      /// A MemberPointerType record.
1056
      TYPE_MEMBER_POINTER = 8,
1057
1058
      /// A ConstantArrayType record.
1059
      TYPE_CONSTANT_ARRAY = 9,
1060
1061
      /// An IncompleteArrayType record.
1062
      TYPE_INCOMPLETE_ARRAY = 10,
1063
1064
      /// A VariableArrayType record.
1065
      TYPE_VARIABLE_ARRAY = 11,
1066
1067
      /// A VectorType record.
1068
      TYPE_VECTOR = 12,
1069
1070
      /// An ExtVectorType record.
1071
      TYPE_EXT_VECTOR = 13,
1072
1073
      /// A FunctionNoProtoType record.
1074
      TYPE_FUNCTION_NO_PROTO = 14,
1075
1076
      /// A FunctionProtoType record.
1077
      TYPE_FUNCTION_PROTO = 15,
1078
1079
      /// A TypedefType record.
1080
      TYPE_TYPEDEF = 16,
1081
1082
      /// A TypeOfExprType record.
1083
      TYPE_TYPEOF_EXPR = 17,
1084
1085
      /// A TypeOfType record.
1086
      TYPE_TYPEOF = 18,
1087
1088
      /// A RecordType record.
1089
      TYPE_RECORD = 19,
1090
1091
      /// An EnumType record.
1092
      TYPE_ENUM = 20,
1093
1094
      /// An ObjCInterfaceType record.
1095
      TYPE_OBJC_INTERFACE = 21,
1096
1097
      /// An ObjCObjectPointerType record.
1098
      TYPE_OBJC_OBJECT_POINTER = 22,
1099
1100
      /// a DecltypeType record.
1101
      TYPE_DECLTYPE = 23,
1102
1103
      /// An ElaboratedType record.
1104
      TYPE_ELABORATED = 24,
1105
1106
      /// A SubstTemplateTypeParmType record.
1107
      TYPE_SUBST_TEMPLATE_TYPE_PARM = 25,
1108
1109
      /// An UnresolvedUsingType record.
1110
      TYPE_UNRESOLVED_USING = 26,
1111
1112
      /// An InjectedClassNameType record.
1113
      TYPE_INJECTED_CLASS_NAME = 27,
1114
1115
      /// An ObjCObjectType record.
1116
      TYPE_OBJC_OBJECT = 28,
1117
1118
      /// An TemplateTypeParmType record.
1119
      TYPE_TEMPLATE_TYPE_PARM = 29,
1120
1121
      /// An TemplateSpecializationType record.
1122
      TYPE_TEMPLATE_SPECIALIZATION = 30,
1123
1124
      /// A DependentNameType record.
1125
      TYPE_DEPENDENT_NAME = 31,
1126
1127
      /// A DependentTemplateSpecializationType record.
1128
      TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION = 32,
1129
1130
      /// A DependentSizedArrayType record.
1131
      TYPE_DEPENDENT_SIZED_ARRAY = 33,
1132
1133
      /// A ParenType record.
1134
      TYPE_PAREN = 34,
1135
1136
      /// A PackExpansionType record.
1137
      TYPE_PACK_EXPANSION = 35,
1138
1139
      /// An AttributedType record.
1140
      TYPE_ATTRIBUTED = 36,
1141
1142
      /// A SubstTemplateTypeParmPackType record.
1143
      TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK = 37,
1144
1145
      /// A AutoType record.
1146
      TYPE_AUTO = 38,
1147
1148
      /// A UnaryTransformType record.
1149
      TYPE_UNARY_TRANSFORM = 39,
1150
1151
      /// An AtomicType record.
1152
      TYPE_ATOMIC = 40,
1153
1154
      /// A DecayedType record.
1155
      TYPE_DECAYED = 41,
1156
1157
      /// An AdjustedType record.
1158
      TYPE_ADJUSTED = 42,
1159
1160
      /// A PipeType record.
1161
      TYPE_PIPE = 43,
1162
1163
      /// An ObjCTypeParamType record.
1164
      TYPE_OBJC_TYPE_PARAM = 44,
1165
1166
      /// A DeducedTemplateSpecializationType record.
1167
      TYPE_DEDUCED_TEMPLATE_SPECIALIZATION = 45,
1168
1169
      /// A DependentSizedExtVectorType record.
1170
      TYPE_DEPENDENT_SIZED_EXT_VECTOR = 46,
1171
1172
      /// A DependentAddressSpaceType record.
1173
      TYPE_DEPENDENT_ADDRESS_SPACE = 47,
1174
1175
      /// A dependentSizedVectorType record.
1176
      TYPE_DEPENDENT_SIZED_VECTOR = 48
1177
    };
1178
1179
    /// The type IDs for special types constructed by semantic
1180
    /// analysis.
1181
    ///
1182
    /// The constants in this enumeration are indices into the
1183
    /// SPECIAL_TYPES record.
1184
    enum SpecialTypeIDs {
1185
      /// CFConstantString type
1186
      SPECIAL_TYPE_CF_CONSTANT_STRING          = 0,
1187
1188
      /// C FILE typedef type
1189
      SPECIAL_TYPE_FILE                        = 1,
1190
1191
      /// C jmp_buf typedef type
1192
      SPECIAL_TYPE_JMP_BUF                     = 2,
1193
1194
      /// C sigjmp_buf typedef type
1195
      SPECIAL_TYPE_SIGJMP_BUF                  = 3,
1196
1197
      /// Objective-C "id" redefinition type
1198
      SPECIAL_TYPE_OBJC_ID_REDEFINITION        = 4,
1199
1200
      /// Objective-C "Class" redefinition type
1201
      SPECIAL_TYPE_OBJC_CLASS_REDEFINITION     = 5,
1202
1203
      /// Objective-C "SEL" redefinition type
1204
      SPECIAL_TYPE_OBJC_SEL_REDEFINITION       = 6,
1205
1206
      /// C ucontext_t typedef type
1207
      SPECIAL_TYPE_UCONTEXT_T                  = 7
1208
    };
1209
1210
    /// The number of special type IDs.
1211
    const unsigned NumSpecialTypeIDs = 8;
1212
1213
    /// Predefined declaration IDs.
1214
    ///
1215
    /// These declaration IDs correspond to predefined declarations in the AST
1216
    /// context, such as the NULL declaration ID. Such declarations are never
1217
    /// actually serialized, since they will be built by the AST context when
1218
    /// it is created.
1219
    enum PredefinedDeclIDs {
1220
      /// The NULL declaration.
1221
      PREDEF_DECL_NULL_ID = 0,
1222
1223
      /// The translation unit.
1224
      PREDEF_DECL_TRANSLATION_UNIT_ID = 1,
1225
1226
      /// The Objective-C 'id' type.
1227
      PREDEF_DECL_OBJC_ID_ID = 2,
1228
1229
      /// The Objective-C 'SEL' type.
1230
      PREDEF_DECL_OBJC_SEL_ID = 3,
1231
1232
      /// The Objective-C 'Class' type.
1233
      PREDEF_DECL_OBJC_CLASS_ID = 4,
1234
1235
      /// The Objective-C 'Protocol' type.
1236
      PREDEF_DECL_OBJC_PROTOCOL_ID = 5,
1237
1238
      /// The signed 128-bit integer type.
1239
      PREDEF_DECL_INT_128_ID = 6,
1240
1241
      /// The unsigned 128-bit integer type.
1242
      PREDEF_DECL_UNSIGNED_INT_128_ID = 7,
1243
1244
      /// The internal 'instancetype' typedef.
1245
      PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8,
1246
1247
      /// The internal '__builtin_va_list' typedef.
1248
      PREDEF_DECL_BUILTIN_VA_LIST_ID = 9,
1249
1250
      /// The internal '__va_list_tag' struct, if any.
1251
      PREDEF_DECL_VA_LIST_TAG = 10,
1252
1253
      /// The internal '__builtin_ms_va_list' typedef.
1254
      PREDEF_DECL_BUILTIN_MS_VA_LIST_ID = 11,
1255
1256
      /// The extern "C" context.
1257
      PREDEF_DECL_EXTERN_C_CONTEXT_ID = 12,
1258
1259
      /// The internal '__make_integer_seq' template.
1260
      PREDEF_DECL_MAKE_INTEGER_SEQ_ID = 13,
1261
1262
      /// The internal '__NSConstantString' typedef.
1263
      PREDEF_DECL_CF_CONSTANT_STRING_ID = 14,
1264
1265
      /// The internal '__NSConstantString' tag type.
1266
      PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID = 15,
1267
1268
      /// The internal '__type_pack_element' template.
1269
      PREDEF_DECL_TYPE_PACK_ELEMENT_ID = 16,
1270
    };
1271
1272
    /// The number of declaration IDs that are predefined.
1273
    ///
1274
    /// For more information about predefined declarations, see the
1275
    /// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.
1276
    const unsigned int NUM_PREDEF_DECL_IDS = 17;
1277
1278
    /// Record of updates for a declaration that was modified after
1279
    /// being deserialized. This can occur within DECLTYPES_BLOCK_ID.
1280
    const unsigned int DECL_UPDATES = 49;
1281
1282
    /// Record code for a list of local redeclarations of a declaration.
1283
    /// This can occur within DECLTYPES_BLOCK_ID.
1284
    const unsigned int LOCAL_REDECLARATIONS = 50;
1285
1286
    /// Record codes for each kind of declaration.
1287
    ///
1288
    /// These constants describe the declaration records that can occur within
1289
    /// a declarations block (identified by DECLTYPES_BLOCK_ID). Each
1290
    /// constant describes a record for a specific declaration class
1291
    /// in the AST. Note that TypeCode values share this code space.
1292
    enum DeclCode {
1293
      /// A TypedefDecl record.
1294
      DECL_TYPEDEF = 51,
1295
      /// A TypeAliasDecl record.
1296
1297
      DECL_TYPEALIAS,
1298
1299
      /// An EnumDecl record.
1300
      DECL_ENUM,
1301
1302
      /// A RecordDecl record.
1303
      DECL_RECORD,
1304
1305
      /// An EnumConstantDecl record.
1306
      DECL_ENUM_CONSTANT,
1307
1308
      /// A FunctionDecl record.
1309
      DECL_FUNCTION,
1310
1311
      /// A ObjCMethodDecl record.
1312
      DECL_OBJC_METHOD,
1313
1314
      /// A ObjCInterfaceDecl record.
1315
      DECL_OBJC_INTERFACE,
1316
1317
      /// A ObjCProtocolDecl record.
1318
      DECL_OBJC_PROTOCOL,
1319
1320
      /// A ObjCIvarDecl record.
1321
      DECL_OBJC_IVAR,
1322
1323
      /// A ObjCAtDefsFieldDecl record.
1324
      DECL_OBJC_AT_DEFS_FIELD,
1325
1326
      /// A ObjCCategoryDecl record.
1327
      DECL_OBJC_CATEGORY,
1328
1329
      /// A ObjCCategoryImplDecl record.
1330
      DECL_OBJC_CATEGORY_IMPL,
1331
1332
      /// A ObjCImplementationDecl record.
1333
      DECL_OBJC_IMPLEMENTATION,
1334
1335
      /// A ObjCCompatibleAliasDecl record.
1336
      DECL_OBJC_COMPATIBLE_ALIAS,
1337
1338
      /// A ObjCPropertyDecl record.
1339
      DECL_OBJC_PROPERTY,
1340
1341
      /// A ObjCPropertyImplDecl record.
1342
      DECL_OBJC_PROPERTY_IMPL,
1343
1344
      /// A FieldDecl record.
1345
      DECL_FIELD,
1346
1347
      /// A MSPropertyDecl record.
1348
      DECL_MS_PROPERTY,
1349
1350
      /// A VarDecl record.
1351
      DECL_VAR,
1352
1353
      /// An ImplicitParamDecl record.
1354
      DECL_IMPLICIT_PARAM,
1355
1356
      /// A ParmVarDecl record.
1357
      DECL_PARM_VAR,
1358
1359
      /// A DecompositionDecl record.
1360
      DECL_DECOMPOSITION,
1361
1362
      /// A BindingDecl record.
1363
      DECL_BINDING,
1364
1365
      /// A FileScopeAsmDecl record.
1366
      DECL_FILE_SCOPE_ASM,
1367
1368
      /// A BlockDecl record.
1369
      DECL_BLOCK,
1370
1371
      /// A CapturedDecl record.
1372
      DECL_CAPTURED,
1373
1374
      /// A record that stores the set of declarations that are
1375
      /// lexically stored within a given DeclContext.
1376
      ///
1377
      /// The record itself is a blob that is an array of declaration IDs,
1378
      /// in the order in which those declarations were added to the
1379
      /// declaration context. This data is used when iterating over
1380
      /// the contents of a DeclContext, e.g., via
1381
      /// DeclContext::decls_begin() and DeclContext::decls_end().
1382
      DECL_CONTEXT_LEXICAL,
1383
1384
      /// A record that stores the set of declarations that are
1385
      /// visible from a given DeclContext.
1386
      ///
1387
      /// The record itself stores a set of mappings, each of which
1388
      /// associates a declaration name with one or more declaration
1389
      /// IDs. This data is used when performing qualified name lookup
1390
      /// into a DeclContext via DeclContext::lookup.
1391
      DECL_CONTEXT_VISIBLE,
1392
1393
      /// A LabelDecl record.
1394
      DECL_LABEL,
1395
1396
      /// A NamespaceDecl record.
1397
      DECL_NAMESPACE,
1398
1399
      /// A NamespaceAliasDecl record.
1400
      DECL_NAMESPACE_ALIAS,
1401
1402
      /// A UsingDecl record.
1403
      DECL_USING,
1404
1405
      /// A UsingPackDecl record.
1406
      DECL_USING_PACK,
1407
1408
      /// A UsingShadowDecl record.
1409
      DECL_USING_SHADOW,
1410
1411
      /// A ConstructorUsingShadowDecl record.
1412
      DECL_CONSTRUCTOR_USING_SHADOW,
1413
1414
      /// A UsingDirecitveDecl record.
1415
      DECL_USING_DIRECTIVE,
1416
1417
      /// An UnresolvedUsingValueDecl record.
1418
      DECL_UNRESOLVED_USING_VALUE,
1419
1420
      /// An UnresolvedUsingTypenameDecl record.
1421
      DECL_UNRESOLVED_USING_TYPENAME,
1422
1423
      /// A LinkageSpecDecl record.
1424
      DECL_LINKAGE_SPEC,
1425
1426
      /// An ExportDecl record.
1427
      DECL_EXPORT,
1428
1429
      /// A CXXRecordDecl record.
1430
      DECL_CXX_RECORD,
1431
1432
      /// A CXXDeductionGuideDecl record.
1433
      DECL_CXX_DEDUCTION_GUIDE,
1434
1435
      /// A CXXMethodDecl record.
1436
      DECL_CXX_METHOD,
1437
1438
      /// A CXXConstructorDecl record.
1439
      DECL_CXX_CONSTRUCTOR,
1440
1441
      /// A CXXConstructorDecl record for an inherited constructor.
1442
      DECL_CXX_INHERITED_CONSTRUCTOR,
1443
1444
      /// A CXXDestructorDecl record.
1445
      DECL_CXX_DESTRUCTOR,
1446
1447
      /// A CXXConversionDecl record.
1448
      DECL_CXX_CONVERSION,
1449
1450
      /// An AccessSpecDecl record.
1451
      DECL_ACCESS_SPEC,
1452
1453
      /// A FriendDecl record.
1454
      DECL_FRIEND,
1455
1456
      /// A FriendTemplateDecl record.
1457
      DECL_FRIEND_TEMPLATE,
1458
1459
      /// A ClassTemplateDecl record.
1460
      DECL_CLASS_TEMPLATE,
1461
1462
      /// A ClassTemplateSpecializationDecl record.
1463
      DECL_CLASS_TEMPLATE_SPECIALIZATION,
1464
1465
      /// A ClassTemplatePartialSpecializationDecl record.
1466
      DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
1467
1468
      /// A VarTemplateDecl record.
1469
      DECL_VAR_TEMPLATE,
1470
1471
      /// A VarTemplateSpecializationDecl record.
1472
      DECL_VAR_TEMPLATE_SPECIALIZATION,
1473
1474
      /// A VarTemplatePartialSpecializationDecl record.
1475
      DECL_VAR_TEMPLATE_PARTIAL_SPECIALIZATION,
1476
1477
      /// A FunctionTemplateDecl record.
1478
      DECL_FUNCTION_TEMPLATE,
1479
1480
      /// A TemplateTypeParmDecl record.
1481
      DECL_TEMPLATE_TYPE_PARM,
1482
1483
      /// A NonTypeTemplateParmDecl record.
1484
      DECL_NON_TYPE_TEMPLATE_PARM,
1485
1486
      /// A TemplateTemplateParmDecl record.
1487
      DECL_TEMPLATE_TEMPLATE_PARM,
1488
1489
      /// A TypeAliasTemplateDecl record.
1490
      DECL_TYPE_ALIAS_TEMPLATE,
1491
1492
      /// A StaticAssertDecl record.
1493
      DECL_STATIC_ASSERT,
1494
1495
      /// A record containing CXXBaseSpecifiers.
1496
      DECL_CXX_BASE_SPECIFIERS,
1497
1498
      /// A record containing CXXCtorInitializers.
1499
      DECL_CXX_CTOR_INITIALIZERS,
1500
1501
      /// A IndirectFieldDecl record.
1502
      DECL_INDIRECTFIELD,
1503
1504
      /// A NonTypeTemplateParmDecl record that stores an expanded
1505
      /// non-type template parameter pack.
1506
      DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK,
1507
1508
      /// A TemplateTemplateParmDecl record that stores an expanded
1509
      /// template template parameter pack.
1510
      DECL_EXPANDED_TEMPLATE_TEMPLATE_PARM_PACK,
1511
1512
      /// A ClassScopeFunctionSpecializationDecl record a class scope
1513
      /// function specialization. (Microsoft extension).
1514
      DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION,
1515
1516
      /// An ImportDecl recording a module import.
1517
      DECL_IMPORT,
1518
1519
      /// An OMPThreadPrivateDecl record.
1520
      DECL_OMP_THREADPRIVATE,
1521
1522
      /// An OMPRequiresDecl record.
1523
      DECL_OMP_REQUIRES,
1524
1525
      /// An OMPAllocateDcl record.
1526
      DECL_OMP_ALLOCATE,
1527
1528
      /// An EmptyDecl record.
1529
      DECL_EMPTY,
1530
1531
      /// An ObjCTypeParamDecl record.
1532
      DECL_OBJC_TYPE_PARAM,
1533
1534
      /// An OMPCapturedExprDecl record.
1535
      DECL_OMP_CAPTUREDEXPR,
1536
1537
      /// A PragmaCommentDecl record.
1538
      DECL_PRAGMA_COMMENT,
1539
1540
      /// A PragmaDetectMismatchDecl record.
1541
      DECL_PRAGMA_DETECT_MISMATCH,
1542
1543
      /// An OMPDeclareMapperDecl record.
1544
      DECL_OMP_DECLARE_MAPPER,
1545
1546
      /// An OMPDeclareReductionDecl record.
1547
      DECL_OMP_DECLARE_REDUCTION,
1548
1549
      DECL_LAST = DECL_OMP_DECLARE_REDUCTION
1550
    };
1551
1552
    /// Record codes for each kind of statement or expression.
1553
    ///
1554
    /// These constants describe the records that describe statements
1555
    /// or expressions. These records  occur within type and declarations
1556
    /// block, so they begin with record values of 128.  Each constant
1557
    /// describes a record for a specific statement or expression class in the
1558
    /// AST.
1559
    enum StmtCode {
1560
      /// A marker record that indicates that we are at the end
1561
      /// of an expression.
1562
      STMT_STOP = DECL_LAST + 1,
1563
1564
      /// A NULL expression.
1565
      STMT_NULL_PTR,
1566
1567
      /// A reference to a previously [de]serialized Stmt record.
1568
      STMT_REF_PTR,
1569
1570
      /// A NullStmt record.
1571
      STMT_NULL,
1572
1573
      /// A CompoundStmt record.
1574
      STMT_COMPOUND,
1575
1576
      /// A CaseStmt record.
1577
      STMT_CASE,
1578
1579
      /// A DefaultStmt record.
1580
      STMT_DEFAULT,
1581
1582
      /// A LabelStmt record.
1583
      STMT_LABEL,
1584
1585
      /// An AttributedStmt record.
1586
      STMT_ATTRIBUTED,
1587
1588
      /// An IfStmt record.
1589
      STMT_IF,
1590
1591
      /// A SwitchStmt record.
1592
      STMT_SWITCH,
1593
1594
      /// A WhileStmt record.
1595
      STMT_WHILE,
1596
1597
      /// A DoStmt record.
1598
      STMT_DO,
1599
1600
      /// A ForStmt record.
1601
      STMT_FOR,
1602
1603
      /// A GotoStmt record.
1604
      STMT_GOTO,
1605
1606
      /// An IndirectGotoStmt record.
1607
      STMT_INDIRECT_GOTO,
1608
1609
      /// A ContinueStmt record.
1610
      STMT_CONTINUE,
1611
1612
      /// A BreakStmt record.
1613
      STMT_BREAK,
1614
1615
      /// A ReturnStmt record.
1616
      STMT_RETURN,
1617
1618
      /// A DeclStmt record.
1619
      STMT_DECL,
1620
1621
      /// A CapturedStmt record.
1622
      STMT_CAPTURED,
1623
1624
      /// A GCC-style AsmStmt record.
1625
      STMT_GCCASM,
1626
1627
      /// A MS-style AsmStmt record.
1628
      STMT_MSASM,
1629
1630
      /// A constant expression context.
1631
      EXPR_CONSTANT,
1632
1633
      /// A PredefinedExpr record.
1634
      EXPR_PREDEFINED,
1635
1636
      /// A DeclRefExpr record.
1637
      EXPR_DECL_REF,
1638
1639
      /// An IntegerLiteral record.
1640
      EXPR_INTEGER_LITERAL,
1641
1642
      /// A FloatingLiteral record.
1643
      EXPR_FLOATING_LITERAL,
1644
1645
      /// An ImaginaryLiteral record.
1646
      EXPR_IMAGINARY_LITERAL,
1647
1648
      /// A StringLiteral record.
1649
      EXPR_STRING_LITERAL,
1650
1651
      /// A CharacterLiteral record.
1652
      EXPR_CHARACTER_LITERAL,
1653
1654
      /// A ParenExpr record.
1655
      EXPR_PAREN,
1656
1657
      /// A ParenListExpr record.
1658
      EXPR_PAREN_LIST,
1659
1660
      /// A UnaryOperator record.
1661
      EXPR_UNARY_OPERATOR,
1662
1663
      /// An OffsetOfExpr record.
1664
      EXPR_OFFSETOF,
1665
1666
      /// A SizefAlignOfExpr record.
1667
      EXPR_SIZEOF_ALIGN_OF,
1668
1669
      /// An ArraySubscriptExpr record.
1670
      EXPR_ARRAY_SUBSCRIPT,
1671
1672
      /// A CallExpr record.
1673
      EXPR_CALL,
1674
1675
      /// A MemberExpr record.
1676
      EXPR_MEMBER,
1677
1678
      /// A BinaryOperator record.
1679
      EXPR_BINARY_OPERATOR,
1680
1681
      /// A CompoundAssignOperator record.
1682
      EXPR_COMPOUND_ASSIGN_OPERATOR,
1683
1684
      /// A ConditionOperator record.
1685
      EXPR_CONDITIONAL_OPERATOR,
1686
1687
      /// An ImplicitCastExpr record.
1688
      EXPR_IMPLICIT_CAST,
1689
1690
      /// A CStyleCastExpr record.
1691
      EXPR_CSTYLE_CAST,
1692
1693
      /// A CompoundLiteralExpr record.
1694
      EXPR_COMPOUND_LITERAL,
1695
1696
      /// An ExtVectorElementExpr record.
1697
      EXPR_EXT_VECTOR_ELEMENT,
1698
1699
      /// An InitListExpr record.
1700
      EXPR_INIT_LIST,
1701
1702
      /// A DesignatedInitExpr record.
1703
      EXPR_DESIGNATED_INIT,
1704
1705
      /// A DesignatedInitUpdateExpr record.
1706
      EXPR_DESIGNATED_INIT_UPDATE,
1707
1708
      /// An NoInitExpr record.
1709
      EXPR_NO_INIT,
1710
1711
      /// An ArrayInitLoopExpr record.
1712
      EXPR_ARRAY_INIT_LOOP,
1713
1714
      /// An ArrayInitIndexExpr record.
1715
      EXPR_ARRAY_INIT_INDEX,
1716
1717
      /// An ImplicitValueInitExpr record.
1718
      EXPR_IMPLICIT_VALUE_INIT,
1719
1720
      /// A VAArgExpr record.
1721
      EXPR_VA_ARG,
1722
1723
      /// An AddrLabelExpr record.
1724
      EXPR_ADDR_LABEL,
1725
1726
      /// A StmtExpr record.
1727
      EXPR_STMT,
1728
1729
      /// A ChooseExpr record.
1730
      EXPR_CHOOSE,
1731
1732
      /// A GNUNullExpr record.
1733
      EXPR_GNU_NULL,
1734
1735
      /// A ShuffleVectorExpr record.
1736
      EXPR_SHUFFLE_VECTOR,
1737
1738
      /// A ConvertVectorExpr record.
1739
      EXPR_CONVERT_VECTOR,
1740
1741
      /// BlockExpr
1742
      EXPR_BLOCK,
1743
1744
      /// A GenericSelectionExpr record.
1745
      EXPR_GENERIC_SELECTION,
1746
1747
      /// A PseudoObjectExpr record.
1748
      EXPR_PSEUDO_OBJECT,
1749
1750
      /// An AtomicExpr record.
1751
      EXPR_ATOMIC,
1752
1753
      // Objective-C
1754
1755
      /// An ObjCStringLiteral record.
1756
      EXPR_OBJC_STRING_LITERAL,
1757
1758
      EXPR_OBJC_BOXED_EXPRESSION,
1759
      EXPR_OBJC_ARRAY_LITERAL,
1760
      EXPR_OBJC_DICTIONARY_LITERAL,
1761
1762
      /// An ObjCEncodeExpr record.
1763
      EXPR_OBJC_ENCODE,
1764
1765
      /// An ObjCSelectorExpr record.
1766
      EXPR_OBJC_SELECTOR_EXPR,
1767
1768
      /// An ObjCProtocolExpr record.
1769
      EXPR_OBJC_PROTOCOL_EXPR,
1770
1771
      /// An ObjCIvarRefExpr record.
1772
      EXPR_OBJC_IVAR_REF_EXPR,
1773
1774
      /// An ObjCPropertyRefExpr record.
1775
      EXPR_OBJC_PROPERTY_REF_EXPR,
1776
1777
      /// An ObjCSubscriptRefExpr record.
1778
      EXPR_OBJC_SUBSCRIPT_REF_EXPR,
1779
1780
      /// UNUSED
1781
      EXPR_OBJC_KVC_REF_EXPR,
1782
1783
      /// An ObjCMessageExpr record.
1784
      EXPR_OBJC_MESSAGE_EXPR,
1785
1786
      /// An ObjCIsa Expr record.
1787
      EXPR_OBJC_ISA,
1788
1789
      /// An ObjCIndirectCopyRestoreExpr record.
1790
      EXPR_OBJC_INDIRECT_COPY_RESTORE,
1791
1792
      /// An ObjCForCollectionStmt record.
1793
      STMT_OBJC_FOR_COLLECTION,
1794
1795
      /// An ObjCAtCatchStmt record.
1796
      STMT_OBJC_CATCH,
1797
1798
      /// An ObjCAtFinallyStmt record.
1799
      STMT_OBJC_FINALLY,
1800
1801
      /// An ObjCAtTryStmt record.
1802
      STMT_OBJC_AT_TRY,
1803
1804
      /// An ObjCAtSynchronizedStmt record.
1805
      STMT_OBJC_AT_SYNCHRONIZED,
1806
1807
      /// An ObjCAtThrowStmt record.
1808
      STMT_OBJC_AT_THROW,
1809
1810
      /// An ObjCAutoreleasePoolStmt record.
1811
      STMT_OBJC_AUTORELEASE_POOL,
1812
1813
      /// An ObjCBoolLiteralExpr record.
1814
      EXPR_OBJC_BOOL_LITERAL,
1815
1816
      /// An ObjCAvailabilityCheckExpr record.
1817
      EXPR_OBJC_AVAILABILITY_CHECK,
1818
1819
      // C++
1820
1821
      /// A CXXCatchStmt record.
1822
      STMT_CXX_CATCH,
1823
1824
      /// A CXXTryStmt record.
1825
      STMT_CXX_TRY,
1826
      /// A CXXForRangeStmt record.
1827
1828
      STMT_CXX_FOR_RANGE,
1829
1830
      /// A CXXOperatorCallExpr record.
1831
      EXPR_CXX_OPERATOR_CALL,
1832
1833
      /// A CXXMemberCallExpr record.
1834
      EXPR_CXX_MEMBER_CALL,
1835
1836
      /// A CXXConstructExpr record.
1837
      EXPR_CXX_CONSTRUCT,
1838
1839
      /// A CXXInheritedCtorInitExpr record.
1840
      EXPR_CXX_INHERITED_CTOR_INIT,
1841
1842
      /// A CXXTemporaryObjectExpr record.
1843
      EXPR_CXX_TEMPORARY_OBJECT,
1844
1845
      /// A CXXStaticCastExpr record.
1846
      EXPR_CXX_STATIC_CAST,
1847
1848
      /// A CXXDynamicCastExpr record.
1849
      EXPR_CXX_DYNAMIC_CAST,
1850
1851
      /// A CXXReinterpretCastExpr record.
1852
      EXPR_CXX_REINTERPRET_CAST,
1853
1854
      /// A CXXConstCastExpr record.
1855
      EXPR_CXX_CONST_CAST,
1856
1857
      /// A CXXFunctionalCastExpr record.
1858
      EXPR_CXX_FUNCTIONAL_CAST,
1859
1860
      /// A UserDefinedLiteral record.
1861
      EXPR_USER_DEFINED_LITERAL,
1862
1863
      /// A CXXStdInitializerListExpr record.
1864
      EXPR_CXX_STD_INITIALIZER_LIST,
1865
1866
      /// A CXXBoolLiteralExpr record.
1867
      EXPR_CXX_BOOL_LITERAL,
1868
1869
      EXPR_CXX_NULL_PTR_LITERAL,  // CXXNullPtrLiteralExpr
1870
      EXPR_CXX_TYPEID_EXPR,       // CXXTypeidExpr (of expr).
1871
      EXPR_CXX_TYPEID_TYPE,       // CXXTypeidExpr (of type).
1872
      EXPR_CXX_THIS,              // CXXThisExpr
1873
      EXPR_CXX_THROW,             // CXXThrowExpr
1874
      EXPR_CXX_DEFAULT_ARG,       // CXXDefaultArgExpr
1875
      EXPR_CXX_DEFAULT_INIT,      // CXXDefaultInitExpr
1876
      EXPR_CXX_BIND_TEMPORARY,    // CXXBindTemporaryExpr
1877
1878
      EXPR_CXX_SCALAR_VALUE_INIT, // CXXScalarValueInitExpr
1879
      EXPR_CXX_NEW,               // CXXNewExpr
1880
      EXPR_CXX_DELETE,            // CXXDeleteExpr
1881
      EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr
1882
1883
      EXPR_EXPR_WITH_CLEANUPS,    // ExprWithCleanups
1884
1885
      EXPR_CXX_DEPENDENT_SCOPE_MEMBER,   // CXXDependentScopeMemberExpr
1886
      EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr
1887
      EXPR_CXX_UNRESOLVED_CONSTRUCT,     // CXXUnresolvedConstructExpr
1888
      EXPR_CXX_UNRESOLVED_MEMBER,        // UnresolvedMemberExpr
1889
      EXPR_CXX_UNRESOLVED_LOOKUP,        // UnresolvedLookupExpr
1890
1891
      EXPR_CXX_EXPRESSION_TRAIT,  // ExpressionTraitExpr
1892
      EXPR_CXX_NOEXCEPT,          // CXXNoexceptExpr
1893
1894
      EXPR_OPAQUE_VALUE,          // OpaqueValueExpr
1895
      EXPR_BINARY_CONDITIONAL_OPERATOR,  // BinaryConditionalOperator
1896
      EXPR_TYPE_TRAIT,            // TypeTraitExpr
1897
      EXPR_ARRAY_TYPE_TRAIT,      // ArrayTypeTraitIntExpr
1898
1899
      EXPR_PACK_EXPANSION,        // PackExpansionExpr
1900
      EXPR_SIZEOF_PACK,           // SizeOfPackExpr
1901
      EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr
1902
      EXPR_SUBST_NON_TYPE_TEMPLATE_PARM_PACK,// SubstNonTypeTemplateParmPackExpr
1903
      EXPR_FUNCTION_PARM_PACK,    // FunctionParmPackExpr
1904
      EXPR_MATERIALIZE_TEMPORARY, // MaterializeTemporaryExpr
1905
      EXPR_CXX_FOLD,              // CXXFoldExpr
1906
1907
      // CUDA
1908
      EXPR_CUDA_KERNEL_CALL,       // CUDAKernelCallExpr
1909
1910
      // OpenCL
1911
      EXPR_ASTYPE,                 // AsTypeExpr
1912
1913
      // Microsoft
1914
      EXPR_CXX_PROPERTY_REF_EXPR, // MSPropertyRefExpr
1915
      EXPR_CXX_PROPERTY_SUBSCRIPT_EXPR, // MSPropertySubscriptExpr
1916
      EXPR_CXX_UUIDOF_EXPR,       // CXXUuidofExpr (of expr).
1917
      EXPR_CXX_UUIDOF_TYPE,       // CXXUuidofExpr (of type).
1918
      STMT_SEH_LEAVE,             // SEHLeaveStmt
1919
      STMT_SEH_EXCEPT,            // SEHExceptStmt
1920
      STMT_SEH_FINALLY,           // SEHFinallyStmt
1921
      STMT_SEH_TRY,               // SEHTryStmt
1922
1923
      // OpenMP directives
1924
      STMT_OMP_PARALLEL_DIRECTIVE,
1925
      STMT_OMP_SIMD_DIRECTIVE,
1926
      STMT_OMP_FOR_DIRECTIVE,
1927
      STMT_OMP_FOR_SIMD_DIRECTIVE,
1928
      STMT_OMP_SECTIONS_DIRECTIVE,
1929
      STMT_OMP_SECTION_DIRECTIVE,
1930
      STMT_OMP_SINGLE_DIRECTIVE,
1931
      STMT_OMP_MASTER_DIRECTIVE,
1932
      STMT_OMP_CRITICAL_DIRECTIVE,
1933
      STMT_OMP_PARALLEL_FOR_DIRECTIVE,
1934
      STMT_OMP_PARALLEL_FOR_SIMD_DIRECTIVE,
1935
      STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE,
1936
      STMT_OMP_TASK_DIRECTIVE,
1937
      STMT_OMP_TASKYIELD_DIRECTIVE,
1938
      STMT_OMP_BARRIER_DIRECTIVE,
1939
      STMT_OMP_TASKWAIT_DIRECTIVE,
1940
      STMT_OMP_FLUSH_DIRECTIVE,
1941
      STMT_OMP_ORDERED_DIRECTIVE,
1942
      STMT_OMP_ATOMIC_DIRECTIVE,
1943
      STMT_OMP_TARGET_DIRECTIVE,
1944
      STMT_OMP_TARGET_DATA_DIRECTIVE,
1945
      STMT_OMP_TARGET_ENTER_DATA_DIRECTIVE,
1946
      STMT_OMP_TARGET_EXIT_DATA_DIRECTIVE,
1947
      STMT_OMP_TARGET_PARALLEL_DIRECTIVE,
1948
      STMT_OMP_TARGET_PARALLEL_FOR_DIRECTIVE,
1949
      STMT_OMP_TEAMS_DIRECTIVE,
1950
      STMT_OMP_TASKGROUP_DIRECTIVE,
1951
      STMT_OMP_CANCELLATION_POINT_DIRECTIVE,
1952
      STMT_OMP_CANCEL_DIRECTIVE,
1953
      STMT_OMP_TASKLOOP_DIRECTIVE,
1954
      STMT_OMP_TASKLOOP_SIMD_DIRECTIVE,
1955
      STMT_OMP_DISTRIBUTE_DIRECTIVE,
1956
      STMT_OMP_TARGET_UPDATE_DIRECTIVE,
1957
      STMT_OMP_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE,
1958
      STMT_OMP_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE,
1959
      STMT_OMP_DISTRIBUTE_SIMD_DIRECTIVE,
1960
      STMT_OMP_TARGET_PARALLEL_FOR_SIMD_DIRECTIVE,
1961
      STMT_OMP_TARGET_SIMD_DIRECTIVE,
1962
      STMT_OMP_TEAMS_DISTRIBUTE_DIRECTIVE,
1963
      STMT_OMP_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE,
1964
      STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE,
1965
      STMT_OMP_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE,
1966
      STMT_OMP_TARGET_TEAMS_DIRECTIVE,
1967
      STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE,
1968
      STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE,
1969
      STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE,
1970
      STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE,
1971
      EXPR_OMP_ARRAY_SECTION,
1972
1973
      // ARC
1974
      EXPR_OBJC_BRIDGED_CAST,     // ObjCBridgedCastExpr
1975
1976
      STMT_MS_DEPENDENT_EXISTS,   // MSDependentExistsStmt
1977
      EXPR_LAMBDA,                // LambdaExpr
1978
      STMT_COROUTINE_BODY,
1979
      STMT_CORETURN,
1980
      EXPR_COAWAIT,
1981
      EXPR_COYIELD,
1982
      EXPR_DEPENDENT_COAWAIT,
1983
    };
1984
1985
    /// The kinds of designators that can occur in a
1986
    /// DesignatedInitExpr.
1987
    enum DesignatorTypes {
1988
      /// Field designator where only the field name is known.
1989
      DESIG_FIELD_NAME  = 0,
1990
1991
      /// Field designator where the field has been resolved to
1992
      /// a declaration.
1993
      DESIG_FIELD_DECL  = 1,
1994
1995
      /// Array designator.
1996
      DESIG_ARRAY       = 2,
1997
1998
      /// GNU array range designator.
1999
      DESIG_ARRAY_RANGE = 3
2000
    };
2001
2002
    /// The different kinds of data that can occur in a
2003
    /// CtorInitializer.
2004
    enum CtorInitializerType {
2005
      CTOR_INITIALIZER_BASE,
2006
      CTOR_INITIALIZER_DELEGATING,
2007
      CTOR_INITIALIZER_MEMBER,
2008
      CTOR_INITIALIZER_INDIRECT_MEMBER
2009
    };
2010
2011
    /// Describes the redeclarations of a declaration.
2012
    struct LocalRedeclarationsInfo {
2013
      // The ID of the first declaration
2014
      DeclID FirstID;
2015
2016
      // Offset into the array of redeclaration chains.
2017
      unsigned Offset;
2018
2019
      friend bool operator<(const LocalRedeclarationsInfo &X,
2020
0
                            const LocalRedeclarationsInfo &Y) {
2021
0
        return X.FirstID < Y.FirstID;
2022
0
      }
2023
2024
      friend bool operator>(const LocalRedeclarationsInfo &X,
2025
0
                            const LocalRedeclarationsInfo &Y) {
2026
0
        return X.FirstID > Y.FirstID;
2027
0
      }
2028
2029
      friend bool operator<=(const LocalRedeclarationsInfo &X,
2030
                             const LocalRedeclarationsInfo &Y) {
2031
        return X.FirstID <= Y.FirstID;
2032
      }
2033
2034
      friend bool operator>=(const LocalRedeclarationsInfo &X,
2035
0
                             const LocalRedeclarationsInfo &Y) {
2036
0
        return X.FirstID >= Y.FirstID;
2037
0
      }
2038
    };
2039
2040
    /// Describes the categories of an Objective-C class.
2041
    struct ObjCCategoriesInfo {
2042
      // The ID of the definition
2043
      DeclID DefinitionID;
2044
2045
      // Offset into the array of category lists.
2046
      unsigned Offset;
2047
2048
      friend bool operator<(const ObjCCategoriesInfo &X,
2049
94
                            const ObjCCategoriesInfo &Y) {
2050
94
        return X.DefinitionID < Y.DefinitionID;
2051
94
      }
2052
2053
      friend bool operator>(const ObjCCategoriesInfo &X,
2054
0
                            const ObjCCategoriesInfo &Y) {
2055
0
        return X.DefinitionID > Y.DefinitionID;
2056
0
      }
2057
2058
      friend bool operator<=(const ObjCCategoriesInfo &X,
2059
                             const ObjCCategoriesInfo &Y) {
2060
        return X.DefinitionID <= Y.DefinitionID;
2061
      }
2062
2063
      friend bool operator>=(const ObjCCategoriesInfo &X,
2064
0
                             const ObjCCategoriesInfo &Y) {
2065
0
        return X.DefinitionID >= Y.DefinitionID;
2066
0
      }
2067
    };
2068
2069
    /// A key used when looking up entities by \ref DeclarationName.
2070
    ///
2071
    /// Different \ref DeclarationNames are mapped to different keys, but the
2072
    /// same key can occasionally represent multiple names (for names that
2073
    /// contain types, in particular).
2074
    class DeclarationNameKey {
2075
      using NameKind = unsigned;
2076
2077
      NameKind Kind = 0;
2078
      uint64_t Data = 0;
2079
2080
    public:
2081
50.7k
      DeclarationNameKey() = default;
2082
      DeclarationNameKey(DeclarationName Name);
2083
      DeclarationNameKey(NameKind Kind, uint64_t Data)
2084
32.8k
          : Kind(Kind), Data(Data) {}
2085
2086
143k
      NameKind getKind() const { return Kind; }
2087
2088
39.9k
      IdentifierInfo *getIdentifier() const {
2089
39.9k
        assert(Kind == DeclarationName::Identifier ||
2090
39.9k
               Kind == DeclarationName::CXXLiteralOperatorName ||
2091
39.9k
               Kind == DeclarationName::CXXDeductionGuideName);
2092
39.9k
        return (IdentifierInfo *)Data;
2093
39.9k
      }
2094
2095
510
      Selector getSelector() const {
2096
510
        assert(Kind == DeclarationName::ObjCZeroArgSelector ||
2097
510
               Kind == DeclarationName::ObjCOneArgSelector ||
2098
510
               Kind == DeclarationName::ObjCMultiArgSelector);
2099
510
        return Selector(Data);
2100
510
      }
2101
2102
1.42k
      OverloadedOperatorKind getOperatorKind() const {
2103
1.42k
        assert(Kind == DeclarationName::CXXOperatorName);
2104
1.42k
        return (OverloadedOperatorKind)Data;
2105
1.42k
      }
2106
2107
      /// Compute a fingerprint of this key for use in on-disk hash table.
2108
      unsigned getHash() const;
2109
2110
      friend bool operator==(const DeclarationNameKey &A,
2111
38.3k
                             const DeclarationNameKey &B) {
2112
38.3k
        return A.Kind == B.Kind && 
A.Data == B.Data31.3k
;
2113
38.3k
      }
2114
    };
2115
2116
    /// @}
2117
2118
} // namespace serialization
2119
} // namespace clang
2120
2121
namespace llvm {
2122
2123
  template <> struct DenseMapInfo<clang::serialization::DeclarationNameKey> {
2124
4.52k
    static clang::serialization::DeclarationNameKey getEmptyKey() {
2125
4.52k
      return clang::serialization::DeclarationNameKey(-1, 1);
2126
4.52k
    }
2127
2128
3.71k
    static clang::serialization::DeclarationNameKey getTombstoneKey() {
2129
3.71k
      return clang::serialization::DeclarationNameKey(-1, 2);
2130
3.71k
    }
2131
2132
    static unsigned
2133
3.52k
    getHashValue(const clang::serialization::DeclarationNameKey &Key) {
2134
3.52k
      return Key.getHash();
2135
3.52k
    }
2136
2137
    static bool isEqual(const clang::serialization::DeclarationNameKey &L,
2138
16.1k
                        const clang::serialization::DeclarationNameKey &R) {
2139
16.1k
      return L == R;
2140
16.1k
    }
2141
  };
2142
2143
} // namespace llvm
2144
2145
#endif // LLVM_CLANG_SERIALIZATION_ASTBITCODES_H