Skip to content

[Clang][NFC] Don't manually enumerate the PredefinedDeclIDs #106891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 21 additions & 26 deletions clang/include/clang/AST/DeclID.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/iterator.h"

#include <climits>

namespace clang {

/// Predefined declaration IDs.
Expand All @@ -32,65 +30,62 @@ namespace clang {
/// it is created.
enum PredefinedDeclIDs {
/// The NULL declaration.
PREDEF_DECL_NULL_ID = 0,
PREDEF_DECL_NULL_ID,

/// The translation unit.
PREDEF_DECL_TRANSLATION_UNIT_ID = 1,
PREDEF_DECL_TRANSLATION_UNIT_ID,

/// The Objective-C 'id' type.
PREDEF_DECL_OBJC_ID_ID = 2,
PREDEF_DECL_OBJC_ID_ID,

/// The Objective-C 'SEL' type.
PREDEF_DECL_OBJC_SEL_ID = 3,
PREDEF_DECL_OBJC_SEL_ID,

/// The Objective-C 'Class' type.
PREDEF_DECL_OBJC_CLASS_ID = 4,
PREDEF_DECL_OBJC_CLASS_ID,

/// The Objective-C 'Protocol' type.
PREDEF_DECL_OBJC_PROTOCOL_ID = 5,
PREDEF_DECL_OBJC_PROTOCOL_ID,

/// The signed 128-bit integer type.
PREDEF_DECL_INT_128_ID = 6,
PREDEF_DECL_INT_128_ID,

/// The unsigned 128-bit integer type.
PREDEF_DECL_UNSIGNED_INT_128_ID = 7,
PREDEF_DECL_UNSIGNED_INT_128_ID,

/// The internal 'instancetype' typedef.
PREDEF_DECL_OBJC_INSTANCETYPE_ID = 8,
PREDEF_DECL_OBJC_INSTANCETYPE_ID,

/// The internal '__builtin_va_list' typedef.
PREDEF_DECL_BUILTIN_VA_LIST_ID = 9,
PREDEF_DECL_BUILTIN_VA_LIST_ID,

/// The internal '__va_list_tag' struct, if any.
PREDEF_DECL_VA_LIST_TAG = 10,
PREDEF_DECL_VA_LIST_TAG,

/// The internal '__builtin_ms_va_list' typedef.
PREDEF_DECL_BUILTIN_MS_VA_LIST_ID = 11,
PREDEF_DECL_BUILTIN_MS_VA_LIST_ID,

/// The predeclared '_GUID' struct.
PREDEF_DECL_BUILTIN_MS_GUID_ID = 12,
PREDEF_DECL_BUILTIN_MS_GUID_ID,

/// The extern "C" context.
PREDEF_DECL_EXTERN_C_CONTEXT_ID = 13,
PREDEF_DECL_EXTERN_C_CONTEXT_ID,

/// The internal '__make_integer_seq' template.
PREDEF_DECL_MAKE_INTEGER_SEQ_ID = 14,
PREDEF_DECL_MAKE_INTEGER_SEQ_ID,

/// The internal '__NSConstantString' typedef.
PREDEF_DECL_CF_CONSTANT_STRING_ID = 15,
PREDEF_DECL_CF_CONSTANT_STRING_ID,

/// The internal '__NSConstantString' tag type.
PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID = 16,
PREDEF_DECL_CF_CONSTANT_STRING_TAG_ID,

/// The internal '__type_pack_element' template.
PREDEF_DECL_TYPE_PACK_ELEMENT_ID = 17,
};
PREDEF_DECL_TYPE_PACK_ELEMENT_ID,

/// The number of declaration IDs that are predefined.
///
/// For more information about predefined declarations, see the
/// \c PredefinedDeclIDs type and the PREDEF_DECL_*_ID constants.
const unsigned int NUM_PREDEF_DECL_IDS = 18;
/// The number of declaration IDs that are predefined.
NUM_PREDEF_DECL_IDS
};

/// GlobalDeclID means DeclID in the current ASTContext and LocalDeclID means
/// DeclID specific to a certain ModuleFile. Specially, in ASTWriter, the
Expand Down
Loading