Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size based on module flags metadata.
Details
Diff Detail
Event Timeline
include/llvm/Support/ARMBuildAttributes.h | ||
---|---|---|
163 | you're never using, nor testing this... | |
175 | you're never using, nor testing this... | |
180 | you're never using, nor testing this... | |
test/CodeGen/ARM/metadata-default.ll | ||
14 | shouldn't this value be the actual number of bytes used? so than you can forbid usage from the front-end later. | |
15 | I think this one could be a bit more expressive, such as using a string, so that we can disable or use the fourth style, which is currently inaccessible. |
Some minor nits, but LGTM. Thanks for adding support for this EABI attribute.
include/llvm/Support/ARMBuildAttributes.h | ||
---|---|---|
162 | Can you add the uleb128 encoding and type similar to the other enums please? | |
174 | Same here. | |
lib/Target/ARM/ARMAsmPrinter.cpp | ||
736 | You should be able to collapse the cast and if into a single statement. I think you can use auto here without loss of clarity: if (auto WCharType = cast_or_null<ConstantInt>(SM->getModuleFlag("short_wchar")) | |
746 | Similarly here. | |
test/CodeGen/ARM/metadata-default.ll | ||
5 | The Module ID doesnt add much to the test. You can trim the test to just the RUN line, the define, and metadata. |
you're never using, nor testing this... x3
I was following the example of the other build attributes (e.g. the position independent code ones), including all values specified in the ABI addenda, even if we do not use them.
Changes corresponding to matching change in D4212 (store sizes of wchar_t and enums in metadata, not just boolean flags)
Hi Oliver,
I'm happy with this patch, but we need to make sure we don't create those attributes on other architectures in D4212.
We can overlook the non use of the extra options (as you said, following current implementation), but as it stands, it's not just unused, but impossible to use from a language point of view. That's why I proposed a textual format (for the ABI type), but this can be done later. Please add a FIXME to that regard.
cheers,
--renato
Can you add the uleb128 encoding and type similar to the other enums please?