summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86Subtarget.h
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-12-10 16:57:43 +0000
committerTim Northover <tnorthover@apple.com>2013-12-10 16:57:43 +0000
commit7af55ad434f654128451106ed9f7813ea74c8616 (patch)
tree071ea4ffbb2c29e0481a86e17cbfbf5b3a7c3bdf /lib/Target/X86/X86Subtarget.h
parent8b71466c439dfd316906a6b1ef2ff7a30f4221ad (diff)
downloadllvm-7af55ad434f654128451106ed9f7813ea74c8616.tar.gz
llvm-7af55ad434f654128451106ed9f7813ea74c8616.tar.bz2
llvm-7af55ad434f654128451106ed9f7813ea74c8616.tar.xz
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
Diffstat (limited to 'lib/Target/X86/X86Subtarget.h')
-rw-r--r--lib/Target/X86/X86Subtarget.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h
index cddd9d898e..08dbf0270c 100644
--- a/lib/Target/X86/X86Subtarget.h
+++ b/lib/Target/X86/X86Subtarget.h
@@ -319,10 +319,11 @@ public:
bool isTargetSolaris() const {
return TargetTriple.getOS() == Triple::Solaris;
}
- bool isTargetELF() const {
- return (TargetTriple.getEnvironment() == Triple::ELF ||
- TargetTriple.isOSBinFormatELF());
- }
+
+ bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
+ bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
+ bool isTargetMacho() const { return TargetTriple.isOSBinFormatMachO(); }
+
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
@@ -331,11 +332,6 @@ public:
bool isTargetMingw() const { return TargetTriple.getOS() == Triple::MinGW32; }
bool isTargetCygwin() const { return TargetTriple.getOS() == Triple::Cygwin; }
bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); }
- bool isTargetCOFF() const {
- return (TargetTriple.getEnvironment() != Triple::ELF &&
- TargetTriple.isOSBinFormatCOFF());
- }
- bool isTargetEnvMacho() const { return TargetTriple.isEnvironmentMachO(); }
bool isOSWindows() const { return TargetTriple.isOSWindows(); }