mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-13 16:03:58 +00:00
X86: convert object streamer selection to a switch
Change the object streamer selection to a switch from a series of if conditions. Rather than defaulting to ELF, require that an ELF format is requested. The Windows/!ELF is maintained as MachO would have been selected first and will still provide a MachO format. Add an assertion that if COFF is requested that the target platform is Windows as only WinCOFF object emission is currently supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207200 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
53258e6f9e
commit
64b5470866
@ -358,13 +358,16 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
|
||||
bool NoExecStack) {
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSBinFormatMachO())
|
||||
switch (TheTriple.getObjectFormat()) {
|
||||
default: llvm_unreachable("unsupported object format");
|
||||
case Triple::MachO:
|
||||
return createMachOStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll);
|
||||
|
||||
if (TheTriple.isOSWindows() && !TheTriple.isOSBinFormatELF())
|
||||
case Triple::COFF:
|
||||
assert(TheTriple.isOSWindows() && "only Windows COFF is supported");
|
||||
return createWinCOFFStreamer(Ctx, MAB, *_Emitter, _OS, RelaxAll);
|
||||
|
||||
return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack);
|
||||
case Triple::ELF:
|
||||
return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack);
|
||||
}
|
||||
}
|
||||
|
||||
static MCInstPrinter *createX86MCInstPrinter(const Target &T,
|
||||
|
Loading…
x
Reference in New Issue
Block a user