From 4690e6d42f7289793b87a9f3f54c751b0ac83705 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 15 Jan 2003 18:11:11 +0000 Subject: [PATCH] Fix bug found by regtests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5294 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9InstrSelection.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index 05208a4a219..1e0a82d83b2 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -1251,18 +1251,14 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, Instruction* returnReg = new TmpInstruction(returnInstr); MachineCodeForInstruction::get(returnInstr).addTemp(returnReg); - M = new MachineInstr(JMPLRET); - M->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, - returnReg); - M->SetMachineOperandConst(1,MachineOperand::MO_SignExtendedImmed, - (int64_t)8); - M->SetMachineOperandReg(2, target.getRegInfo().getZeroRegNum()); + M = BuildMI(JMPLRET, 3).addReg(returnReg).addSImm(8) + .addMReg(target.getRegInfo().getZeroRegNum(), MOTy::Def); if (returnInstr->getReturnValue() != NULL) M->addImplicitRef(returnInstr->getReturnValue()); mvec.push_back(M); - mvec.push_back(new MachineInstr(NOP)); + mvec.push_back(BuildMI(NOP, 0)); break; } @@ -1998,8 +1994,8 @@ GetInstructionsByRule(InstructionNode* subtreeRoot, if (isa(callee)) // direct function call M = BuildMI(CALL, 1).addPCDisp(callee); else // indirect function call - M = BuildMI(JMPLCALL, - 3).addReg(callee).addSImm((int64_t)0).addReg(retAddrReg); + M = BuildMI(JMPLCALL, 3).addReg(callee).addSImm((int64_t)0) + .addRegDef(retAddrReg); mvec.push_back(M); const FunctionType* funcType =