[llvm-bugs] [Bug 35293] New: Implement 'scalar_storage_order' attribute
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Nov 13 16:29:42 PST 2017
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: unassignedclangbugs at nondot.org
Reporter: anatol.pomozov at gmail.com
CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171114/5c3ece86/attachment.html>
More information about the llvm-bugs
mailing list