diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-02 05:44:06 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-02 05:44:06 +0000 |
commit | dedb045c3296c831962c4ae101531c38c273ba89 (patch) | |
tree | d2e79615a7075aa7744d122425f357c7fa169bf8 /lib/MC/MCELFStreamer.cpp | |
parent | 7fcd4dcb98d2e2bec231e713aefd2cacc879dd33 (diff) | |
download | external_llvm-dedb045c3296c831962c4ae101531c38c273ba89.tar.gz external_llvm-dedb045c3296c831962c4ae101531c38c273ba89.tar.bz2 external_llvm-dedb045c3296c831962c4ae101531c38c273ba89.zip |
Add EmitInstToFragment to the generic object streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | lib/MC/MCELFStreamer.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp index 9dfc16e209..f7cb3edb0d 100644 --- a/lib/MC/MCELFStreamer.cpp +++ b/lib/MC/MCELFStreamer.cpp @@ -459,23 +459,11 @@ void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) { } void MCELFStreamer::EmitInstToFragment(const MCInst &Inst) { - MCInstFragment *IF = new MCInstFragment(Inst, getCurrentSectionData()); + this->MCObjectStreamer::EmitInstToFragment(Inst); + MCInstFragment &F = *cast<MCInstFragment>(getCurrentFragment()); - // Add the fixups and data. - // - // 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. - SmallVector<MCFixup, 4> Fixups; - SmallString<256> Code; - raw_svector_ostream VecOS(Code); - getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, Fixups); - VecOS.flush(); - - for (unsigned i = 0, e = Fixups.size(); i != e; ++i) - fixSymbolsInTLSFixups(Fixups[i].getValue()); - - IF->getCode() = Code; - IF->getFixups() = Fixups; + for (unsigned i = 0, e = F.getFixups().size(); i != e; ++i) + fixSymbolsInTLSFixups(F.getFixups()[i].getValue()); } void MCELFStreamer::EmitInstToData(const MCInst &Inst) { |