@@ -77,16 +77,16 @@ struct WebAssemblyOperand : public MCParsedAsmOperand {
77
77
struct BrLOp BrL;
78
78
};
79
79
80
- WebAssemblyOperand (KindTy K, SMLoc Start, SMLoc End, TokOp T)
81
- : Kind(K ), StartLoc(Start), EndLoc(End), Tok(T) {}
82
- WebAssemblyOperand (KindTy K, SMLoc Start, SMLoc End, IntOp I)
83
- : Kind(K ), StartLoc(Start), EndLoc(End), Int(I) {}
84
- WebAssemblyOperand (KindTy K, SMLoc Start, SMLoc End, FltOp F)
85
- : Kind(K ), StartLoc(Start), EndLoc(End), Flt(F) {}
86
- WebAssemblyOperand (KindTy K, SMLoc Start, SMLoc End, SymOp S)
87
- : Kind(K ), StartLoc(Start), EndLoc(End), Sym(S) {}
88
- WebAssemblyOperand (KindTy K, SMLoc Start, SMLoc End)
89
- : Kind(K ), StartLoc(Start), EndLoc(End), BrL() {}
80
+ WebAssemblyOperand (SMLoc Start, SMLoc End, TokOp T)
81
+ : Kind(Token ), StartLoc(Start), EndLoc(End), Tok(T) {}
82
+ WebAssemblyOperand (SMLoc Start, SMLoc End, IntOp I)
83
+ : Kind(Integer ), StartLoc(Start), EndLoc(End), Int(I) {}
84
+ WebAssemblyOperand (SMLoc Start, SMLoc End, FltOp F)
85
+ : Kind(Float ), StartLoc(Start), EndLoc(End), Flt(F) {}
86
+ WebAssemblyOperand (SMLoc Start, SMLoc End, SymOp S)
87
+ : Kind(Symbol ), StartLoc(Start), EndLoc(End), Sym(S) {}
88
+ WebAssemblyOperand (SMLoc Start, SMLoc End)
89
+ : Kind(BrList ), StartLoc(Start), EndLoc(End), BrL() {}
90
90
91
91
~WebAssemblyOperand () {
92
92
if (isBrList ())
@@ -388,8 +388,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
388
388
if (IsNegative)
389
389
Val = -Val;
390
390
Operands.push_back (std::make_unique<WebAssemblyOperand>(
391
- WebAssemblyOperand::Integer, Int.getLoc (), Int.getEndLoc (),
392
- WebAssemblyOperand::IntOp{Val}));
391
+ Int.getLoc (), Int.getEndLoc (), WebAssemblyOperand::IntOp{Val}));
393
392
Parser.Lex ();
394
393
}
395
394
@@ -401,8 +400,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
401
400
if (IsNegative)
402
401
Val = -Val;
403
402
Operands.push_back (std::make_unique<WebAssemblyOperand>(
404
- WebAssemblyOperand::Float, Flt.getLoc (), Flt.getEndLoc (),
405
- WebAssemblyOperand::FltOp{Val}));
403
+ Flt.getLoc (), Flt.getEndLoc (), WebAssemblyOperand::FltOp{Val}));
406
404
Parser.Lex ();
407
405
return false ;
408
406
}
@@ -423,8 +421,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
423
421
if (IsNegative)
424
422
Val = -Val;
425
423
Operands.push_back (std::make_unique<WebAssemblyOperand>(
426
- WebAssemblyOperand::Float, Flt.getLoc (), Flt.getEndLoc (),
427
- WebAssemblyOperand::FltOp{Val}));
424
+ Flt.getLoc (), Flt.getEndLoc (), WebAssemblyOperand::FltOp{Val}));
428
425
Parser.Lex ();
429
426
return false ;
430
427
}
@@ -459,8 +456,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
459
456
// up later.
460
457
auto Tok = Lexer.getTok ();
461
458
Operands.push_back (std::make_unique<WebAssemblyOperand>(
462
- WebAssemblyOperand::Integer, Tok.getLoc (), Tok.getEndLoc (),
463
- WebAssemblyOperand::IntOp{-1 }));
459
+ Tok.getLoc (), Tok.getEndLoc (), WebAssemblyOperand::IntOp{-1 }));
464
460
}
465
461
}
466
462
return false ;
@@ -474,8 +470,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
474
470
NestingStack.back ().Sig = Sig;
475
471
}
476
472
Operands.push_back (std::make_unique<WebAssemblyOperand>(
477
- WebAssemblyOperand::Integer, NameLoc, NameLoc,
478
- WebAssemblyOperand::IntOp{static_cast <int64_t >(BT)}));
473
+ NameLoc, NameLoc, WebAssemblyOperand::IntOp{static_cast <int64_t >(BT)}));
479
474
}
480
475
481
476
bool parseLimits (wasm::WasmLimits *Limits) {
@@ -512,25 +507,22 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
512
507
GetOrCreateFunctionTableSymbol (getContext (), Tok.getString (), is64);
513
508
const auto *Val = MCSymbolRefExpr::create (Sym, getContext ());
514
509
*Op = std::make_unique<WebAssemblyOperand>(
515
- WebAssemblyOperand::Symbol, Tok.getLoc (), Tok.getEndLoc (),
516
- WebAssemblyOperand::SymOp{Val});
510
+ Tok.getLoc (), Tok.getEndLoc (), WebAssemblyOperand::SymOp{Val});
517
511
Parser.Lex ();
518
512
return expect (AsmToken::Comma, " ," );
519
513
} else {
520
514
const auto *Val =
521
515
MCSymbolRefExpr::create (DefaultFunctionTable, getContext ());
522
516
*Op = std::make_unique<WebAssemblyOperand>(
523
- WebAssemblyOperand::Symbol, SMLoc (), SMLoc (),
524
- WebAssemblyOperand::SymOp{Val});
517
+ SMLoc (), SMLoc (), WebAssemblyOperand::SymOp{Val});
525
518
return false ;
526
519
}
527
520
} else {
528
521
// For the MVP there is at most one table whose number is 0, but we can't
529
522
// write a table symbol or issue relocations. Instead we just ensure the
530
523
// table is live and write a zero.
531
524
getStreamer ().emitSymbolAttribute (DefaultFunctionTable, MCSA_NoDeadStrip);
532
- *Op = std::make_unique<WebAssemblyOperand>(WebAssemblyOperand::Integer,
533
- SMLoc (), SMLoc (),
525
+ *Op = std::make_unique<WebAssemblyOperand>(SMLoc (), SMLoc (),
534
526
WebAssemblyOperand::IntOp{0 });
535
527
return false ;
536
528
}
@@ -564,7 +556,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
564
556
565
557
// Now construct the name as first operand.
566
558
Operands.push_back (std::make_unique<WebAssemblyOperand>(
567
- WebAssemblyOperand::Token, NameLoc, SMLoc::getFromPointer (Name.end ()),
559
+ NameLoc, SMLoc::getFromPointer (Name.end ()),
568
560
WebAssemblyOperand::TokOp{Name}));
569
561
570
562
// If this instruction is part of a control flow structure, ensure
@@ -645,8 +637,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
645
637
const MCExpr *Expr = MCSymbolRefExpr::create (
646
638
WasmSym, MCSymbolRefExpr::VK_WASM_TYPEINDEX, Ctx);
647
639
Operands.push_back (std::make_unique<WebAssemblyOperand>(
648
- WebAssemblyOperand::Symbol, Loc.getLoc (), Loc.getEndLoc (),
649
- WebAssemblyOperand::SymOp{Expr}));
640
+ Loc.getLoc (), Loc.getEndLoc (), WebAssemblyOperand::SymOp{Expr}));
650
641
}
651
642
652
643
while (Lexer.isNot (AsmToken::EndOfStatement)) {
@@ -671,8 +662,7 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
671
662
if (Parser.parseExpression (Val, End))
672
663
return error (" Cannot parse symbol: " , Lexer.getTok ());
673
664
Operands.push_back (std::make_unique<WebAssemblyOperand>(
674
- WebAssemblyOperand::Symbol, Start, End,
675
- WebAssemblyOperand::SymOp{Val}));
665
+ Start, End, WebAssemblyOperand::SymOp{Val}));
676
666
if (checkForP2AlignIfLoadStore (Operands, Name))
677
667
return true ;
678
668
}
@@ -705,8 +695,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
705
695
}
706
696
case AsmToken::LCurly: {
707
697
Parser.Lex ();
708
- auto Op = std::make_unique<WebAssemblyOperand>(
709
- WebAssemblyOperand::BrList, Tok.getLoc (), Tok.getEndLoc ());
698
+ auto Op =
699
+ std::make_unique<WebAssemblyOperand>( Tok.getLoc (), Tok.getEndLoc ());
710
700
if (!Lexer.is (AsmToken::RCurly))
711
701
for (;;) {
712
702
Op->BrL .List .push_back (Lexer.getTok ().getIntVal ());
0 commit comments