aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-16 20:04:25 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-16 20:04:25 +0000
commit83b467178a8295048f3ee7b44ff9c7ea244a96cc (patch)
tree31ee7a706181fa381b06475fb5c36abd7fd79a3c /lib/MC/MCObjectStreamer.cpp
parent8dc68ab931e0f0a7c5caf9cd341b2ec855733863 (diff)
MC: Lift SwitchSection() and Finish() into MCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCObjectStreamer.cpp')
-rw-r--r--lib/MC/MCObjectStreamer.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp
index 1b872e2395..d3f7f7783f 100644
--- a/lib/MC/MCObjectStreamer.cpp
+++ b/lib/MC/MCObjectStreamer.cpp
@@ -14,11 +14,26 @@ using namespace llvm;
MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
raw_ostream &_OS, MCCodeEmitter *_Emitter)
- : MCStreamer(Context),
- Assembler(new MCAssembler(Context, TAB, *_Emitter, _OS))
+ : MCStreamer(Context), Assembler(new MCAssembler(Context, TAB,
+ *_Emitter, _OS)),
+ CurSectionData(0)
{
}
MCObjectStreamer::~MCObjectStreamer() {
delete Assembler;
}
+
+void MCObjectStreamer::SwitchSection(const MCSection *Section) {
+ assert(Section && "Cannot switch to a null section!");
+
+ // If already in this section, then this is a noop.
+ if (Section == CurSection) return;
+
+ CurSection = Section;
+ CurSectionData = &getAssembler().getOrCreateSectionData(*Section);
+}
+
+void MCObjectStreamer::Finish() {
+ getAssembler().Finish();
+}