Coverage Report

Created: 2020-09-15 12:33

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