From 7af55ad434f654128451106ed9f7813ea74c8616 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Tue, 10 Dec 2013 16:57:43 +0000 Subject: Make Triple's isOSBinFormatXXX functions partition triple-space. Most users would be surprised if "isCOFF" and "isMachO" were simultaneously true, unless they'd put the compiler in a box with a gun attached to a photon detector. This makes sure precisely one of the three formats is true for any triple and simplifies some target logic based on that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196934 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/Triple.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h index 84e0b29d1f..9b34d8a3da 100644 --- a/include/llvm/ADT/Triple.h +++ b/include/llvm/ADT/Triple.h @@ -341,17 +341,17 @@ public: /// \brief Tests whether the OS uses the ELF binary format. bool isOSBinFormatELF() const { - return !isOSDarwin() && !isOSWindows(); + return !isOSBinFormatMachO() && !isOSBinFormatCOFF(); } /// \brief Tests whether the OS uses the COFF binary format. bool isOSBinFormatCOFF() const { - return isOSWindows(); + return getEnvironment() != Triple::ELF && + getEnvironment() != Triple::MachO && isOSWindows(); } /// \brief Tests whether the environment is MachO. - // FIXME: Should this be an OSBinFormat predicate? - bool isEnvironmentMachO() const { + bool isOSBinFormatMachO() const { return getEnvironment() == Triple::MachO || isOSDarwin(); } -- cgit v1.2.3