mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
Clean up some usage of Triple. The base class has methods for determining if the target is iOS and Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9071f68fd2
commit
441c557708
@ -323,7 +323,7 @@ public:
|
||||
return getOS() == Triple::Win32 || getOS() == Triple::MinGW32;
|
||||
}
|
||||
|
||||
/// isOSWindows - Is this a "Windows" OS.
|
||||
/// \brief Tests whether the OS is Windows.
|
||||
bool isOSWindows() const {
|
||||
return getOS() == Triple::Win32 || isOSCygMing();
|
||||
}
|
||||
@ -333,6 +333,11 @@ public:
|
||||
return getOS() == Triple::NaCl;
|
||||
}
|
||||
|
||||
/// \brief Tests whether the OS is Linux.
|
||||
bool isOSLinux() const {
|
||||
return getOS() == Triple::Linux;
|
||||
}
|
||||
|
||||
/// \brief Tests whether the OS uses the ELF binary format.
|
||||
bool isOSBinFormatELF() const {
|
||||
return !isOSDarwin() && !isOSWindows();
|
||||
|
@ -91,7 +91,7 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple,
|
||||
// FIXME: non-iOS ARM FastISel is broken with MCJIT.
|
||||
if (UseMCJIT &&
|
||||
TheTriple.getArch() == Triple::arm &&
|
||||
TheTriple.getOS() != Triple::IOS &&
|
||||
!TheTriple.isiOS() &&
|
||||
OptLevel == CodeGenOpt::None) {
|
||||
OptLevel = CodeGenOpt::Less;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const;
|
||||
|
||||
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
||||
bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; }
|
||||
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
||||
|
||||
bool hasNEON() const { return HasNEON; }
|
||||
|
||||
|
@ -421,7 +421,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
||||
}
|
||||
|
||||
// Use divmod compiler-rt calls for iOS 5.0 and later.
|
||||
if (Subtarget->getTargetTriple().getOS() == Triple::IOS &&
|
||||
if (Subtarget->getTargetTriple().isiOS() &&
|
||||
!Subtarget->getTargetTriple().isOSVersionLT(5, 0)) {
|
||||
setLibcallName(RTLIB::SDIVREM_I32, "__divmodsi4");
|
||||
setLibcallName(RTLIB::UDIVREM_I32, "__udivmodsi4");
|
||||
|
@ -275,10 +275,10 @@ public:
|
||||
|
||||
const Triple &getTargetTriple() const { return TargetTriple; }
|
||||
|
||||
bool isTargetIOS() const { return TargetTriple.getOS() == Triple::IOS; }
|
||||
bool isTargetIOS() const { return TargetTriple.isiOS(); }
|
||||
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
|
||||
bool isTargetNaCl() const { return TargetTriple.getOS() == Triple::NaCl; }
|
||||
bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; }
|
||||
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
||||
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
||||
bool isTargetELF() const { return !isTargetDarwin(); }
|
||||
// ARM EABI is the bare-metal EABI described in ARM ABI documents and
|
||||
// can be accessed via -target arm-none-eabi. This is NOT GNUEABI.
|
||||
|
@ -58,8 +58,7 @@ public:
|
||||
}
|
||||
bool isTargetDarwin() const {
|
||||
Triple TT(STI.getTargetTriple());
|
||||
Triple::OSType OS = TT.getOS();
|
||||
return OS == Triple::Darwin || OS == Triple::MacOSX || OS == Triple::IOS;
|
||||
return TT.isOSDarwin();
|
||||
}
|
||||
|
||||
unsigned getMachineSoImmOpValue(unsigned SoImm) const;
|
||||
|
@ -350,7 +350,7 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
|
||||
if (T.isMacOSX()) {
|
||||
if (T.isMacOSXVersionLT(10, 5))
|
||||
TLI.setUnavailable(LibFunc::memset_pattern16);
|
||||
} else if (T.getOS() == Triple::IOS) {
|
||||
} else if (T.isiOS()) {
|
||||
if (T.isOSVersionLT(3, 0))
|
||||
TLI.setUnavailable(LibFunc::memset_pattern16);
|
||||
} else {
|
||||
@ -562,7 +562,7 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
|
||||
}
|
||||
|
||||
// The following functions are available on at least Linux:
|
||||
if (T.getOS() != Triple::Linux) {
|
||||
if (!T.isOSLinux()) {
|
||||
TLI.setUnavailable(LibFunc::dunder_strdup);
|
||||
TLI.setUnavailable(LibFunc::dunder_strtok_r);
|
||||
TLI.setUnavailable(LibFunc::dunder_isoc99_scanf);
|
||||
|
@ -311,10 +311,8 @@ public:
|
||||
return (TargetTriple.getEnvironment() == Triple::ELF ||
|
||||
TargetTriple.isOSBinFormatELF());
|
||||
}
|
||||
bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; }
|
||||
bool isTargetNaCl() const {
|
||||
return TargetTriple.getOS() == Triple::NaCl;
|
||||
}
|
||||
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
||||
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
||||
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
|
||||
bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
|
||||
bool isTargetWindows() const { return TargetTriple.getOS() == Triple::Win32; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user