- 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,
- !isDef ? MachineOperand::Use :
- (isDefAndUse ? MachineOperand::UseAndDef :
- MachineOperand::Def)));
- }
-
- void addRegOperand(Value *V,
- MachineOperand::UseType UTy = MachineOperand::Use,
- bool isPCRelative = false) {
- assert(!OperandsComplete() &&
- "Trying to add an operand to a machine instr that is already done!");
- operands.push_back(MachineOperand(V, MachineOperand::MO_VirtualRegister,
- UTy, isPCRelative));
- }
-
- void addCCRegOperand(Value *V,
- MachineOperand::UseType UTy = MachineOperand::Use) {
- assert(!OperandsComplete() &&
- "Trying to add an operand to a machine instr that is already done!");
- operands.push_back(MachineOperand(V, MachineOperand::MO_CCRegister, UTy,
- false));
- }
-
-
- /// addRegOperand - Add a symbolic virtual register reference...
- ///
- 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 ? MachineOperand::Def : MachineOperand::Use));
- }
-
- /// addRegOperand - Add a symbolic virtual register reference...
- ///
- void addRegOperand(int reg,
- MachineOperand::UseType UTy = MachineOperand::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) {
- assert(!OperandsComplete() &&
- "Trying to add an operand to a machine instr that is already done!");
- operands.push_back(
- MachineOperand(V, MachineOperand::MO_PCRelativeDisp,MachineOperand::Use));
- }
-
- /// addMachineRegOperand - Add a virtual register operand to this MachineInstr
- ///
- 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,
- isDef ? MachineOperand::Def : MachineOperand::Use));
- }
-
- /// addMachineRegOperand - Add a virtual register operand to this MachineInstr
- ///
- void addMachineRegOperand(int reg,
- MachineOperand::UseType UTy = MachineOperand::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));
- }
-
- /// addZeroExtImmOperand - Add a zero extended constant argument to the