Set target_cpu and target_features attributes on cfi_check_fail and
cfi_check. Make cfi_check use Thumb encoding on ARM target.
I don't think we should be force setting thumb anywhere, it should be handled on a function by function basis the way we do all of the target attribute stuff.
All of this should be handled in lib/Basic/Targets/ARM.cpp ARMTargetInfo::initFeatureMap ?
This is odd. Can you explain this a bit more?
We want this function to be Thumb even if the rest of the module is ARM. It lets us use 2x less memory in the implementation of __cfi_slowpath here:
This function does not have source, so it can not have target attributes, too.
Are you suggesting faking a piece of AST (FunctionDecl with attached attributes) and then using the regular attribute setting code?
__cfi_check is called from compiler-rt or libdl.so, so it can not have any fancy calling convention. It must use what's standard on the platform.
OK, __cfi_check has no floating-point parameters, so -mhard-float would not be a problem.
Aha. Didn't remember that part of the design.
And yeah, that sounds good. And it doesn't really matter if the function has any source code as to whether or not it has attributes. There's no inheritance structure going on here so every function should have them.
Yeah, I think this falls in on the earlier comment. Should probably add the defaults to a bit of AST or something?