aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-02 05:44:06 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-02 05:44:06 +0000
commitdedb045c3296c831962c4ae101531c38c273ba89 (patch)
treed2e79615a7075aa7744d122425f357c7fa169bf8 /lib/MC/MCObjectStreamer.cpp
parent7fcd4dcb98d2e2bec231e713aefd2cacc879dd33 (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.cpp7
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();
}