@@ -869,8 +869,8 @@ void Parser::HandlePragmaFloatControl() {
869
869
// and the FloatControl is the lower 16 bits. Use shift and bit-and
870
870
// to decode the parts.
871
871
uintptr_t Value = reinterpret_cast <uintptr_t >(Tok.getAnnotationValue ());
872
- Sema:: PragmaMsStackAction Action =
873
- static_cast <Sema:: PragmaMsStackAction>((Value >> 16 ) & 0xFFFF );
872
+ PragmaMsStackAction Action =
873
+ static_cast <PragmaMsStackAction>((Value >> 16 ) & 0xFFFF );
874
874
PragmaFloatControlKind Kind = PragmaFloatControlKind (Value & 0xFFFF );
875
875
SourceLocation PragmaLoc = ConsumeAnnotationToken ();
876
876
Actions.ActOnPragmaFloatControl (PragmaLoc, Action, Kind);
@@ -1019,8 +1019,8 @@ void Parser::HandlePragmaMSPointersToMembers() {
1019
1019
void Parser::HandlePragmaMSVtorDisp () {
1020
1020
assert (Tok.is (tok::annot_pragma_ms_vtordisp));
1021
1021
uintptr_t Value = reinterpret_cast <uintptr_t >(Tok.getAnnotationValue ());
1022
- Sema:: PragmaMsStackAction Action =
1023
- static_cast <Sema:: PragmaMsStackAction>((Value >> 16 ) & 0xFFFF );
1022
+ PragmaMsStackAction Action =
1023
+ static_cast <PragmaMsStackAction>((Value >> 16 ) & 0xFFFF );
1024
1024
MSVtorDispMode Mode = MSVtorDispMode (Value & 0xFFFF );
1025
1025
SourceLocation PragmaLoc = ConsumeAnnotationToken ();
1026
1026
Actions.ActOnPragmaMSVtorDisp (Action, PragmaLoc, Mode);
@@ -1151,21 +1151,21 @@ bool Parser::HandlePragmaMSSegment(StringRef PragmaName,
1151
1151
return false ;
1152
1152
}
1153
1153
PP.Lex (Tok); // (
1154
- Sema:: PragmaMsStackAction Action = Sema::PSK_Reset ;
1154
+ PragmaMsStackAction Action = PragmaMsStackAction::Reset ;
1155
1155
StringRef SlotLabel;
1156
1156
if (Tok.isAnyIdentifier ()) {
1157
1157
StringRef PushPop = Tok.getIdentifierInfo ()->getName ();
1158
1158
if (PushPop == " push" )
1159
- Action = Sema::PSK_Push ;
1159
+ Action = PragmaMsStackAction::Push ;
1160
1160
else if (PushPop == " pop" )
1161
- Action = Sema::PSK_Pop ;
1161
+ Action = PragmaMsStackAction::Pop ;
1162
1162
else {
1163
1163
PP.Diag (PragmaLocation,
1164
1164
diag::warn_pragma_expected_section_push_pop_or_name)
1165
1165
<< PragmaName;
1166
1166
return false ;
1167
1167
}
1168
- if (Action != Sema::PSK_Reset ) {
1168
+ if (Action != PragmaMsStackAction::Reset ) {
1169
1169
PP.Lex (Tok); // push | pop
1170
1170
if (Tok.is (tok::comma)) {
1171
1171
PP.Lex (Tok); // ,
@@ -1191,10 +1191,12 @@ bool Parser::HandlePragmaMSSegment(StringRef PragmaName,
1191
1191
StringLiteral *SegmentName = nullptr ;
1192
1192
if (Tok.isNot (tok::r_paren)) {
1193
1193
if (Tok.isNot (tok::string_literal)) {
1194
- unsigned DiagID = Action != Sema::PSK_Reset ? !SlotLabel.empty () ?
1195
- diag::warn_pragma_expected_section_name :
1196
- diag::warn_pragma_expected_section_label_or_name :
1197
- diag::warn_pragma_expected_section_push_pop_or_name;
1194
+ unsigned DiagID =
1195
+ Action != PragmaMsStackAction::Reset
1196
+ ? !SlotLabel.empty ()
1197
+ ? diag::warn_pragma_expected_section_name
1198
+ : diag::warn_pragma_expected_section_label_or_name
1199
+ : diag::warn_pragma_expected_section_push_pop_or_name;
1198
1200
PP.Diag (PragmaLocation, DiagID) << PragmaName;
1199
1201
return false ;
1200
1202
}
@@ -1209,7 +1211,7 @@ bool Parser::HandlePragmaMSSegment(StringRef PragmaName,
1209
1211
}
1210
1212
// Setting section "" has no effect
1211
1213
if (SegmentName->getLength ())
1212
- Action = (Sema:: PragmaMsStackAction)(Action | Sema::PSK_Set );
1214
+ Action = (PragmaMsStackAction)(Action | PragmaMsStackAction::Set );
1213
1215
}
1214
1216
if (Tok.isNot (tok::r_paren)) {
1215
1217
PP.Diag (PragmaLocation, diag::warn_pragma_expected_rparen) << PragmaName;
@@ -1298,23 +1300,23 @@ bool Parser::HandlePragmaMSStrictGuardStackCheck(
1298
1300
PragmaName))
1299
1301
return false ;
1300
1302
1301
- Sema:: PragmaMsStackAction Action = Sema::PSK_Set ;
1303
+ PragmaMsStackAction Action = PragmaMsStackAction::Set ;
1302
1304
if (Tok.is (tok::identifier)) {
1303
1305
StringRef PushPop = Tok.getIdentifierInfo ()->getName ();
1304
1306
if (PushPop == " push" ) {
1305
1307
PP.Lex (Tok);
1306
- Action = Sema::PSK_Push ;
1308
+ Action = PragmaMsStackAction::Push ;
1307
1309
if (ExpectAndConsume (tok::comma, diag::warn_pragma_expected_punc,
1308
1310
PragmaName))
1309
1311
return false ;
1310
1312
} else if (PushPop == " pop" ) {
1311
1313
PP.Lex (Tok);
1312
- Action = Sema::PSK_Pop ;
1314
+ Action = PragmaMsStackAction::Pop ;
1313
1315
}
1314
1316
}
1315
1317
1316
1318
bool Value = false ;
1317
- if (Action & Sema::PSK_Push || Action & Sema::PSK_Set ) {
1319
+ if (Action & PragmaMsStackAction::Push || Action & PragmaMsStackAction::Set ) {
1318
1320
const IdentifierInfo *II = Tok.getIdentifierInfo ();
1319
1321
if (II && II->isStr (" off" )) {
1320
1322
PP.Lex (Tok);
@@ -2138,7 +2140,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2138
2140
return ;
2139
2141
}
2140
2142
2141
- Sema:: PragmaMsStackAction Action = Sema::PSK_Reset ;
2143
+ PragmaMsStackAction Action = PragmaMsStackAction::Reset ;
2142
2144
StringRef SlotLabel;
2143
2145
Token Alignment;
2144
2146
Alignment.startToken ();
@@ -2152,12 +2154,12 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2152
2154
// the push/pop stack.
2153
2155
// In Apple gcc/XL, #pragma pack(4) is equivalent to #pragma pack(push, 4)
2154
2156
Action = (PP.getLangOpts ().ApplePragmaPack || PP.getLangOpts ().XLPragmaPack )
2155
- ? Sema::PSK_Push_Set
2156
- : Sema::PSK_Set ;
2157
+ ? PragmaMsStackAction::PushSet
2158
+ : PragmaMsStackAction::Set ;
2157
2159
} else if (Tok.is (tok::identifier)) {
2158
2160
// Map pragma pack options to pack (integer).
2159
2161
auto MapPack = [&](const char *Literal) {
2160
- Action = Sema::PSK_Push_Set ;
2162
+ Action = PragmaMsStackAction::PushSet ;
2161
2163
Alignment = Tok;
2162
2164
Alignment.setKind (tok::numeric_constant);
2163
2165
Alignment.setLiteralData (Literal);
@@ -2166,7 +2168,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2166
2168
2167
2169
const IdentifierInfo *II = Tok.getIdentifierInfo ();
2168
2170
if (II->isStr (" show" )) {
2169
- Action = Sema::PSK_Show ;
2171
+ Action = PragmaMsStackAction::Show ;
2170
2172
PP.Lex (Tok);
2171
2173
} else if (II->isStr (" packed" ) && PP.getLangOpts ().ZOSExt ) {
2172
2174
// #pragma pack(packed) is the same as #pragma pack(1)
@@ -2182,13 +2184,13 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2182
2184
PP.Lex (Tok);
2183
2185
} else if (II->isStr (" reset" ) && PP.getLangOpts ().ZOSExt ) {
2184
2186
// #pragma pack(reset) is the same as #pragma pack(pop) on XL
2185
- Action = Sema::PSK_Pop ;
2187
+ Action = PragmaMsStackAction::Pop ;
2186
2188
PP.Lex (Tok);
2187
2189
} else {
2188
2190
if (II->isStr (" push" )) {
2189
- Action = Sema::PSK_Push ;
2191
+ Action = PragmaMsStackAction::Push ;
2190
2192
} else if (II->isStr (" pop" )) {
2191
- Action = Sema::PSK_Pop ;
2193
+ Action = PragmaMsStackAction::Pop ;
2192
2194
} else {
2193
2195
PP.Diag (Tok.getLocation (), diag::warn_pragma_invalid_action) << " pack" ;
2194
2196
return ;
@@ -2199,7 +2201,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2199
2201
PP.Lex (Tok);
2200
2202
2201
2203
if (Tok.is (tok::numeric_constant)) {
2202
- Action = (Sema:: PragmaMsStackAction)(Action | Sema::PSK_Set );
2204
+ Action = (PragmaMsStackAction)(Action | PragmaMsStackAction::Set );
2203
2205
Alignment = Tok;
2204
2206
2205
2207
PP.Lex (Tok);
@@ -2215,7 +2217,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2215
2217
return ;
2216
2218
}
2217
2219
2218
- Action = (Sema:: PragmaMsStackAction)(Action | Sema::PSK_Set );
2220
+ Action = (PragmaMsStackAction)(Action | PragmaMsStackAction::Set );
2219
2221
Alignment = Tok;
2220
2222
2221
2223
PP.Lex (Tok);
@@ -2232,7 +2234,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
2232
2234
// the push/pop stack.
2233
2235
// In Apple gcc and IBM XL, #pragma pack() is equivalent to #pragma
2234
2236
// pack(pop).
2235
- Action = Sema::PSK_Pop ;
2237
+ Action = PragmaMsStackAction::Pop ;
2236
2238
}
2237
2239
2238
2240
if (Tok.isNot (tok::r_paren)) {
@@ -2895,7 +2897,7 @@ void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
2895
2897
}
2896
2898
PP.Lex (Tok);
2897
2899
2898
- Sema:: PragmaMsStackAction Action = Sema::PSK_Set ;
2900
+ PragmaMsStackAction Action = PragmaMsStackAction::Set ;
2899
2901
const IdentifierInfo *II = Tok.getIdentifierInfo ();
2900
2902
if (II) {
2901
2903
if (II->isStr (" push" )) {
@@ -2906,24 +2908,24 @@ void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
2906
2908
return ;
2907
2909
}
2908
2910
PP.Lex (Tok);
2909
- Action = Sema::PSK_Push_Set ;
2911
+ Action = PragmaMsStackAction::PushSet ;
2910
2912
// not push, could be on/off
2911
2913
} else if (II->isStr (" pop" )) {
2912
2914
// #pragma vtordisp(pop)
2913
2915
PP.Lex (Tok);
2914
- Action = Sema::PSK_Pop ;
2916
+ Action = PragmaMsStackAction::Pop ;
2915
2917
}
2916
2918
// not push or pop, could be on/off
2917
2919
} else {
2918
2920
if (Tok.is (tok::r_paren)) {
2919
2921
// #pragma vtordisp()
2920
- Action = Sema::PSK_Reset ;
2922
+ Action = PragmaMsStackAction::Reset ;
2921
2923
}
2922
2924
}
2923
2925
2924
2926
2925
2927
uint64_t Value = 0 ;
2926
- if (Action & Sema::PSK_Push || Action & Sema::PSK_Set ) {
2928
+ if (Action & PragmaMsStackAction::Push || Action & PragmaMsStackAction::Set ) {
2927
2929
const IdentifierInfo *II = Tok.getIdentifierInfo ();
2928
2930
if (II && II->isStr (" off" )) {
2929
2931
PP.Lex (Tok);
@@ -3014,7 +3016,7 @@ void PragmaMSPragma::HandlePragma(Preprocessor &PP,
3014
3016
void PragmaFloatControlHandler::HandlePragma (Preprocessor &PP,
3015
3017
PragmaIntroducer Introducer,
3016
3018
Token &Tok) {
3017
- Sema:: PragmaMsStackAction Action = Sema::PSK_Set ;
3019
+ PragmaMsStackAction Action = PragmaMsStackAction::Set ;
3018
3020
SourceLocation FloatControlLoc = Tok.getLocation ();
3019
3021
Token PragmaName = Tok;
3020
3022
if (!PP.getTargetInfo ().hasStrictFP () && !PP.getLangOpts ().ExpStrictFP ) {
@@ -3054,7 +3056,8 @@ void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
3054
3056
return ;
3055
3057
}
3056
3058
PP.Lex (Tok); // Eat the r_paren
3057
- Action = (Kind == PFC_Pop) ? Sema::PSK_Pop : Sema::PSK_Push;
3059
+ Action = (Kind == PFC_Pop) ? PragmaMsStackAction::Pop
3060
+ : PragmaMsStackAction::Push;
3058
3061
} else {
3059
3062
if (Tok.is (tok::r_paren))
3060
3063
// Selecting Precise or Except
@@ -3078,7 +3081,7 @@ void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
3078
3081
if (Kind == PFC_Except)
3079
3082
Kind = PFC_NoExcept;
3080
3083
} else if (PushOnOff == " push" ) {
3081
- Action = Sema::PSK_Push_Set ;
3084
+ Action = PragmaMsStackAction::PushSet ;
3082
3085
} else {
3083
3086
PP.Diag (Tok.getLocation (), diag::err_pragma_float_control_malformed);
3084
3087
return ;
@@ -3092,7 +3095,7 @@ void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
3092
3095
}
3093
3096
StringRef ExpectedPush = Tok.getIdentifierInfo ()->getName ();
3094
3097
if (ExpectedPush == " push" ) {
3095
- Action = Sema::PSK_Push_Set ;
3098
+ Action = PragmaMsStackAction::PushSet ;
3096
3099
} else {
3097
3100
PP.Diag (Tok.getLocation (), diag::err_pragma_float_control_malformed);
3098
3101
return ;
0 commit comments