Predefine version D_HardFloat instead of D_SoftFloat for -float-abi=softfp (#2678)

Matching the D_HardFloat semantics: 'the target hardware has a floating
point unit'.
This commit is contained in:
Martin Kinkelin 2018-05-11 14:39:12 +02:00 committed by GitHub
parent 7464d8449f
commit 0cd14bf80e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 21 deletions

View file

@ -345,7 +345,7 @@ llvm::TargetMachine *
createTargetMachine(const std::string targetTriple, const std::string arch,
std::string cpu, const std::string featuresString,
const ExplicitBitness::Type bitness,
FloatABI::Type floatABI,
FloatABI::Type &floatABI,
#if LDC_LLVM_VER >= 309
llvm::Optional<llvm::Reloc::Model> relocModel,
#else
@ -468,20 +468,19 @@ createTargetMachine(const std::string targetTriple, const std::string arch,
targetOptions.MCOptions.DwarfVersion = 3;
#endif
auto ldcFloatABI = floatABI;
if (ldcFloatABI == FloatABI::Default) {
if (floatABI == FloatABI::Default) {
switch (triple.getArch()) {
default: // X86, ...
ldcFloatABI = FloatABI::Hard;
floatABI = FloatABI::Hard;
break;
case llvm::Triple::arm:
case llvm::Triple::thumb:
ldcFloatABI = getARMFloatABI(triple, getLLVMArchSuffixForARM(cpu));
floatABI = getARMFloatABI(triple, getLLVMArchSuffixForARM(cpu));
break;
}
}
switch (ldcFloatABI) {
switch (floatABI) {
default:
llvm_unreachable("Floating point ABI type unknown.");
case FloatABI::Soft: