https://bugs.llvm.org/show_bug.cgi?id=35293
Bug ID: 35293
Summary: Implement 'scalar_storage_order' attribute
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: anatol.pomo...@gmail.com
CC: llvm-bugs@lists.llvm.org
It is a follow-up for this maillist thread
http://lists.llvm.org/pipermail/cfe-dev/2017-November/055934.html
There are some protocols (PCI, network, ...) that specify endianness used. To
make the code portable developers need to use some kind of byte swapping
function (such as __builtin_bswapXX) every time accessing the data. Handling it
manually is error-prone. It would be much more convenient to have an attribute
that specifies the field/struct endianness and lets compiler to do byte
swapping when needed.
GCC 6 added attribute called 'scalar_storage_order' that does this (see
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Common-Type-Attributes.html#Common-Type-Attributes).
It would be great if Clang supported this attribute.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs