@@ -5224,37 +5224,43 @@ bool AsmParser::parseDirectiveIfc(SMLoc DirectiveLoc, bool ExpectEqual) {
5224
5224
// / parseDirectiveIfeqs
5225
5225
// / ::= .ifeqs string1, string2
5226
5226
bool AsmParser::parseDirectiveIfeqs (SMLoc DirectiveLoc, bool ExpectEqual) {
5227
- if (Lexer.isNot (AsmToken::String)) {
5228
- if (ExpectEqual)
5229
- return TokError (" expected string parameter for '.ifeqs' directive" );
5230
- return TokError (" expected string parameter for '.ifnes' directive" );
5231
- }
5227
+ TheCondStack.push_back (TheCondState);
5228
+ TheCondState.TheCond = AsmCond::IfCond;
5232
5229
5233
- StringRef String1 = getTok ().getStringContents ();
5234
- Lex ();
5230
+ if (TheCondState.Ignore ) {
5231
+ eatToEndOfStatement ();
5232
+ } else {
5233
+ if (Lexer.isNot (AsmToken::String)) {
5234
+ if (ExpectEqual)
5235
+ return TokError (" expected string parameter for '.ifeqs' directive" );
5236
+ return TokError (" expected string parameter for '.ifnes' directive" );
5237
+ }
5235
5238
5236
- if (Lexer.isNot (AsmToken::Comma)) {
5237
- if (ExpectEqual)
5239
+ StringRef String1 = getTok ().getStringContents ();
5240
+ Lex ();
5241
+
5242
+ if (Lexer.isNot (AsmToken::Comma)) {
5243
+ if (ExpectEqual)
5244
+ return TokError (
5245
+ " expected comma after first string for '.ifeqs' directive" );
5238
5246
return TokError (
5239
- " expected comma after first string for '.ifeqs' directive" );
5240
- return TokError (" expected comma after first string for '.ifnes' directive" );
5241
- }
5247
+ " expected comma after first string for '.ifnes' directive" );
5248
+ }
5242
5249
5243
- Lex ();
5250
+ Lex ();
5244
5251
5245
- if (Lexer.isNot (AsmToken::String)) {
5246
- if (ExpectEqual)
5247
- return TokError (" expected string parameter for '.ifeqs' directive" );
5248
- return TokError (" expected string parameter for '.ifnes' directive" );
5249
- }
5252
+ if (Lexer.isNot (AsmToken::String)) {
5253
+ if (ExpectEqual)
5254
+ return TokError (" expected string parameter for '.ifeqs' directive" );
5255
+ return TokError (" expected string parameter for '.ifnes' directive" );
5256
+ }
5250
5257
5251
- StringRef String2 = getTok ().getStringContents ();
5252
- Lex ();
5258
+ StringRef String2 = getTok ().getStringContents ();
5259
+ Lex ();
5253
5260
5254
- TheCondStack.push_back (TheCondState);
5255
- TheCondState.TheCond = AsmCond::IfCond;
5256
- TheCondState.CondMet = ExpectEqual == (String1 == String2);
5257
- TheCondState.Ignore = !TheCondState.CondMet ;
5261
+ TheCondState.CondMet = ExpectEqual == (String1 == String2);
5262
+ TheCondState.Ignore = !TheCondState.CondMet ;
5263
+ }
5258
5264
5259
5265
return false ;
5260
5266
}
0 commit comments