[PATCH] D36993: [llvm-dwarfdump] Print type names in DW_AT_type DIEs

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 14:03:01 PDT 2017


On Tue, Aug 29, 2017 at 1:54 PM Jonas Devlieghere via Phabricator <
reviews at reviews.llvm.org> wrote:

> JDevlieghere added a comment.
>
> In https://reviews.llvm.org/D36993#855777, @dblaikie wrote:
>
> > In https://reviews.llvm.org/D36993#855144, @JDevlieghere wrote:
> >
> > > In https://reviews.llvm.org/D36993#854984, @dblaikie wrote:
> > >
> > > > Where's the 'const' being printed from (couldn't spot it from a
> quick glance at the code) for the test cases like "const Struct"?
> > >
> > >
> > > The function `dumpTypeTagName` extracts the 'type name' from a tag.
> For the example the function dumps `DW_TAG_const_type` as `const`.
> >
> >
> > That seems a bit subtle - does that codepath trigger/do things for other
> tag types, or just const? Especially if it's just const, I'd probably
> handle const where reference, array, pointer, etc, are handled. Seems
> clearer.
>
>
> It works for all tag types, but some (such as pointers and references) are
> handled explicitly in the switch because we don't want to print their "type
> name" but rather a `*` or `&`. I totally agree that it's a little subtle.
> However originally every tag had a corresponding switch case but this was
> really verbose and not very maintainable. Personally I feel it's worth the
> trade-off, but I'd definitely be open to a different alternative!
>

Which other tag types go through this path, though?

struct and class don't get "struct" or "class", so I guess they don't go
through it?

Volatile presumably goes through it (const/volatile being very similar)?

Anything else, though? Wondering how big/what was in this switch that was
there before.


>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D36993
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170829/f42d226f/attachment.html>


More information about the llvm-commits mailing list