Set target_cpu and target_features attributes on cfi_check_fail and
cfi_check. Make cfi_check use Thumb encoding on ARM target.
Details
Diff Detail
- Build Status
Buildable 10581 Build 10581: arc lint + arc unit
Event Timeline
clang/lib/CodeGen/CGExpr.cpp | ||
---|---|---|
2917 | 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. | |
2926–2935 | All of this should be handled in lib/Basic/Targets/ARM.cpp ARMTargetInfo::initFeatureMap ? | |
2934–2936 | This is odd. Can you explain this a bit more? |
clang/lib/CodeGen/CGExpr.cpp | ||
---|---|---|
2917 | 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? | |
2934–2936 | __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. |
clang/lib/CodeGen/CGExpr.cpp | ||
---|---|---|
2917 | 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. | |
2934–2936 | Yeah, I think this falls in on the earlier comment. Should probably add the defaults to a bit of AST or something? |
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.