================ @@ -311,11 +311,15 @@ ARMBaseTargetMachine::getSubtargetImpl(const Function &F) const { // function that reside in TargetOptions. resetTargetOptions(F); I = std::make_unique<ARMSubtarget>(TargetTriple, CPU, FS, *this, isLittle, - F.hasMinSize()); + F.hasMinSize()); if (!I->isThumb() && !I->hasARMOps()) F.getContext().emitError("Function '" + F.getName() + "' uses ARM " "instructions, but the target does not support ARM mode execution."); + + if (I->isTargetHardFloat() && !I->hasFPRegs()) + F.getContext().emitError("The hard-float ABI is enabled, but the target " + "lacks floating-point registers."); ---------------- chrisnc wrote:
Ah, I remember now where I got stuck on this before. I need to obtain this property on the `ARMSubtarget` rather than the `ARMBaseTargetMachine`, but neither of them expose `Options` publicly, and `ARMSubtarget` just invokes `isTargetHardFloat` on its `TM` member, without accounting for its own `Options`, even though they are copied from the `ARMBaseTargetMachine` when the subtarget is created. https://github.com/llvm/llvm-project/pull/111334 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits