mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Tidied up target triple OS detection. NFC
Use Triple::isOS*() helper functions where possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b76e1afc5
commit
53a43d38df
@ -364,10 +364,26 @@ public:
|
|||||||
return isMacOSX() || isiOS();
|
return isMacOSX() || isiOS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isOSNetBSD() const {
|
||||||
|
return getOS() == Triple::NetBSD;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isOSOpenBSD() const {
|
||||||
|
return getOS() == Triple::OpenBSD;
|
||||||
|
}
|
||||||
|
|
||||||
bool isOSFreeBSD() const {
|
bool isOSFreeBSD() const {
|
||||||
return getOS() == Triple::FreeBSD;
|
return getOS() == Triple::FreeBSD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isOSSolaris() const {
|
||||||
|
return getOS() == Triple::Solaris;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isOSBitrig() const {
|
||||||
|
return getOS() == Triple::Bitrig;
|
||||||
|
}
|
||||||
|
|
||||||
bool isWindowsMSVCEnvironment() const {
|
bool isWindowsMSVCEnvironment() const {
|
||||||
return getOS() == Triple::Win32 &&
|
return getOS() == Triple::Win32 &&
|
||||||
(getEnvironment() == Triple::UnknownEnvironment ||
|
(getEnvironment() == Triple::UnknownEnvironment ||
|
||||||
|
@ -401,7 +401,7 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
|
|||||||
// platform.
|
// platform.
|
||||||
EHSectionType = ELF::SHT_PROGBITS;
|
EHSectionType = ELF::SHT_PROGBITS;
|
||||||
EHSectionFlags = ELF::SHF_ALLOC;
|
EHSectionFlags = ELF::SHF_ALLOC;
|
||||||
if (T.getOS() == Triple::Solaris) {
|
if (T.isOSSolaris()) {
|
||||||
if (T.getArch() == Triple::x86_64)
|
if (T.getArch() == Triple::x86_64)
|
||||||
EHSectionType = ELF::SHT_X86_64_UNWIND;
|
EHSectionType = ELF::SHT_X86_64_UNWIND;
|
||||||
else
|
else
|
||||||
|
@ -347,7 +347,7 @@ public:
|
|||||||
bool isTargetIOS() const { return TargetTriple.isiOS(); }
|
bool isTargetIOS() const { return TargetTriple.isiOS(); }
|
||||||
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
||||||
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
||||||
bool isTargetNetBSD() const { return TargetTriple.getOS() == Triple::NetBSD; }
|
bool isTargetNetBSD() const { return TargetTriple.isOSNetBSD(); }
|
||||||
bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
|
bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
|
||||||
|
|
||||||
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
||||||
|
@ -110,8 +110,7 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
|
|||||||
|
|
||||||
// OpenBSD and Bitrig have buggy support for .quad in 32-bit mode, just split
|
// OpenBSD and Bitrig have buggy support for .quad in 32-bit mode, just split
|
||||||
// into two .words.
|
// into two .words.
|
||||||
if ((T.getOS() == Triple::OpenBSD || T.getOS() == Triple::Bitrig) &&
|
if ((T.isOSOpenBSD() || T.isOSBitrig()) && T.getArch() == Triple::x86)
|
||||||
T.getArch() == Triple::x86)
|
|
||||||
Data64bitsDirective = nullptr;
|
Data64bitsDirective = nullptr;
|
||||||
|
|
||||||
// Always enable the integrated assembler by default.
|
// Always enable the integrated assembler by default.
|
||||||
|
@ -323,13 +323,13 @@ public:
|
|||||||
/// Is this x86_64 with the ILP32 programming model (x32 ABI)?
|
/// Is this x86_64 with the ILP32 programming model (x32 ABI)?
|
||||||
bool isTarget64BitILP32() const {
|
bool isTarget64BitILP32() const {
|
||||||
return In64BitMode && (TargetTriple.getEnvironment() == Triple::GNUX32 ||
|
return In64BitMode && (TargetTriple.getEnvironment() == Triple::GNUX32 ||
|
||||||
TargetTriple.getOS() == Triple::NaCl);
|
TargetTriple.isOSNaCl());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
|
/// Is this x86_64 with the LP64 programming model (standard AMD64, no x32)?
|
||||||
bool isTarget64BitLP64() const {
|
bool isTarget64BitLP64() const {
|
||||||
return In64BitMode && (TargetTriple.getEnvironment() != Triple::GNUX32 &&
|
return In64BitMode && (TargetTriple.getEnvironment() != Triple::GNUX32 &&
|
||||||
TargetTriple.getOS() != Triple::NaCl);
|
!TargetTriple.isOSNaCl());
|
||||||
}
|
}
|
||||||
|
|
||||||
PICStyles::Style getPICStyle() const { return PICStyle; }
|
PICStyles::Style getPICStyle() const { return PICStyle; }
|
||||||
@ -403,12 +403,8 @@ public:
|
|||||||
const Triple &getTargetTriple() const { return TargetTriple; }
|
const Triple &getTargetTriple() const { return TargetTriple; }
|
||||||
|
|
||||||
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
|
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
|
||||||
bool isTargetFreeBSD() const {
|
bool isTargetFreeBSD() const { return TargetTriple.isOSFreeBSD(); }
|
||||||
return TargetTriple.getOS() == Triple::FreeBSD;
|
bool isTargetSolaris() const { return TargetTriple.isOSSolaris(); }
|
||||||
}
|
|
||||||
bool isTargetSolaris() const {
|
|
||||||
return TargetTriple.getOS() == Triple::Solaris;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
||||||
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
||||||
|
@ -291,8 +291,8 @@ static ShadowMapping getShadowMapping(const Module &M, int LongSize) {
|
|||||||
llvm::Triple TargetTriple(M.getTargetTriple());
|
llvm::Triple TargetTriple(M.getTargetTriple());
|
||||||
bool IsAndroid = TargetTriple.getEnvironment() == llvm::Triple::Android;
|
bool IsAndroid = TargetTriple.getEnvironment() == llvm::Triple::Android;
|
||||||
bool IsIOS = TargetTriple.isiOS();
|
bool IsIOS = TargetTriple.isiOS();
|
||||||
bool IsFreeBSD = TargetTriple.getOS() == llvm::Triple::FreeBSD;
|
bool IsFreeBSD = TargetTriple.isOSFreeBSD();
|
||||||
bool IsLinux = TargetTriple.getOS() == llvm::Triple::Linux;
|
bool IsLinux = TargetTriple.isOSLinux();
|
||||||
bool IsPPC64 = TargetTriple.getArch() == llvm::Triple::ppc64 ||
|
bool IsPPC64 = TargetTriple.getArch() == llvm::Triple::ppc64 ||
|
||||||
TargetTriple.getArch() == llvm::Triple::ppc64le;
|
TargetTriple.getArch() == llvm::Triple::ppc64le;
|
||||||
bool IsX86_64 = TargetTriple.getArch() == llvm::Triple::x86_64;
|
bool IsX86_64 = TargetTriple.getArch() == llvm::Triple::x86_64;
|
||||||
|
Loading…
Reference in New Issue
Block a user