@@ -869,8 +869,8 @@ void Parser::HandlePragmaFloatControl() {
869869 // and the FloatControl is the lower 16 bits. Use shift and bit-and
870870 // to decode the parts.
871871 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 );
874874 PragmaFloatControlKind Kind = PragmaFloatControlKind (Value & 0xFFFF );
875875 SourceLocation PragmaLoc = ConsumeAnnotationToken ();
876876 Actions.ActOnPragmaFloatControl (PragmaLoc, Action, Kind);
@@ -1019,8 +1019,8 @@ void Parser::HandlePragmaMSPointersToMembers() {
10191019void Parser::HandlePragmaMSVtorDisp () {
10201020 assert (Tok.is (tok::annot_pragma_ms_vtordisp));
10211021 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 );
10241024 MSVtorDispMode Mode = MSVtorDispMode (Value & 0xFFFF );
10251025 SourceLocation PragmaLoc = ConsumeAnnotationToken ();
10261026 Actions.ActOnPragmaMSVtorDisp (Action, PragmaLoc, Mode);
@@ -1151,21 +1151,21 @@ bool Parser::HandlePragmaMSSegment(StringRef PragmaName,
11511151 return false ;
11521152 }
11531153 PP.Lex (Tok); // (
1154- PragmaMsStackAction Action = PragmaMsStackAction::Reset ;
1154+ Sema:: PragmaMsStackAction Action = Sema::PSK_Reset ;
11551155 StringRef SlotLabel;
11561156 if (Tok.isAnyIdentifier ()) {
11571157 StringRef PushPop = Tok.getIdentifierInfo ()->getName ();
11581158 if (PushPop == " push" )
1159- Action = PragmaMsStackAction::Push ;
1159+ Action = Sema::PSK_Push ;
11601160 else if (PushPop == " pop" )
1161- Action = PragmaMsStackAction::Pop ;
1161+ Action = Sema::PSK_Pop ;
11621162 else {
11631163 PP.Diag (PragmaLocation,
11641164 diag::warn_pragma_expected_section_push_pop_or_name)
11651165 << PragmaName;
11661166 return false ;
11671167 }
1168- if (Action != PragmaMsStackAction::Reset ) {
1168+ if (Action != Sema::PSK_Reset ) {
11691169 PP.Lex (Tok); // push | pop
11701170 if (Tok.is (tok::comma)) {
11711171 PP.Lex (Tok); // ,
@@ -1191,12 +1191,10 @@ bool Parser::HandlePragmaMSSegment(StringRef PragmaName,
11911191 StringLiteral *SegmentName = nullptr ;
11921192 if (Tok.isNot (tok::r_paren)) {
11931193 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;
12001198 PP.Diag (PragmaLocation, DiagID) << PragmaName;
12011199 return false ;
12021200 }
@@ -1211,7 +1209,7 @@ bool Parser::HandlePragmaMSSegment(StringRef PragmaName,
12111209 }
12121210 // Setting section "" has no effect
12131211 if (SegmentName->getLength ())
1214- Action = (PragmaMsStackAction)(Action | PragmaMsStackAction::Set );
1212+ Action = (Sema:: PragmaMsStackAction)(Action | Sema::PSK_Set );
12151213 }
12161214 if (Tok.isNot (tok::r_paren)) {
12171215 PP.Diag (PragmaLocation, diag::warn_pragma_expected_rparen) << PragmaName;
@@ -1300,23 +1298,23 @@ bool Parser::HandlePragmaMSStrictGuardStackCheck(
13001298 PragmaName))
13011299 return false ;
13021300
1303- PragmaMsStackAction Action = PragmaMsStackAction::Set ;
1301+ Sema:: PragmaMsStackAction Action = Sema::PSK_Set ;
13041302 if (Tok.is (tok::identifier)) {
13051303 StringRef PushPop = Tok.getIdentifierInfo ()->getName ();
13061304 if (PushPop == " push" ) {
13071305 PP.Lex (Tok);
1308- Action = PragmaMsStackAction::Push ;
1306+ Action = Sema::PSK_Push ;
13091307 if (ExpectAndConsume (tok::comma, diag::warn_pragma_expected_punc,
13101308 PragmaName))
13111309 return false ;
13121310 } else if (PushPop == " pop" ) {
13131311 PP.Lex (Tok);
1314- Action = PragmaMsStackAction::Pop ;
1312+ Action = Sema::PSK_Pop ;
13151313 }
13161314 }
13171315
13181316 bool Value = false ;
1319- if (Action & PragmaMsStackAction::Push || Action & PragmaMsStackAction::Set ) {
1317+ if (Action & Sema::PSK_Push || Action & Sema::PSK_Set ) {
13201318 const IdentifierInfo *II = Tok.getIdentifierInfo ();
13211319 if (II && II->isStr (" off" )) {
13221320 PP.Lex (Tok);
@@ -2140,7 +2138,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
21402138 return ;
21412139 }
21422140
2143- PragmaMsStackAction Action = PragmaMsStackAction::Reset ;
2141+ Sema:: PragmaMsStackAction Action = Sema::PSK_Reset ;
21442142 StringRef SlotLabel;
21452143 Token Alignment;
21462144 Alignment.startToken ();
@@ -2154,12 +2152,12 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
21542152 // the push/pop stack.
21552153 // In Apple gcc/XL, #pragma pack(4) is equivalent to #pragma pack(push, 4)
21562154 Action = (PP.getLangOpts ().ApplePragmaPack || PP.getLangOpts ().XLPragmaPack )
2157- ? PragmaMsStackAction::PushSet
2158- : PragmaMsStackAction::Set ;
2155+ ? Sema::PSK_Push_Set
2156+ : Sema::PSK_Set ;
21592157 } else if (Tok.is (tok::identifier)) {
21602158 // Map pragma pack options to pack (integer).
21612159 auto MapPack = [&](const char *Literal) {
2162- Action = PragmaMsStackAction::PushSet ;
2160+ Action = Sema::PSK_Push_Set ;
21632161 Alignment = Tok;
21642162 Alignment.setKind (tok::numeric_constant);
21652163 Alignment.setLiteralData (Literal);
@@ -2168,7 +2166,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
21682166
21692167 const IdentifierInfo *II = Tok.getIdentifierInfo ();
21702168 if (II->isStr (" show" )) {
2171- Action = PragmaMsStackAction::Show ;
2169+ Action = Sema::PSK_Show ;
21722170 PP.Lex (Tok);
21732171 } else if (II->isStr (" packed" ) && PP.getLangOpts ().ZOSExt ) {
21742172 // #pragma pack(packed) is the same as #pragma pack(1)
@@ -2184,13 +2182,13 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
21842182 PP.Lex (Tok);
21852183 } else if (II->isStr (" reset" ) && PP.getLangOpts ().ZOSExt ) {
21862184 // #pragma pack(reset) is the same as #pragma pack(pop) on XL
2187- Action = PragmaMsStackAction::Pop ;
2185+ Action = Sema::PSK_Pop ;
21882186 PP.Lex (Tok);
21892187 } else {
21902188 if (II->isStr (" push" )) {
2191- Action = PragmaMsStackAction::Push ;
2189+ Action = Sema::PSK_Push ;
21922190 } else if (II->isStr (" pop" )) {
2193- Action = PragmaMsStackAction::Pop ;
2191+ Action = Sema::PSK_Pop ;
21942192 } else {
21952193 PP.Diag (Tok.getLocation (), diag::warn_pragma_invalid_action) << " pack" ;
21962194 return ;
@@ -2201,7 +2199,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
22012199 PP.Lex (Tok);
22022200
22032201 if (Tok.is (tok::numeric_constant)) {
2204- Action = (PragmaMsStackAction)(Action | PragmaMsStackAction::Set );
2202+ Action = (Sema:: PragmaMsStackAction)(Action | Sema::PSK_Set );
22052203 Alignment = Tok;
22062204
22072205 PP.Lex (Tok);
@@ -2217,7 +2215,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
22172215 return ;
22182216 }
22192217
2220- Action = (PragmaMsStackAction)(Action | PragmaMsStackAction::Set );
2218+ Action = (Sema:: PragmaMsStackAction)(Action | Sema::PSK_Set );
22212219 Alignment = Tok;
22222220
22232221 PP.Lex (Tok);
@@ -2234,7 +2232,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
22342232 // the push/pop stack.
22352233 // In Apple gcc and IBM XL, #pragma pack() is equivalent to #pragma
22362234 // pack(pop).
2237- Action = PragmaMsStackAction::Pop ;
2235+ Action = Sema::PSK_Pop ;
22382236 }
22392237
22402238 if (Tok.isNot (tok::r_paren)) {
@@ -2897,7 +2895,7 @@ void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
28972895 }
28982896 PP.Lex (Tok);
28992897
2900- PragmaMsStackAction Action = PragmaMsStackAction::Set ;
2898+ Sema:: PragmaMsStackAction Action = Sema::PSK_Set ;
29012899 const IdentifierInfo *II = Tok.getIdentifierInfo ();
29022900 if (II) {
29032901 if (II->isStr (" push" )) {
@@ -2908,24 +2906,24 @@ void PragmaMSVtorDisp::HandlePragma(Preprocessor &PP,
29082906 return ;
29092907 }
29102908 PP.Lex (Tok);
2911- Action = PragmaMsStackAction::PushSet ;
2909+ Action = Sema::PSK_Push_Set ;
29122910 // not push, could be on/off
29132911 } else if (II->isStr (" pop" )) {
29142912 // #pragma vtordisp(pop)
29152913 PP.Lex (Tok);
2916- Action = PragmaMsStackAction::Pop ;
2914+ Action = Sema::PSK_Pop ;
29172915 }
29182916 // not push or pop, could be on/off
29192917 } else {
29202918 if (Tok.is (tok::r_paren)) {
29212919 // #pragma vtordisp()
2922- Action = PragmaMsStackAction::Reset ;
2920+ Action = Sema::PSK_Reset ;
29232921 }
29242922 }
29252923
29262924
29272925 uint64_t Value = 0 ;
2928- if (Action & PragmaMsStackAction::Push || Action & PragmaMsStackAction::Set ) {
2926+ if (Action & Sema::PSK_Push || Action & Sema::PSK_Set ) {
29292927 const IdentifierInfo *II = Tok.getIdentifierInfo ();
29302928 if (II && II->isStr (" off" )) {
29312929 PP.Lex (Tok);
@@ -3016,7 +3014,7 @@ void PragmaMSPragma::HandlePragma(Preprocessor &PP,
30163014void PragmaFloatControlHandler::HandlePragma (Preprocessor &PP,
30173015 PragmaIntroducer Introducer,
30183016 Token &Tok) {
3019- PragmaMsStackAction Action = PragmaMsStackAction::Set ;
3017+ Sema:: PragmaMsStackAction Action = Sema::PSK_Set ;
30203018 SourceLocation FloatControlLoc = Tok.getLocation ();
30213019 Token PragmaName = Tok;
30223020 if (!PP.getTargetInfo ().hasStrictFP () && !PP.getLangOpts ().ExpStrictFP ) {
@@ -3056,8 +3054,7 @@ void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
30563054 return ;
30573055 }
30583056 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;
30613058 } else {
30623059 if (Tok.is (tok::r_paren))
30633060 // Selecting Precise or Except
@@ -3081,7 +3078,7 @@ void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
30813078 if (Kind == PFC_Except)
30823079 Kind = PFC_NoExcept;
30833080 } else if (PushOnOff == " push" ) {
3084- Action = PragmaMsStackAction::PushSet ;
3081+ Action = Sema::PSK_Push_Set ;
30853082 } else {
30863083 PP.Diag (Tok.getLocation (), diag::err_pragma_float_control_malformed);
30873084 return ;
@@ -3095,7 +3092,7 @@ void PragmaFloatControlHandler::HandlePragma(Preprocessor &PP,
30953092 }
30963093 StringRef ExpectedPush = Tok.getIdentifierInfo ()->getName ();
30973094 if (ExpectedPush == " push" ) {
3098- Action = PragmaMsStackAction::PushSet ;
3095+ Action = Sema::PSK_Push_Set ;
30993096 } else {
31003097 PP.Diag (Tok.getLocation (), diag::err_pragma_float_control_malformed);
31013098 return ;
0 commit comments