public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Raillard <douglas.raillard@arm.com>
To: acme@redhat.com
Cc: dwarves@vger.kernel.org
Subject: Re: [PATCH v1 0/2] Anonymous inner struct
Date: Tue, 16 Nov 2021 14:09:44 +0000	[thread overview]
Message-ID: <5bf579b2-aafc-2ce2-7c84-e06eb2b4d78c@arm.com> (raw)
In-Reply-To: <20211019100724.325570-1-douglas.raillard@arm.com>

Hi Arnaldo,

Any opinion on this series ?

Cheers,
Douglas

On 10/19/21 11:07 AM, Douglas RAILLARD wrote:
> From: Douglas Raillard <douglas.raillard@arm.com>
> 
> Add an --inner_anonymous pahole CLI option to make inner
> struct/enum/union anonymous. This allows turning this:
> 
>      struct foo { ... };
>      struct bar {
>          struct foo {
>           ....
>          } a;
>      };
>      
> into this:
> 
>      struct foo { ... };
>      struct bar {
>          struct /* foo */ {
>           ....
>          } a;
>      };
> 
> This avoids any conflict between the two definitions of struct foo. The
> case arises when dumping multiple types at once with -E, all depending
> on a same inner struct:
> 
>      struct bar {
>          struct foo {
>           ....
>          } a;
>      };
>      struct bar2 {
>          struct foo {
>           ....
>          } b;
>      };
> 
> 
> On top of that, struct foo could already be defined in a public header
> already imported in the compilation unit, leading to a redefinition
> error, while another nested struct is private and would still need -E
> for the type to be usable.
> 
> Douglas Raillard (2):
>    fprintf: Allow making struct/enum/union anonymous
>    pahole.c: Add --inner_anonymous option
> 
>   dwarves.h         |  4 +++-
>   dwarves_emit.c    |  2 +-
>   dwarves_fprintf.c | 52 ++++++++++++++++++++++++++++++-----------------
>   pahole.c          |  8 ++++++++
>   4 files changed, 45 insertions(+), 21 deletions(-)
> 


  parent reply	other threads:[~2021-11-16 14:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 10:07 [PATCH v1 0/2] Anonymous inner struct Douglas RAILLARD
2021-10-19 10:07 ` [PATCH v1 1/2] fprintf: Allow making struct/enum/union anonymous Douglas RAILLARD
2021-11-26 18:27   ` Arnaldo Carvalho de Melo
2021-11-30 16:42     ` Douglas Raillard
2021-11-30 18:49       ` Arnaldo Carvalho de Melo
2021-12-01 10:56         ` Douglas Raillard
2021-12-01 12:01           ` Arnaldo Carvalho de Melo
2021-12-06 10:28             ` Douglas Raillard
2021-12-06 20:32               ` Arnaldo Carvalho de Melo
2021-10-19 10:07 ` [PATCH v1 2/2] pahole.c: Add --inner_anonymous option Douglas RAILLARD
2021-11-16 14:09 ` Douglas Raillard [this message]
2021-11-23  0:36   ` [PATCH v1 0/2] Anonymous inner struct Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5bf579b2-aafc-2ce2-7c84-e06eb2b4d78c@arm.com \
    --to=douglas.raillard@arm.com \
    --cc=acme@redhat.com \
    --cc=dwarves@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox