Add better support for ARM EABI triples.

Patch by Renato Golin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124878 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bob Wilson 2011-02-04 17:59:28 +00:00
Родитель 2843c1900b
Коммит fc2bd7c3ef
1 изменённых файлов: 22 добавлений и 10 удалений

Просмотреть файл

@ -428,13 +428,16 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
ABIName = A->getValue(Args);
} else {
// Select the default based on the platform.
llvm::StringRef env = Triple.getEnvironmentName();
if (env == "gnueabi")
switch(Triple.getEnvironment()) {
case llvm::Triple::GNUEABI:
ABIName = "aapcs-linux";
else if (env == "eabi")
break;
case llvm::Triple::EABI:
ABIName = "aapcs";
else
break;
default:
ABIName = "apcs-gnu";
}
}
CmdArgs.push_back("-target-abi");
CmdArgs.push_back(ABIName);
@ -481,8 +484,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
}
case llvm::Triple::Linux: {
llvm::StringRef Env = getToolChain().getTriple().getEnvironmentName();
if (Env == "gnueabi") {
if (getToolChain().getTriple().getEnvironment() == llvm::Triple::GNUEABI) {
FloatABI = "softfp";
break;
}
@ -490,10 +492,20 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
// fall through
default:
// Assume "soft", but warn the user we are guessing.
FloatABI = "soft";
D.Diag(clang::diag::warn_drv_assuming_mfloat_abi_is) << "soft";
break;
switch(Triple.getEnvironment()) {
case llvm::Triple::GNUEABI:
FloatABI = "softfp";
break;
case llvm::Triple::EABI:
// EABI is always AAPCS, and if it was not marked 'hard', it's softfp
FloatABI = "softfp";
break;
default:
// Assume "soft", but warn the user we are guessing.
FloatABI = "soft";
D.Diag(clang::diag::warn_drv_assuming_mfloat_abi_is) << "soft";
break;
}
}
}