Currently, createMachOStreamer() is invoked directly in llvm-mc which

isn't ideal if we want to be able to use another object file format.

Add a createObjectStreamer() factory method so that the correct object
file streamer can be instantiated for a given target triple.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104318 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Fleming
2010-05-21 12:54:43 +00:00
parent 7efaef6b82
commit d8a33ddcfe
3 changed files with 68 additions and 1 deletions

View File

@ -301,7 +301,8 @@ static int AssembleInput(const char *ProgName) {
assert(FileType == OFT_ObjectFile && "Invalid file type!");
CE.reset(TheTarget->createCodeEmitter(*TM, Ctx));
TAB.reset(TheTarget->createAsmBackend(TripleName));
Str.reset(createMachOStreamer(Ctx, *TAB, *Out, CE.get(), RelaxAll));
Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *TAB,
*Out, CE.get(), RelaxAll));
}
AsmParser Parser(SrcMgr, Ctx, *Str.get(), *MAI);