@@ -84,28 +84,28 @@ using IdentifierLocPair = std::pair<IdentifierInfo *, SourceLocation>;
84
84
// / of a pointer to one of these classes.
85
85
enum { IdentifierInfoAlignment = 8 };
86
86
87
- static constexpr int ObjCOrBuiltinIDBits = 16 ;
87
+ static constexpr int InterestingIdentifierBits = 16 ;
88
88
89
- // / The "layout" of ObjCOrBuiltinID is:
89
+ // / The "layout" of InterestingIdentifier is:
90
90
// / - ObjCKeywordKind enumerators
91
- // / - InterestingIdentifierKind enumerators
91
+ // / - NotableIdentifierKind enumerators
92
92
// / - Builtin::ID enumerators
93
- // / - NonSpecialIdentifier
94
- enum class ObjCKeywordOrInterestingOrBuiltin {
93
+ // / - NotInterestingIdentifier
94
+ enum class InterestingIdentifier {
95
95
#define OBJC_AT_KEYWORD (X ) objc_##X,
96
96
#include " clang/Basic/TokenKinds.def"
97
97
NUM_OBJC_KEYWORDS,
98
98
99
- #define INTERESTING_IDENTIFIER (X ) X,
99
+ #define NOTABLE_IDENTIFIER (X ) X,
100
100
#include " clang/Basic/TokenKinds.def"
101
- NUM_OBJC_KEYWORDS_AND_INTERESTING_IDENTIFIERS ,
101
+ NUM_OBJC_KEYWORDS_AND_NOTABLE_IDENTIFIERS ,
102
102
103
103
NotBuiltin,
104
104
#define BUILTIN (ID, TYPE, ATTRS ) BI##ID,
105
105
#include " clang/Basic/Builtins.inc"
106
106
FirstTSBuiltin,
107
107
108
- NonSpecialIdentifier = 65534
108
+ NotInterestingIdentifier = 65534
109
109
};
110
110
111
111
// / One of these records is kept for each identifier that
@@ -121,8 +121,8 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
121
121
LLVM_PREFERRED_TYPE (tok::TokenKind)
122
122
unsigned TokenID : 9 ;
123
123
124
- LLVM_PREFERRED_TYPE (ObjCKeywordOrInterestingOrBuiltin )
125
- unsigned ObjCOrBuiltinID : ObjCOrBuiltinIDBits ;
124
+ LLVM_PREFERRED_TYPE (InterestingIdentifier )
125
+ unsigned InterestingIdentifierID : InterestingIdentifierBits ;
126
126
127
127
// True if there is a #define for this.
128
128
LLVM_PREFERRED_TYPE (bool )
@@ -205,8 +205,8 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
205
205
206
206
IdentifierInfo ()
207
207
: TokenID (tok::identifier),
208
- ObjCOrBuiltinID (llvm::to_underlying (
209
- ObjCKeywordOrInterestingOrBuiltin::NonSpecialIdentifier )),
208
+ InterestingIdentifierID (llvm::to_underlying (
209
+ InterestingIdentifier::NotInterestingIdentifier )),
210
210
HasMacro (false ), HadMacro (false ), IsExtension (false ),
211
211
IsFutureCompatKeyword (false ), IsPoisoned (false ),
212
212
IsCPPOperatorKeyword (false ), NeedsHandleIdentifier (false ),
@@ -341,71 +341,63 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
341
341
// /
342
342
// / For example, 'class' will return tok::objc_class if ObjC is enabled.
343
343
tok::ObjCKeywordKind getObjCKeywordID () const {
344
- assert (0 == llvm::to_underlying (
345
- ObjCKeywordOrInterestingOrBuiltin::objc_not_keyword));
346
- auto Value =
347
- static_cast <ObjCKeywordOrInterestingOrBuiltin>(ObjCOrBuiltinID);
348
- if (Value < ObjCKeywordOrInterestingOrBuiltin::NUM_OBJC_KEYWORDS)
349
- return static_cast <tok::ObjCKeywordKind>(ObjCOrBuiltinID);
344
+ assert (0 == llvm::to_underlying (InterestingIdentifier::objc_not_keyword));
345
+ auto Value = static_cast <InterestingIdentifier>(InterestingIdentifierID);
346
+ if (Value < InterestingIdentifier::NUM_OBJC_KEYWORDS)
347
+ return static_cast <tok::ObjCKeywordKind>(InterestingIdentifierID);
350
348
return tok::objc_not_keyword;
351
349
}
352
350
void setObjCKeywordID (tok::ObjCKeywordKind ID) {
353
- assert (0 == llvm::to_underlying (
354
- ObjCKeywordOrInterestingOrBuiltin::objc_not_keyword));
355
- ObjCOrBuiltinID = ID;
351
+ assert (0 == llvm::to_underlying (InterestingIdentifier::objc_not_keyword));
352
+ InterestingIdentifierID = ID;
356
353
assert (getObjCKeywordID () == ID && " ID too large for field!" );
357
354
}
358
355
359
356
// / Return a value indicating whether this is a builtin function.
360
357
unsigned getBuiltinID () const {
361
- auto Value =
362
- static_cast <ObjCKeywordOrInterestingOrBuiltin>(ObjCOrBuiltinID);
363
- if (Value > ObjCKeywordOrInterestingOrBuiltin::
364
- NUM_OBJC_KEYWORDS_AND_INTERESTING_IDENTIFIERS &&
365
- Value != ObjCKeywordOrInterestingOrBuiltin::NonSpecialIdentifier) {
358
+ auto Value = static_cast <InterestingIdentifier>(InterestingIdentifierID);
359
+ if (Value >
360
+ InterestingIdentifier::NUM_OBJC_KEYWORDS_AND_NOTABLE_IDENTIFIERS &&
361
+ Value != InterestingIdentifier::NotInterestingIdentifier) {
366
362
auto FirstBuiltin =
367
- llvm::to_underlying (ObjCKeywordOrInterestingOrBuiltin ::NotBuiltin);
368
- return static_cast <Builtin::ID>(ObjCOrBuiltinID - FirstBuiltin);
363
+ llvm::to_underlying (InterestingIdentifier ::NotBuiltin);
364
+ return static_cast <Builtin::ID>(InterestingIdentifierID - FirstBuiltin);
369
365
}
370
366
return Builtin::ID::NotBuiltin;
371
367
}
372
368
void setBuiltinID (unsigned ID) {
373
369
assert (ID != Builtin::ID::NotBuiltin);
374
- auto FirstBuiltin =
375
- llvm::to_underlying (ObjCKeywordOrInterestingOrBuiltin::NotBuiltin);
376
- ObjCOrBuiltinID = ID + FirstBuiltin;
370
+ auto FirstBuiltin = llvm::to_underlying (InterestingIdentifier::NotBuiltin);
371
+ InterestingIdentifierID = ID + FirstBuiltin;
377
372
assert (getBuiltinID () == ID && " ID too large for field!" );
378
373
}
379
374
void clearBuiltinID () {
380
- ObjCOrBuiltinID = llvm::to_underlying (
381
- ObjCKeywordOrInterestingOrBuiltin::NonSpecialIdentifier);
382
- }
383
-
384
- tok::InterestingIdentifierKind getInterestingIdentifierID () const {
385
- auto Value =
386
- static_cast <ObjCKeywordOrInterestingOrBuiltin>(ObjCOrBuiltinID);
387
- if (Value > ObjCKeywordOrInterestingOrBuiltin::NUM_OBJC_KEYWORDS &&
388
- Value < ObjCKeywordOrInterestingOrBuiltin::
389
- NUM_OBJC_KEYWORDS_AND_INTERESTING_IDENTIFIERS) {
390
- auto FirstInterestingIdentifier =
391
- 1 + llvm::to_underlying (
392
- ObjCKeywordOrInterestingOrBuiltin::NUM_OBJC_KEYWORDS);
393
- return static_cast <tok::InterestingIdentifierKind>(
394
- ObjCOrBuiltinID - FirstInterestingIdentifier);
375
+ InterestingIdentifierID =
376
+ llvm::to_underlying (InterestingIdentifier::NotInterestingIdentifier);
377
+ }
378
+
379
+ tok::NotableIdentifierKind getNotableIdentifierID () const {
380
+ auto Value = static_cast <InterestingIdentifier>(InterestingIdentifierID);
381
+ if (Value > InterestingIdentifier::NUM_OBJC_KEYWORDS &&
382
+ Value <
383
+ InterestingIdentifier::NUM_OBJC_KEYWORDS_AND_NOTABLE_IDENTIFIERS) {
384
+ auto FirstNotableIdentifier =
385
+ 1 + llvm::to_underlying (InterestingIdentifier::NUM_OBJC_KEYWORDS);
386
+ return static_cast <tok::NotableIdentifierKind>(InterestingIdentifierID -
387
+ FirstNotableIdentifier);
395
388
}
396
- return tok::not_interesting ;
389
+ return tok::not_notable ;
397
390
}
398
- void setInterestingIdentifierID (unsigned ID) {
399
- assert (ID != tok::not_interesting);
400
- auto FirstInterestingIdentifier =
401
- 1 + llvm::to_underlying (
402
- ObjCKeywordOrInterestingOrBuiltin::NUM_OBJC_KEYWORDS);
403
- ObjCOrBuiltinID = ID + FirstInterestingIdentifier;
404
- assert (getInterestingIdentifierID () == ID && " ID too large for field!" );
391
+ void setNotableIdentifierID (unsigned ID) {
392
+ assert (ID != tok::not_notable);
393
+ auto FirstNotableIdentifier =
394
+ 1 + llvm::to_underlying (InterestingIdentifier::NUM_OBJC_KEYWORDS);
395
+ InterestingIdentifierID = ID + FirstNotableIdentifier;
396
+ assert (getNotableIdentifierID () == ID && " ID too large for field!" );
405
397
}
406
398
407
- unsigned getObjCOrBuiltinID () const { return ObjCOrBuiltinID ; }
408
- void setObjCOrBuiltinID (unsigned ID) { ObjCOrBuiltinID = ID; }
399
+ unsigned getObjCOrBuiltinID () const { return InterestingIdentifierID ; }
400
+ void setObjCOrBuiltinID (unsigned ID) { InterestingIdentifierID = ID; }
409
401
410
402
// / get/setExtension - Initialize information about whether or not this
411
403
// / language token is an extension. This controls extension warnings, and is
0 commit comments