Add support for DW_AT_calling_convention attribute for C++ types (http://www.dwarfstd.org/ShowIssue.php?issue=141215.1). As recommended in DWARF issue this attribute uses DW_FORM_implicit_const to allow the producer to represent this attributes as compactly as possible. Code adds new field to DICompositeType class to encode calling convention, field is named ArgABI to match clang code naming. DW_CC_normal value is not emitted to DWARF output as absence of attribute is similar to its presence with DW_CC_normal.
why does this attribute require a 'replace' API - generally all the values (including things like size/alignment) are provided up-front when the type is built, and do not require replacing/updating after that, if I recall/understand correctly.
Thanks for working on this!
- There also needs to be a bitcode upgrade test (using a .bc file generated by current LLVM trunk)
- There also needs to be an IR llvm-as | llvm-dis | llvm-as | ... roundtrip test
- This needs to be added to the metadata unit tests.
Please document the new argument.
Maybe call this CallingConvention?
Since there are only 2 bits necessary to encode the CC, we should just use some bits in Record for this and save some space.
See my comment in MetadataLoader.cpp
Technically true, but I think there is no harm in emitting this attribute also in DWARF 4 or earlier. We usually only do this if the new attribute cannot be safely ignored by an older consumer.
Actually DW_FORM_implicit_const is new in DWARF 5, and new FORMs cannot be used in prior-version DIEs. So, either we have to guard the entire attribute, or we have to conditionalize the FORM.