From 0b5569972f4dae062a430fa0e8cedc0021b020b8 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 6 Mar 2014 20:47:03 +0000 Subject: MC: simplify object file selection for Windows Windows always uses COFF unless Windows ELF is in use. Rather than checking if Windows, MinGW, or Cygwin is being targeted, just check if the target OS is windows and that it is not an ELF environment. llvm-svn: 203159 --- llvm/lib/MC/MCObjectFileInfo.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp') diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 931b3544e34..9a512d561fe 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -739,10 +739,9 @@ void MCObjectFileInfo::InitMCObjectFileInfo(StringRef TT, Reloc::Model relocm, (T.isOSDarwin() || T.getEnvironment() == Triple::MachO)) { Env = IsMachO; InitMachOMCObjectFileInfo(T); - } else if ((Arch == Triple::x86 || Arch == Triple::x86_64) && - (T.getEnvironment() != Triple::ELF) && - (T.getOS() == Triple::MinGW32 || T.getOS() == Triple::Cygwin || - T.getOS() == Triple::Win32)) { + } else if (T.isOSWindows() && T.getEnvironment() != Triple::ELF) { + assert((Arch == Triple::x86 || Arch == Triple::x86_64) && + "expected x86 or x86_64"); Env = IsCOFF; InitCOFFMCObjectFileInfo(T); } else { -- cgit v1.2.3