From af862116df18dedd6b6e775191db72a60d98595b Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Wed, 11 Feb 2004 05:55:00 +0000 Subject: [PATCH] Fix previous broken commit. A MachineOperand may have opType == MO_VirtualRegister but if the register number is one of a physical register is it considered as a physical register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11315 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9CodeEmitter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp index 3deb9e5e552..b69408d2bac 100644 --- a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp +++ b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp @@ -29,6 +29,7 @@ #include "llvm/CodeGen/MachineFunctionInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetData.h" #include "Support/Debug.h" @@ -656,9 +657,10 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineInstr &MI, std::cerr << "ERROR: PC relative disp unhandled:" << MO << "\n"; abort(); } - } else if (MO.getType() == MachineOperand::MO_MachineRegister || - MO.getType() == MachineOperand::MO_CCRegister) + } else if (MO.isRegister() || MO.getType() == MachineOperand::MO_CCRegister) { + assert(MRegisterInfo::isPhysicalRegister(MO.getReg()) && + "virtual register in machine code!"); // This is necessary because the Sparc backend doesn't actually lay out // registers in the real fashion -- it skips those that it chooses not to // allocate, i.e. those that are the FP, SP, etc. -- 2.34.1