summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-26 17:50:16 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-26 17:50:16 +0000
commit388ff9b1a2c3a7efd68eaa9b0c8bafa680fffd01 (patch)
tree5c7d604c2c89f1d9f9a36e23ae8f85e4fc547c7b
parentf9d540b0624ff755e1903a9a8a708d5ea8190386 (diff)
downloadbcm5719-llvm-388ff9b1a2c3a7efd68eaa9b0c8bafa680fffd01.tar.gz
bcm5719-llvm-388ff9b1a2c3a7efd68eaa9b0c8bafa680fffd01.zip
MC: Eliminate an unnecessary copy.
llvm-svn: 104709
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 50348e4ea3e..6c738aa4a85 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -434,11 +434,6 @@ void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
Assembler.getEmitter().EncodeInstruction(Inst, VecOS, Fixups);
VecOS.flush();
- // FIXME: Eliminate this copy.
- SmallVector<MCFixup, 4> AsmFixups;
- for (unsigned i = 0, e = Fixups.size(); i != e; ++i)
- AsmFixups.push_back(Fixups[i]);
-
// See if we might need to relax this instruction, if so it needs its own
// fragment.
//
@@ -461,16 +456,16 @@ void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
// FIXME: Revisit this design decision when relaxation is done, we may be
// able to get away with not storing any extra data in the MCInst.
IF->getCode() = Code;
- IF->getFixups() = AsmFixups;
+ IF->getFixups() = Fixups;
return;
}
// Add the fixups and data.
MCDataFragment *DF = getOrCreateDataFragment();
- for (unsigned i = 0, e = AsmFixups.size(); i != e; ++i) {
- AsmFixups[i].setOffset(AsmFixups[i].getOffset() + DF->getContents().size());
- DF->addFixup(AsmFixups[i]);
+ for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {
+ Fixups[i].setOffset(Fixups[i].getOffset() + DF->getContents().size());
+ DF->addFixup(Fixups[i]);
}
DF->getContents().append(Code.begin(), Code.end());
}
OpenPOWER on IntegriCloud