Skip to content

Commit 4fef204

Browse files
authored
[Clang][NFC] Don't manually enumerate the PredefinedDeclIDs (#106891)
This doesn't seem to have any use other than the possibility of merge conflicts and accidentally forgetting to update `NUM_PREDEF_DECL_IDS`.
1 parent bec1d86 commit 4fef204

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

clang/include/clang/AST/DeclID.h

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include "llvm/ADT/Hashing.h"
2121
#include "llvm/ADT/iterator.h"
2222

23-
#include <climits>
24-
2523
namespace clang {
2624

2725
/// Predefined declaration IDs.
@@ -32,65 +30,62 @@ namespace clang {
3230
/// it is created.
3331
enum PredefinedDeclIDs {
3432
/// The NULL declaration.
35-
PREDEF_DECL_NULL_ID = 0,
33+
PREDEF_DECL_NULL_ID,
3634

3735
/// The translation unit.
38-
PREDEF_DECL_TRANSLATION_UNIT_ID = 1,
36+
PREDEF_DECL_TRANSLATION_UNIT_ID,
3937

4038
/// The Objective-C 'id' type.
41-
PREDEF_DECL_OBJC_ID_ID = 2,
39+
PREDEF_DECL_OBJC_ID_ID,
4240

4341
/// The Objective-C 'SEL' type.
44-
PREDEF_DECL_OBJC_SEL_ID = 3,
42+
PREDEF_DECL_OBJC_SEL_ID,
4543

4644
/// The Objective-C 'Class' type.
47-
PREDEF_DECL_OBJC_CLASS_ID = 4,
45+
PREDEF_DECL_OBJC_CLASS_ID,
4846

4947
/// The Objective-C 'Protocol' type.
50-
PREDEF_DECL_OBJC_PROTOCOL_ID = 5,
48+
PREDEF_DECL_OBJC_PROTOCOL_ID,
5149

5250
/// The signed 128-bit integer type.
53-
PREDEF_DECL_INT_128_ID = 6,
51+
PREDEF_DECL_INT_128_ID,
5452

5553
/// The unsigned 128-bit integer type.
56-
PREDEF_DECL_UNSIGNED_INT_128_ID = 7,
54+
PREDEF_DECL_UNSIGNED_INT_128_ID,
5755

5856
/// The internal 'instancetype' typedef.
59-
PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8,
57+
PREDEF_DECL_OBJC_INSTANCETYPE_ID,
6058

6159
/// The internal '__builtin_va_list' typedef.
62-
PREDEF_DECL_BUILTIN_VA_LIST_ID = 9,
60+
PREDEF_DECL_BUILTIN_VA_LIST_ID,
6361

6462
/// The internal '__va_list_tag' struct, if any.
65-
PREDEF_DECL_VA_LIST_TAG = 10,
63+
PREDEF_DECL_VA_LIST_TAG,
6664

6765
/// The internal '__builtin_ms_va_list' typedef.
68-
PREDEF_DECL_BUILTIN_MS_VA_LIST_ID = 11,
66+
PREDEF_DECL_BUILTIN_MS_VA_LIST_ID,
6967

7068
/// The predeclared '_GUID' struct.
71-
PREDEF_DECL_BUILTIN_MS_GUID_ID = 12,
69+
PREDEF_DECL_BUILTIN_MS_GUID_ID,
7270

7371
/// The extern "C" context.
74-
PREDEF_DECL_EXTERN_C_CONTEXT_ID = 13,
72+
PREDEF_DECL_EXTERN_C_CONTEXT_ID,
7573

7674
/// The internal '__make_integer_seq' template.
77-
PREDEF_DECL_MAKE_INTEGER_SEQ_ID = 14,
75+
PREDEF_DECL_MAKE_INTEGER_SEQ_ID,
7876

7977
/// The internal '__NSConstantString' typedef.
80-
PREDEF_DECL_CF_CONSTANT_STRING_ID = 15,
78+
PREDEF_DECL_CF_CONSTANT_STRING_ID,
8179

8280
/// The internal '__NSConstantString' tag type.
83-
PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID = 16,
81+
PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID,
8482

8583
/// The internal '__type_pack_element' template.
86-
PREDEF_DECL_TYPE_PACK_ELEMENT_ID = 17,
87-
};
84+
PREDEF_DECL_TYPE_PACK_ELEMENT_ID,
8885

89-
/// The number of declaration IDs that are predefined.
90-
///
91-
/// For more information about predefined declarations, see the
92-
/// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.
93-
const unsigned int NUM_PREDEF_DECL_IDS = 18;
86+
/// The number of declaration IDs that are predefined.
87+
NUM_PREDEF_DECL_IDS
88+
};
9489

9590
/// GlobalDeclID means DeclID in the current ASTContext and LocalDeclID means
9691
/// DeclID specific to a certain ModuleFile. Specially, in ASTWriter, the

0 commit comments

Comments
 (0)