1 //===- lib/MC/MCObjectStreamer.cpp - Object File MCStreamer Interface -----===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCObjectStreamer.h"
12 #include "llvm/MC/MCAssembler.h"
15 MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
16 raw_ostream &_OS, MCCodeEmitter *_Emitter)
17 : MCStreamer(Context), Assembler(new MCAssembler(Context, TAB,
23 MCObjectStreamer::~MCObjectStreamer() {
27 void MCObjectStreamer::SwitchSection(const MCSection *Section) {
28 assert(Section && "Cannot switch to a null section!");
30 // If already in this section, then this is a noop.
31 if (Section == CurSection) return;
34 CurSectionData = &getAssembler().getOrCreateSectionData(*Section);
37 void MCObjectStreamer::Finish() {
38 getAssembler().Finish();