[PATCH] PR18757: Copy attributes to static extern "C" aliases

Mark Mentovai mark at chromium.org
Thu Feb 6 15:17:54 PST 2014


LLVM r183756 changed how GlobalOpt handled aliases, exposing a latent bug
in clang that caused attributes, such as __attribute__((section())) to not
be honored in emitted code with this optimization. This optimization in
question replaces an alias target with its sole alias, taking the name,
linkage, and attributes of the alias. clang creates aliases for certain
extern "C" values, setting the linkage of the alias correctly, but ignoring
the attributes. This patch gives the aliases of such extern "C" values the
same attributes as their targets, so that when GlobalOpt is performed, the
correct attributes are used.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140206/30ea0941/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_18757.1.patch
Type: application/octet-stream
Size: 1373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140206/30ea0941/attachment.obj>


More information about the cfe-commits mailing list