@@ -1944,7 +1944,7 @@ class AArch64Operand : public MCParsedAsmOperand {
1944
1944
void print (raw_ostream &OS) const override ;
1945
1945
1946
1946
static std::unique_ptr<AArch64Operand>
1947
- CreateToken (StringRef Str, bool IsSuffix, SMLoc S, MCContext &Ctx) {
1947
+ CreateToken (StringRef Str, SMLoc S, MCContext &Ctx, bool IsSuffix = false ) {
1948
1948
auto Op = std::make_unique<AArch64Operand>(k_Token, Ctx);
1949
1949
Op->Tok .Data = Str.data ();
1950
1950
Op->Tok .Length = Str.size ();
@@ -2875,10 +2875,8 @@ AArch64AsmParser::tryParseFPImm(OperandVector &Operands) {
2875
2875
RealVal.changeSign ();
2876
2876
2877
2877
if (AddFPZeroAsLiteral && RealVal.isPosZero ()) {
2878
- Operands.push_back (
2879
- AArch64Operand::CreateToken (" #0" , false , S, getContext ()));
2880
- Operands.push_back (
2881
- AArch64Operand::CreateToken (" .0" , false , S, getContext ()));
2878
+ Operands.push_back (AArch64Operand::CreateToken (" #0" , S, getContext ()));
2879
+ Operands.push_back (AArch64Operand::CreateToken (" .0" , S, getContext ()));
2882
2880
} else
2883
2881
Operands.push_back (AArch64Operand::CreateFPImm (
2884
2882
RealVal, *StatusOrErr == APFloat::opOK, S, getContext ()));
@@ -3274,8 +3272,7 @@ bool AArch64AsmParser::parseSysAlias(StringRef Name, SMLoc NameLoc,
3274
3272
return TokError (" invalid operand" );
3275
3273
3276
3274
Mnemonic = Name;
3277
- Operands.push_back (
3278
- AArch64Operand::CreateToken (" sys" , false , NameLoc, getContext ()));
3275
+ Operands.push_back (AArch64Operand::CreateToken (" sys" , NameLoc, getContext ()));
3279
3276
3280
3277
MCAsmParser &Parser = getParser ();
3281
3278
const AsmToken &Tok = Parser.getTok ();
@@ -3551,8 +3548,7 @@ bool AArch64AsmParser::tryParseNeonVectorRegister(OperandVector &Operands) {
3551
3548
// If there was an explicit qualifier, that goes on as a literal text
3552
3549
// operand.
3553
3550
if (!Kind.empty ())
3554
- Operands.push_back (
3555
- AArch64Operand::CreateToken (Kind, false , S, getContext ()));
3551
+ Operands.push_back (AArch64Operand::CreateToken (Kind, S, getContext ()));
3556
3552
3557
3553
return tryParseVectorIndex (Operands) == MatchOperand_ParseFail;
3558
3554
}
@@ -3658,8 +3654,7 @@ AArch64AsmParser::tryParseSVEPredicateVector(OperandVector &Operands) {
3658
3654
}
3659
3655
3660
3656
// Add a literal slash as operand
3661
- Operands.push_back (
3662
- AArch64Operand::CreateToken (" /" , false , getLoc (), getContext ()));
3657
+ Operands.push_back (AArch64Operand::CreateToken (" /" , getLoc (), getContext ()));
3663
3658
3664
3659
Parser.Lex (); // Eat the slash.
3665
3660
@@ -3672,8 +3667,7 @@ AArch64AsmParser::tryParseSVEPredicateVector(OperandVector &Operands) {
3672
3667
3673
3668
// Add zero/merge token.
3674
3669
const char *ZM = Pred == " z" ? " z" : " m" ;
3675
- Operands.push_back (
3676
- AArch64Operand::CreateToken (ZM, false , getLoc (), getContext ()));
3670
+ Operands.push_back (AArch64Operand::CreateToken (ZM, getLoc (), getContext ()));
3677
3671
3678
3672
Parser.Lex (); // Eat zero/merge token.
3679
3673
return MatchOperand_Success;
@@ -3985,12 +3979,12 @@ bool AArch64AsmParser::parseOptionalMulOperand(OperandVector &Operands) {
3985
3979
return true ;
3986
3980
3987
3981
Operands.push_back (
3988
- AArch64Operand::CreateToken (" mul" , false , getLoc (), getContext ()));
3982
+ AArch64Operand::CreateToken (" mul" , getLoc (), getContext ()));
3989
3983
Parser.Lex (); // Eat the "mul"
3990
3984
3991
3985
if (NextIsVL) {
3992
3986
Operands.push_back (
3993
- AArch64Operand::CreateToken (" vl" , false , getLoc (), getContext ()));
3987
+ AArch64Operand::CreateToken (" vl" , getLoc (), getContext ()));
3994
3988
Parser.Lex (); // Eat the "vl"
3995
3989
return false ;
3996
3990
}
@@ -4025,7 +4019,7 @@ bool AArch64AsmParser::parseKeywordOperand(OperandVector &Operands) {
4025
4019
.Case (" za" , " za" )
4026
4020
.Default (Keyword);
4027
4021
Operands.push_back (
4028
- AArch64Operand::CreateToken (Keyword, false , Tok.getLoc (), getContext ()));
4022
+ AArch64Operand::CreateToken (Keyword, Tok.getLoc (), getContext ()));
4029
4023
4030
4024
Parser.Lex ();
4031
4025
return false ;
@@ -4065,8 +4059,7 @@ bool AArch64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
4065
4059
}
4066
4060
case AsmToken::LBrac: {
4067
4061
SMLoc Loc = Parser.getTok ().getLoc ();
4068
- Operands.push_back (AArch64Operand::CreateToken (" [" , false , Loc,
4069
- getContext ()));
4062
+ Operands.push_back (AArch64Operand::CreateToken (" [" , Loc, getContext ()));
4070
4063
Parser.Lex (); // Eat '['
4071
4064
4072
4065
// There's no comma after a '[', so we can parse the next operand
@@ -4078,8 +4071,7 @@ bool AArch64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
4078
4071
return false ;
4079
4072
4080
4073
SMLoc Loc = Parser.getTok ().getLoc ();
4081
- Operands.push_back (
4082
- AArch64Operand::CreateToken (" {" , false , Loc, getContext ()));
4074
+ Operands.push_back (AArch64Operand::CreateToken (" {" , Loc, getContext ()));
4083
4075
Parser.Lex (); // Eat '{'
4084
4076
4085
4077
// There's no comma after a '{', so we can parse the next operand
@@ -4159,10 +4151,8 @@ bool AArch64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
4159
4151
return TokError (" expected floating-point constant #0.0" );
4160
4152
Parser.Lex (); // Eat the token.
4161
4153
4162
- Operands.push_back (
4163
- AArch64Operand::CreateToken (" #0" , false , S, getContext ()));
4164
- Operands.push_back (
4165
- AArch64Operand::CreateToken (" .0" , false , S, getContext ()));
4154
+ Operands.push_back (AArch64Operand::CreateToken (" #0" , S, getContext ()));
4155
+ Operands.push_back (AArch64Operand::CreateToken (" .0" , S, getContext ()));
4166
4156
return false ;
4167
4157
}
4168
4158
@@ -4202,9 +4192,9 @@ bool AArch64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
4202
4192
Imm >>= 16 ;
4203
4193
}
4204
4194
if (ShiftAmt <= MaxShiftAmt && Imm <= 0xFFFF ) {
4205
- Operands[0 ] = AArch64Operand::CreateToken (" movz" , false , Loc, Ctx);
4206
- Operands.push_back (AArch64Operand::CreateImm (
4207
- MCConstantExpr::create (Imm, Ctx), S, E, Ctx));
4195
+ Operands[0 ] = AArch64Operand::CreateToken (" movz" , Loc, Ctx);
4196
+ Operands.push_back (AArch64Operand::CreateImm (
4197
+ MCConstantExpr::create (Imm, Ctx), S, E, Ctx));
4208
4198
if (ShiftAmt)
4209
4199
Operands.push_back (AArch64Operand::CreateShiftExtend (AArch64_AM::LSL,
4210
4200
ShiftAmt, true , S, E, Ctx));
@@ -4354,8 +4344,7 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
4354
4344
Head == " cfp" || Head == " dvp" || Head == " cpp" )
4355
4345
return parseSysAlias (Head, NameLoc, Operands);
4356
4346
4357
- Operands.push_back (
4358
- AArch64Operand::CreateToken (Head, false , NameLoc, getContext ()));
4347
+ Operands.push_back (AArch64Operand::CreateToken (Head, NameLoc, getContext ()));
4359
4348
Mnemonic = Head;
4360
4349
4361
4350
// Handle condition codes for a branch mnemonic
@@ -4369,8 +4358,8 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
4369
4358
AArch64CC::CondCode CC = parseCondCodeString (Head);
4370
4359
if (CC == AArch64CC::Invalid)
4371
4360
return Error (SuffixLoc, " invalid condition code" );
4372
- Operands.push_back (
4373
- AArch64Operand::CreateToken ( " . " , true , SuffixLoc, getContext () ));
4361
+ Operands.push_back (AArch64Operand::CreateToken ( " . " , SuffixLoc, getContext (),
4362
+ /* IsSuffix= */ true ));
4374
4363
Operands.push_back (
4375
4364
AArch64Operand::CreateCondCode (CC, NameLoc, NameLoc, getContext ()));
4376
4365
}
@@ -4382,8 +4371,8 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
4382
4371
Head = Name.slice (Start, Next);
4383
4372
SMLoc SuffixLoc = SMLoc::getFromPointer (NameLoc.getPointer () +
4384
4373
(Head.data () - Name.data ()) + 1 );
4385
- Operands.push_back (
4386
- AArch64Operand::CreateToken ( Head, true , SuffixLoc, getContext ()));
4374
+ Operands.push_back (AArch64Operand::CreateToken (
4375
+ Head, SuffixLoc, getContext (), /* IsSuffix= */ true ));
4387
4376
}
4388
4377
4389
4378
// Conditional compare instructions have a Condition Code operand, which needs
@@ -4432,13 +4421,13 @@ bool AArch64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
4432
4421
4433
4422
if (parseOptionalToken (AsmToken::RBrac))
4434
4423
Operands.push_back (
4435
- AArch64Operand::CreateToken (" ]" , false , getLoc (), getContext ()));
4424
+ AArch64Operand::CreateToken (" ]" , getLoc (), getContext ()));
4436
4425
if (parseOptionalToken (AsmToken::Exclaim))
4437
4426
Operands.push_back (
4438
- AArch64Operand::CreateToken (" !" , false , getLoc (), getContext ()));
4427
+ AArch64Operand::CreateToken (" !" , getLoc (), getContext ()));
4439
4428
if (parseOptionalToken (AsmToken::RCurly))
4440
4429
Operands.push_back (
4441
- AArch64Operand::CreateToken (" }" , false , getLoc (), getContext ()));
4430
+ AArch64Operand::CreateToken (" }" , getLoc (), getContext ()));
4442
4431
4443
4432
++N;
4444
4433
} while (parseOptionalToken (AsmToken::Comma));
@@ -5144,8 +5133,8 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
5144
5133
const MCExpr *NewOp3 = MCConstantExpr::create (NewOp3Val, getContext ());
5145
5134
const MCExpr *NewOp4 = MCConstantExpr::create (NewOp4Val, getContext ());
5146
5135
5147
- Operands[0 ] = AArch64Operand::CreateToken (
5148
- " ubfm" , false , Op.getStartLoc (), getContext ());
5136
+ Operands[0 ] =
5137
+ AArch64Operand::CreateToken ( " ubfm" , Op.getStartLoc (), getContext ());
5149
5138
Operands.push_back (AArch64Operand::CreateImm (
5150
5139
NewOp4, Op3.getStartLoc (), Op3.getEndLoc (), getContext ()));
5151
5140
Operands[3 ] = AArch64Operand::CreateImm (NewOp3, Op3.getStartLoc (),
@@ -5194,8 +5183,8 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
5194
5183
5195
5184
const MCExpr *ImmRExpr = MCConstantExpr::create (ImmR, getContext ());
5196
5185
const MCExpr *ImmSExpr = MCConstantExpr::create (ImmS, getContext ());
5197
- Operands[0 ] = AArch64Operand::CreateToken (
5198
- " bfm" , false , Op.getStartLoc (), getContext ());
5186
+ Operands[0 ] =
5187
+ AArch64Operand::CreateToken ( " bfm" , Op.getStartLoc (), getContext ());
5199
5188
Operands[2 ] = AArch64Operand::CreateReg (
5200
5189
RegWidth == 32 ? AArch64::WZR : AArch64::XZR, RegKind::Scalar,
5201
5190
SMLoc (), SMLoc (), getContext ());
@@ -5257,14 +5246,14 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
5257
5246
Operands[4 ] = AArch64Operand::CreateImm (
5258
5247
NewOp4, Op4.getStartLoc (), Op4.getEndLoc (), getContext ());
5259
5248
if (Tok == " bfi" )
5260
- Operands[0 ] = AArch64Operand::CreateToken (
5261
- " bfm " , false , Op. getStartLoc (), getContext ());
5249
+ Operands[0 ] = AArch64Operand::CreateToken (" bfm " , Op. getStartLoc (),
5250
+ getContext ());
5262
5251
else if (Tok == " sbfiz" )
5263
- Operands[0 ] = AArch64Operand::CreateToken (
5264
- " sbfm " , false , Op. getStartLoc (), getContext ());
5252
+ Operands[0 ] = AArch64Operand::CreateToken (" sbfm " , Op. getStartLoc (),
5253
+ getContext ());
5265
5254
else if (Tok == " ubfiz" )
5266
- Operands[0 ] = AArch64Operand::CreateToken (
5267
- " ubfm " , false , Op. getStartLoc (), getContext ());
5255
+ Operands[0 ] = AArch64Operand::CreateToken (" ubfm " , Op. getStartLoc (),
5256
+ getContext ());
5268
5257
else
5269
5258
llvm_unreachable (" No valid mnemonic for alias?" );
5270
5259
}
@@ -5311,14 +5300,14 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
5311
5300
Operands[4 ] = AArch64Operand::CreateImm (
5312
5301
NewOp4, Op4.getStartLoc (), Op4.getEndLoc (), getContext ());
5313
5302
if (Tok == " bfxil" )
5314
- Operands[0 ] = AArch64Operand::CreateToken (
5315
- " bfm " , false , Op. getStartLoc (), getContext ());
5303
+ Operands[0 ] = AArch64Operand::CreateToken (" bfm " , Op. getStartLoc (),
5304
+ getContext ());
5316
5305
else if (Tok == " sbfx" )
5317
- Operands[0 ] = AArch64Operand::CreateToken (
5318
- " sbfm " , false , Op. getStartLoc (), getContext ());
5306
+ Operands[0 ] = AArch64Operand::CreateToken (" sbfm " , Op. getStartLoc (),
5307
+ getContext ());
5319
5308
else if (Tok == " ubfx" )
5320
- Operands[0 ] = AArch64Operand::CreateToken (
5321
- " ubfm " , false , Op. getStartLoc (), getContext ());
5309
+ Operands[0 ] = AArch64Operand::CreateToken (" ubfm " , Op. getStartLoc (),
5310
+ getContext ());
5322
5311
else
5323
5312
llvm_unreachable (" No valid mnemonic for alias?" );
5324
5313
}
@@ -5344,8 +5333,8 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
5344
5333
" correctly on this CPU, converting to equivalent movi.16b" );
5345
5334
// Switch the suffix to .16b.
5346
5335
unsigned Idx = Op1.isToken () ? 1 : 2 ;
5347
- Operands[Idx] = AArch64Operand::CreateToken ( " .16b " , false , IDLoc,
5348
- getContext ());
5336
+ Operands[Idx] =
5337
+ AArch64Operand::CreateToken ( " .16b " , IDLoc, getContext ());
5349
5338
}
5350
5339
}
5351
5340
}
0 commit comments