From: Fangrui Song Date: Thu, 7 Jan 2021 05:18:35 +0000 (-0800) Subject: [PowerPC] Delete remnant isOSDarwin references X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=01a2508aa58673e61089cb084301f588a391b323;p=android-x86%2Fexternal-llvm-project.git [PowerPC] Delete remnant isOSDarwin references --- diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp index e77d7b3d892..2eff1d94ce2 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp @@ -556,7 +556,7 @@ void PPCInstPrinter::printTLSCall(const MCInst *MI, unsigned OpNo, /// showRegistersWithPercentPrefix - Check if this register name should be /// printed with a percentage symbol as prefix. bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const { - if (!FullRegNamesWithPercent || TT.isOSDarwin() || TT.getOS() == Triple::AIX) + if (!FullRegNamesWithPercent || TT.getOS() == Triple::AIX) return false; switch (RegName[0]) { @@ -576,7 +576,7 @@ bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const { const char *PPCInstPrinter::getVerboseConditionRegName(unsigned RegNum, unsigned RegEncoding) const { - if (!TT.isOSDarwin() && !FullRegNames) + if (!FullRegNames) return nullptr; if (RegNum < PPC::CR0EQ || RegNum > PPC::CR7UN) return nullptr; @@ -598,7 +598,7 @@ const char *PPCInstPrinter::getVerboseConditionRegName(unsigned RegNum, bool PPCInstPrinter::showRegistersWithPrefix() const { if (TT.getOS() == Triple::AIX) return false; - return TT.isOSDarwin() || FullRegNamesWithPercent || FullRegNames; + return FullRegNamesWithPercent || FullRegNames; } void PPCInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h index 27c68768664..48806051f58 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h @@ -13,7 +13,6 @@ #ifndef LLVM_LIB_TARGET_POWERPC_MCTARGETDESC_PPCMCASMINFO_H #define LLVM_LIB_TARGET_POWERPC_MCTARGETDESC_PPCMCASMINFO_H -#include "llvm/MC/MCAsmInfoDarwin.h" #include "llvm/MC/MCAsmInfoELF.h" #include "llvm/MC/MCAsmInfoXCOFF.h" diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index b7ebc8dfa25..b5c84e7c261 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -146,10 +146,7 @@ static std::string getDataLayoutString(const Triple &T) { // Note, the alignment values for f64 and i64 on ppc64 in Darwin // documentation are wrong; these are correct (i.e. "what gcc does"). - if (is64Bit || !T.isOSDarwin()) - Ret += "-i64:64"; - else - Ret += "-f64:32:64"; + Ret += "-i64:64"; // PPC64 has 32 and 64 bit registers, PPC32 has only 32 bit ones. if (is64Bit) @@ -197,9 +194,6 @@ static std::string computeFSAdditions(StringRef FS, CodeGenOpt::Level OL, } static std::unique_ptr createTLOF(const Triple &TT) { - if (TT.isOSDarwin()) - return std::make_unique(); - if (TT.isOSAIX()) return std::make_unique(); @@ -208,9 +202,6 @@ static std::unique_ptr createTLOF(const Triple &TT) { static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT, const TargetOptions &Options) { - if (TT.isOSDarwin()) - report_fatal_error("Darwin is no longer supported for PowerPC"); - if (Options.MCOptions.getABIName().startswith("elfv1")) return PPCTargetMachine::PPC_ABI_ELFv1; else if (Options.MCOptions.getABIName().startswith("elfv2")) @@ -240,10 +231,6 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT, if (RM.hasValue()) return *RM; - // Darwin defaults to dynamic-no-pic. - if (TT.isOSDarwin()) - return Reloc::DynamicNoPIC; - // Big Endian PPC and AIX default to PIC. if (TT.getArch() == Triple::ppc64 || TT.isOSAIX()) return Reloc::PIC_;