Skip to content

Commit 0b55699

Browse files
committed
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
1 parent 1987d52 commit 0b55699

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/MC/MCObjectFileInfo.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,9 @@ void MCObjectFileInfo::InitMCObjectFileInfo(StringRef TT, Reloc::Model relocm,
739739
(T.isOSDarwin() || T.getEnvironment() == Triple::MachO)) {
740740
Env = IsMachO;
741741
InitMachOMCObjectFileInfo(T);
742-
} else if ((Arch == Triple::x86 || Arch == Triple::x86_64) &&
743-
(T.getEnvironment() != Triple::ELF) &&
744-
(T.getOS() == Triple::MinGW32 || T.getOS() == Triple::Cygwin ||
745-
T.getOS() == Triple::Win32)) {
742+
} else if (T.isOSWindows() && T.getEnvironment() != Triple::ELF) {
743+
assert((Arch == Triple::x86 || Arch == Triple::x86_64) &&
744+
"expected x86 or x86_64");
746745
Env = IsCOFF;
747746
InitCOFFMCObjectFileInfo(T);
748747
} else {

0 commit comments

Comments
 (0)