This is a simple refactoring that replaces Triple.getEnvironment()
checks for Android with Triple.isAndroid().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249750
91177308-0d34-0410-b5e6-
96231b3b80d8
getOS() == Triple::PS4;
}
+ /// \brief Tests whether the target is Android
+ bool isAndroid() const { return getEnvironment() == Triple::Android; }
+
/// @}
/// @name Mutators
/// @{
bool isTargetIOS() const { return TargetTriple.isiOS(); }
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
+ bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
TargetTriple.getEnvironment() == Triple::GNUEABI ||
TargetTriple.getEnvironment() == Triple::EABIHF ||
TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
- TargetTriple.getEnvironment() == Triple::Android) &&
+ isTargetAndroid()) &&
!isTargetDarwin() && !isTargetWindows();
}
TargetTriple.getEnvironment() == Triple::EABIHF ||
isTargetWindows();
}
- bool isTargetAndroid() const {
- return TargetTriple.getEnvironment() == Triple::Android;
- }
+ bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
bool isAPCS_ABI() const;
bool isAAPCS_ABI() const;
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
- bool isTargetAndroid() const {
- return TargetTriple.getEnvironment() == Triple::Android;
- }
+ bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); }
bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); }
static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
bool IsKasan) {
- bool IsAndroid = TargetTriple.getEnvironment() == llvm::Triple::Android;
+ bool IsAndroid = TargetTriple.isAndroid();
bool IsIOS = TargetTriple.isiOS();
bool IsFreeBSD = TargetTriple.isOSFreeBSD();
bool IsLinux = TargetTriple.isOSLinux();
}
// Android provides a libc function that returns the stack pointer address.
- if (TargetTriple.getEnvironment() == llvm::Triple::Android) {
+ if (TargetTriple.isAndroid()) {
Value *Fn = M.getOrInsertFunction(kUnsafeStackPtrAddrFn,
StackPtrTy->getPointerTo(0), nullptr);
return IRB.CreateCall(Fn);