From 23e6bba592af68ba991ee6900978e81eb21a08af Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 17 Nov 2002 22:33:54 +0000 Subject: [PATCH] Finish enumating code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4726 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineInstr.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 92045c3dcc6..421d753d10e 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -383,7 +383,7 @@ public: /// addRegOperand - Add a MO_VirtualRegister operand to the end of the /// operands list... /// - void addRegOperand(Value *V, bool isDef=false, bool isDefAndUse=false) { + void addRegOperand(Value *V, bool isDef, bool isDefAndUse=false) { assert(!OperandsComplete() && "Trying to add an operand to a machine instr that is already done!"); operands.push_back(MachineOperand(V, MachineOperand::MO_VirtualRegister, @@ -399,13 +399,22 @@ public: /// addRegOperand - Add a symbolic virtual register reference... /// - void addRegOperand(int reg, bool isDef = false) { + void addRegOperand(int reg, bool isDef) { assert(!OperandsComplete() && "Trying to add an operand to a machine instr that is already done!"); operands.push_back(MachineOperand(reg, MachineOperand::MO_VirtualRegister, isDef ? MOTy::Def : MOTy::Use)); } + /// addRegOperand - Add a symbolic virtual register reference... + /// + void addRegOperand(int reg, MOTy::UseType UTy = MOTy::Use) { + assert(!OperandsComplete() && + "Trying to add an operand to a machine instr that is already done!"); + operands.push_back(MachineOperand(reg, MachineOperand::MO_VirtualRegister, + UTy)); + } + /// addPCDispOperand - Add a PC relative displacement operand to the MI /// void addPCDispOperand(Value *V) { @@ -417,7 +426,7 @@ public: /// addMachineRegOperand - Add a virtual register operand to this MachineInstr /// - void addMachineRegOperand(int reg, bool isDef=false) { + void addMachineRegOperand(int reg, bool isDef) { assert(!OperandsComplete() && "Trying to add an operand to a machine instr that is already done!"); operands.push_back(MachineOperand(reg, MachineOperand::MO_MachineRegister, @@ -425,6 +434,16 @@ public: insertUsedReg(reg); } + /// addMachineRegOperand - Add a virtual register operand to this MachineInstr + /// + void addMachineRegOperand(int reg, MOTy::UseType UTy = MOTy::Use) { + assert(!OperandsComplete() && + "Trying to add an operand to a machine instr that is already done!"); + operands.push_back(MachineOperand(reg, MachineOperand::MO_MachineRegister, + UTy)); + insertUsedReg(reg); + } + /// addZeroExtImmOperand - Add a zero extended constant argument to the /// machine instruction. ///