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