Update for LLVM API change

Use the new getObjectFormat/setObjectFormat instead of Environment now that the
file format is a separate field.

llvm-svn: 203161
This commit is contained in:
Saleem Abdulrasool 2014-03-06 20:47:19 +00:00
parent 35476334e9
commit 29b82b631d
4 changed files with 10 additions and 9 deletions

View File

@ -5911,7 +5911,7 @@ static TargetInfo *AllocateTarget(const llvm::Triple &Triple) {
}
case llvm::Triple::x86_64:
if (Triple.isOSDarwin() || Triple.getEnvironment() == llvm::Triple::MachO)
if (Triple.isOSDarwin() || Triple.getObjectFormat() == llvm::Triple::MachO)
return new DarwinX86_64TargetInfo(Triple);
switch (os) {

View File

@ -1971,7 +1971,7 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
TC = new toolchains::Generic_ELF(*this, Target, Args);
break;
}
if (Target.getEnvironment() == llvm::Triple::MachO) {
if (Target.getObjectFormat() == llvm::Triple::MachO) {
TC = new toolchains::MachO(*this, Target, Args);
break;
}

View File

@ -666,10 +666,6 @@ StringRef tools::arm::getARMFloatABI(const Driver &D, const ArgList &Args,
// EABI is always AAPCS, and if it was not marked 'hard', it's softfp
FloatABI = "softfp";
break;
case llvm::Triple::MachO: {
FloatABI = "soft";
break;
}
case llvm::Triple::Android: {
std::string ArchName =
arm::getLLVMArchSuffixForARM(arm::getARMTargetCPU(Args, Triple));
@ -682,6 +678,10 @@ StringRef tools::arm::getARMFloatABI(const Driver &D, const ArgList &Args,
default:
// Assume "soft", but warn the user we are guessing.
FloatABI = "soft";
// *-macho defaults to "soft"
if (Triple.getOS() == llvm::Triple::UnknownOS &&
Triple.getObjectFormat() == llvm::Triple::MachO)
break;
D.Diag(diag::warn_drv_assuming_mfloat_abi_is) << "soft";
break;
}
@ -761,7 +761,8 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
// The backend is hardwired to assume AAPCS for M-class processors, ensure
// the frontend matches that.
if (Triple.getEnvironment() == llvm::Triple::EABI ||
Triple.getEnvironment() == llvm::Triple::MachO ||
(Triple.getOS() == llvm::Triple::UnknownOS &&
Triple.getObjectFormat() == llvm::Triple::MachO) ||
StringRef(CPUName).startswith("cortex-m")) {
ABIName = "aapcs";
} else {
@ -4885,7 +4886,7 @@ void darwin::setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str) {
T.setArchName(Str);
else if (Str == "armv6m" || Str == "armv7m" || Str == "armv7em") {
T.setOS(llvm::Triple::UnknownOS);
T.setEnvironment(llvm::Triple::MachO);
T.setObjectFormat(llvm::Triple::MachO);
}
}

View File

@ -43,7 +43,7 @@ Tool *Windows::buildLinker() const {
}
Tool *Windows::buildAssembler() const {
if (getTriple().getEnvironment() == llvm::Triple::MachO)
if (getTriple().getObjectFormat() == llvm::Triple::MachO)
return new tools::darwin::Assemble(*this);
getDriver().Diag(clang::diag::err_no_external_assembler);
return NULL;