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/MCObjectStreamer.cpp | |
parent | 7fcd4dcb98d2e2bec231e713aefd2cacc879dd33 (diff) |
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/MCObjectStreamer.cpp')
-rw-r--r-- | lib/MC/MCObjectStreamer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 111bc1be06..a8ea1a423d 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -172,6 +172,13 @@ void MCObjectStreamer::EmitInstruction(const MCInst &Inst) { EmitInstToFragment(Inst); } +void MCObjectStreamer::EmitInstToFragment(const MCInst &Inst) { + MCInstFragment *IF = new MCInstFragment(Inst, getCurrentSectionData()); + + raw_svector_ostream VecOS(IF->getCode()); + getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, IF->getFixups()); +} + void MCObjectStreamer::Finish() { getAssembler().Finish(); } |