[PATCH] D34875: ARM: Report error for invalid use of AAPCS_VFP calling convention

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 06:08:35 PDT 2017


fhahn added a comment.

In https://reviews.llvm.org/D34875#796985, @t.p.northover wrote:

> > I think that they do, because report_fatal_error() causes compilation to terminate so the subsequent tests don't generate a message which can be checked.
>
> Ah yes. And that's also a really big indicator for why this should be handled in Clang. All you know from this is that at least one function, somewhere in your file (or codebase if doing LTO) has an aapcs_vfp attribute.
>
> I get that silently doing SoftFP isn't great either so I'm not completely opposed to this change, I just think it's a pretty half-baked solution to the actual user-facing problem.


I think TargetInfo in Clang has a `checkCallingConvention` function, which is implemented by ARMTargetInfo. A user facing error message should probably go there. We have access to the triple there, so we should be able to error on cases where the selected architecture only has soft floats. I am not sure if we have access to target-features  there though, so we probably won't be able to handle all cases there.

We probably still need a warning/error in LLVM to cover the LTO case, e.g. when linking modules compiled to use the hardfp ABI into a target module with softfp only. IMO we should report that case, but ideally using LLVMContext::emitError  as Diana suggested.

https://reviews.llvm.org/D35826 and https://reviews.llvm.org/D35569 are related changes, adding an error message to Clang when -marm is selected for Thumb-only architectures and arguing for an error message when ARM codegen is requested for a Thumb-only architecture in LLVM. Whatever we decide, I think both cases should be handled consistently.


https://reviews.llvm.org/D34875





More information about the llvm-commits mailing list