From c920dc714da6bd987df060553d7098697b323264 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Mon, 8 Jul 2002 22:33:45 +0000 Subject: [PATCH] Added two more helper functions for instruction creation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2819 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/InstrSelectionSupport.h | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index a30192501b5..bb88200172e 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -136,6 +136,27 @@ Create2OperandInstr_SImmed(MachineOpCode opCode, return M; } +inline MachineInstr* +Create2OperandInstr_Reg(MachineOpCode opCode, + Value* argVal1, unsigned int regNum) +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, argVal1); + M->SetMachineOperandReg(1, regNum); + return M; +} + +inline MachineInstr* +Create2OperandInstr_Reg(MachineOpCode opCode, + unsigned int regNum1, unsigned int regNum2) + +{ + MachineInstr* M = new MachineInstr(opCode); + M->SetMachineOperandReg(0, regNum1); + M->SetMachineOperandReg(1, regNum2); + return M; +} + inline MachineInstr* Create3OperandInstr(MachineOpCode opCode, Value* argVal1, MachineOperand::MachineOperandType type1, -- 2.34.1