From 697df03545158ccdbca6671311127c02c2233ef8 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 20 Nov 2015 03:13:31 +0000 Subject: [PATCH] [WebAssembly] Remove the AsmPrinter code for printing physical registers. WebAssembly does not have physical registers, so even if LLVM uses physical registers like SP, they'll need to be lowered to virtual registers before AsmPrinter time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253644 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp index 400e85748eb..512cdd1579f 100644 --- a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp +++ b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp @@ -107,9 +107,8 @@ std::string WebAssemblyAsmPrinter::getRegTypeName(unsigned RegNo) const { std::string WebAssemblyAsmPrinter::regToString(const MachineOperand &MO) { unsigned RegNo = MO.getReg(); - if (TargetRegisterInfo::isPhysicalRegister(RegNo)) - return WebAssemblyInstPrinter::getRegisterName(RegNo); - + assert(TargetRegisterInfo::isVirtualRegister(RegNo) && + "Unlowered physical register encountered during assembly printing"); assert(!MFI->isVRegStackified(RegNo)); unsigned WAReg = MFI->getWAReg(RegNo); assert(WAReg != WebAssemblyFunctionInfo::UnusedReg); -- 2.34.1