[llvm-branch-commits] [llvm-branch] r104770 - /llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp
Daniel Dunbar
daniel at zuster.org
Wed May 26 15:29:08 PDT 2010
Author: ddunbar
Date: Wed May 26 17:29:07 2010
New Revision: 104770
URL: http://llvm.org/viewvc/llvm-project?rev=104770&view=rev
Log:
MC: Eliminate an unnecessary copy.
Modified:
llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp
Modified: llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp?rev=104770&r1=104769&r2=104770&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCMachOStreamer.cpp Wed May 26 17:29:07 2010
@@ -433,11 +433,6 @@
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.
//
@@ -460,16 +455,16 @@
// 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());
}
More information about the llvm-branch-commits
mailing list