aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2004-05-23 20:58:02 +0000
committerTanya Lattner <tonic@nondot.org>2004-05-23 20:58:02 +0000
commit9953d86e635131a1e76ff76194143ae8ebbb4f07 (patch)
tree076672e56019832f90301f2db966bb26483071bf /llvm/lib/CodeGen/MachineInstr.cpp
parentee4dcae9ba4175b62b139cd63b5b5532e4d56197 (diff)
downloadllvm-9953d86e635131a1e76ff76194143ae8ebbb4f07.zip
llvm-9953d86e635131a1e76ff76194143ae8ebbb4f07.tar.gz
llvm-9953d86e635131a1e76ff76194143ae8ebbb4f07.tar.bz2
Fixed up my changes to add support for cloning Machine Instructions.
llvm-svn: 13665
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index e1e44fd..401cd8b4 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -73,7 +73,8 @@ MachineInstr::MachineInstr(MachineBasicBlock *MBB, short opcode,
MachineInstr::MachineInstr(const MachineInstr &MI) {
Opcode = MI.getOpcode();
numImplicitRefs = MI.getNumImplicitRefs();
-
+ operands.reserve(MI.getNumOperands());
+
//Add operands
for(unsigned i=0; i < MI.getNumOperands(); ++i)
operands.push_back(MachineOperand(MI.getOperand(i)));
@@ -89,7 +90,7 @@ MachineInstr::~MachineInstr()
///all ways except the following: The instruction has no parent The
///instruction has no name
MachineInstr* MachineInstr::clone() {
- MachineInstr* newInst = new MachineInstr(*this);
+ return new MachineInstr(*this);
}
/// OperandComplete - Return true if it's illegal to add a new operand