[WebAssembly] Remove the AsmPrinter code for printing physical registers.
authorDan Gohman <dan433584@gmail.com>
Fri, 20 Nov 2015 03:13:31 +0000 (03:13 +0000)
committerDan Gohman <dan433584@gmail.com>
Fri, 20 Nov 2015 03:13:31 +0000 (03:13 +0000)
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

index 400e857..512cdd1 100644 (file)
@@ -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);