UseSoftFloat was removed from the TargetOptions in LLVM3.7. It's replacement (I believe) is the "+soft-float" target feature (in the target feature string). Inside LLVM, the "use-soft-float" attribute is upgraded to the "+soft-float" feature, so we can do that ourselves when creating the target machine.

(at the point where we add the attributes to the function, we have no access to whether our TargetMachine was created with FloatABI:SoftFP or not)
This commit is contained in:
Johan Engelen 2016-10-28 17:12:40 +09:00
parent 04f91f208e
commit ed3afed77a
4 changed files with 19 additions and 12 deletions

View file

@ -451,17 +451,6 @@ void applyTargetMachineAttributes(llvm::Function &func,
func.addFnAttr("no-nans-fp-math", TO.NoNaNsFPMath ? "true" : "false");
#if LDC_LLVM_VER < 307
func.addFnAttr("use-soft-float", TO.UseSoftFloat ? "true" : "false");
#else
switch (TO.FloatABIType) {
case llvm::FloatABI::Default:
break;
case llvm::FloatABI::Soft:
func.addFnAttr("use-soft-float", "true");
break;
case llvm::FloatABI::Hard:
func.addFnAttr("use-soft-float", "false");
break;
}
#endif
// Frame pointer elimination