mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 10:57:35 +03:00
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:
parent
7464d8449f
commit
0cd14bf80e
5 changed files with 59 additions and 21 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue