forked from OSchip/llvm-project
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:
parent
35476334e9
commit
29b82b631d
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue