aboutsummaryrefslogtreecommitdiff
path: root/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
commitb5159ed0cb7943e5938782f7693beb18342165ce (patch)
tree4628c4d85ae0c4ba0e60886297612c3733f678e9 /lib/CodeGen/MachineInstr.cpp
parent14d2638e383f27e3b502f2c7a9de2169a8a39a36 (diff)
Fixed up my changes to add support for cloning Machine Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index e1e44fd47e..401cd8b417 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/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