[PATCH] D48100: Append new attributes to the end of an AttributeList.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 25 14:53:19 PDT 2018


erichkeane added a comment.

In https://reviews.llvm.org/D48100#1142842, @rsmith wrote:

> This patch appears to have at least caused us to process attributes too many times in some cases. For example:
>
>   __attribute__((noreturn,noinline,unused)) void f();
>
>
> before your patch gives this with `clang -Xclang -ast-dump`:
>
>   `-FunctionDecl 0xccef1e0 <<stdin>:1:1, col:50> col:48 f 'void () __attribute__((noreturn))'
>     |-UnusedAttr 0xccef280 <col:34> unused
>     `-NoInlineAttr 0xccef2c8 <col:25>
>
>
> and after your patch gives this:
>
>   `-FunctionDecl 0xb913740 <<stdin>:1:1, col:50> col:48 f 'void () __attribute__((noreturn))'
>     |-NoInlineAttr 0xb9137e0 <col:25>
>     |-UnusedAttr 0xb913828 <col:34> unused
>     |-NoInlineAttr 0xb913838 <col:25>
>     `-UnusedAttr 0xb913848 <col:34> unused
>


Yep, this is a symptom of the bug I was discussing earlier.  This isn't a problem with this patch per-se, but it exposes it by having certain attributes (of which calling conventions, abis, and noreturn are some) cause some linked-list rewriting.  I'm currently attempting to remove the AttributeList's linked-listness.


Repository:
  rC Clang

https://reviews.llvm.org/D48100





More information about the cfe-commits mailing list