Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ void WebAssemblyInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
const MCOperand &Op = MI->getOperand(OpNo);
if (Op.isReg()) {
const MCInstrDesc &Desc = MII.get(MI->getOpcode());
unsigned WAReg = Op.getReg();
if (int(WAReg) >= 0)
MCRegister WAReg = Op.getReg();
if (int(WAReg.id()) >= 0)
printRegName(O, WAReg);
else if (OpNo >= Desc.getNumDefs() && !IsVariadicDef)
O << "$pop" << WebAssembly::getWARegStackId(WAReg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,9 @@ inline bool isLocalTee(unsigned Opc) {
static const unsigned UnusedReg = -1u;

// For a given stackified WAReg, return the id number to print with push/pop.
unsigned inline getWARegStackId(unsigned Reg) {
assert(Reg & INT32_MIN);
return Reg & INT32_MAX;
unsigned inline getWARegStackId(MCRegister Reg) {
assert(Reg.id() & INT32_MIN);
return Reg.id() & INT32_MAX;
}

} // end namespace WebAssembly
Expand Down
Loading