[llvm-dev] DWARFv5 alignment attribute
Victor Leschuk via llvm-dev
llvm-dev at lists.llvm.org
Thu Sep 8 01:07:53 PDT 2016
Hello all, I am currently implementing support for DWARFv5
DW_AT_alignment attribute
(http://www.dwarfstd.org/ShowIssue.php?issue=140528.1). I am not 100%
sure which entities we should mark with this attr.
Consider the following C11 code (sample from
http://en.cppreference.com/w/c/language/_Alignas):
// every object of type struct data will be aligned to 128-byte boundary
struct data {
char x;
_Alignas(128) char cacheline[128]; // over-aligned array of char,
// not array of over-aligned chars
};
int main(void)
{
_Alignas(2048) struct data d; // this instance of data is aligned even
stricter
return 0;
}
What should be marked as DW_AT_alignment? The link above says that the
attribute can be applied to:
DW_TAG_array_type, DW_TAG_atomic_type, DW_TAG_base_type,
DW_TAG_class_type, DW_TAG_coarray_type, DW_TAG_const_type,
DW_TAG_dynamic_type, DW_TAG_enumeration_type, DW_TAG_file_type,
DW_TAG_interface_type, DW_TAG_packed_type, DW_TAG_pointer_type,
DW_TAG_pointer_to_member_type, DW_TAG_reference_type,
DW_TAG_restrict_type, DW_TAG_rvalue_reference_type, DW_TAG_set_type,
DW_TAG_shared_type, DW_TAG_string_type, DW_TAG_structure_type,
DW_TAG_subprogram, DW_TAG_subrange_type, DW_TAG_subroutine_type,
DW_TAG_thrown_type, DW_TAG_typedef, DW_TAG_union_type, DW_TAG_variable
Here we have
* DW_TAG_array_type
* DW_TAG_subrange_type
* DW_TAG_member
* DW_TAG_structure_type
* DW_TAG_basic_type
* DW_TAG_variable
Currently I mark only variable "d" as aligned, however I am not sure,
that this is correct? Which of the listed should contain this attribute?
What do you think?
--
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160908/78b528bd/attachment.html>
More information about the llvm-dev
mailing list