Add method MachineInstr::replace to rewrite a machine instruction in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve
2002-09-20 00:47:49 +00:00
parent 32f81a3469
commit e8b57ef260
2 changed files with 28 additions and 0 deletions
+16
View File
@@ -27,6 +27,22 @@ MachineInstr::MachineInstr(MachineOpCode _opCode,
{
}
//
// Support for replacing opcode and operands of a MachineInstr in place.
// This only resets the size of the operand vector and initializes it.
// The new operands must be set explicitly later.
//
void
MachineInstr::replace(MachineOpCode _opCode,
unsigned numOperands,
OpCodeMask _opCodeMask)
{
opCode = _opCode;
opCodeMask = _opCodeMask;
operands.clear();
operands.resize(numOperands);
}
void
MachineInstr::SetMachineOperandVal(unsigned int i,
MachineOperand::MachineOperandType opType,