Split the object streamer callback in one per file format.

There are two main advantages to doing this

* Targets that only need to handle one of the formats specially don't have
  to worry about the others. For example, x86 now only registers a
  constructor for the COFF streamer.

* Changes to the arguments passed to one format constructor will not impact
  the other formats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232699 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-03-19 01:50:16 +00:00
parent dd08f96ac7
commit c7c4c36694
22 changed files with 194 additions and 171 deletions

View File

@@ -423,16 +423,3 @@ void MCObjectStreamer::FinishImpl() {
flushPendingLabels(nullptr);
getAssembler().Finish();
}
MCStreamer *llvm::createObjectStreamer(const Triple &T, MCContext &Ctx,
MCAsmBackend &TAB, raw_ostream &OS,
MCCodeEmitter *Emitter,
const MCSubtargetInfo &STI,
bool RelaxAll) {
switch (T.getObjectFormat()) {
default:
return nullptr;
case Triple::ELF:
return createELFStreamer(Ctx, TAB, OS, Emitter, RelaxAll);
}
}