1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Add Triple::isX86()

Reviewed By: craig.topper, skan

Differential Revision: https://reviews.llvm.org/D72247
This commit is contained in:
Fangrui Song 2020-01-06 10:16:28 -08:00
parent 7fdc97cfea
commit ce9eae4112
3 changed files with 7 additions and 5 deletions

View File

@ -730,6 +730,11 @@ public:
return getArch() == Triple::riscv32 || getArch() == Triple::riscv64;
}
/// Tests whether the target is x86 (32- or 64-bit).
bool isX86() const {
return getArch() == Triple::x86 || getArch() == Triple::x86_64;
}
/// Tests whether the target supports comdat
bool supportsCOMDAT() const {
return !isOSBinFormatMachO();

View File

@ -4163,9 +4163,7 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) {
// If X86, and the datalayout matches the expected format, add pointer size
// address spaces to the datalayout.
Triple::ArchType Arch = Triple(TT).getArch();
if ((Arch != llvm::Triple::x86 && Arch != llvm::Triple::x86_64) ||
DL.contains(AddrSpaces))
if (!Triple(TT).isX86() || DL.contains(AddrSpaces))
return DL;
SmallVector<StringRef, 4> Groups;

View File

@ -1253,8 +1253,7 @@ std::string DevirtModule::getGlobalName(VTableSlot Slot,
bool DevirtModule::shouldExportConstantsAsAbsoluteSymbols() {
Triple T(M.getTargetTriple());
return (T.getArch() == Triple::x86 || T.getArch() == Triple::x86_64) &&
T.getObjectFormat() == Triple::ELF;
return T.isX86() && T.getObjectFormat() == Triple::ELF;
}
void DevirtModule::exportGlobal(VTableSlot Slot, ArrayRef<uint64_t> Args,