[Lldb-commits] [PATCH] D145803: [clang][DebugInfo] Emit DW_AT_type of preferred name if available
David Blaikie via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 27 16:30:42 PDT 2023
dblaikie added inline comments.
================
Comment at: clang/test/CodeGen/preferred_name.cpp:49
+
+ Foo<Foo<int>> varFooInt;
+
----------------
Michael137 wrote:
> dblaikie wrote:
> > Michael137 wrote:
> > > probinson wrote:
> > > > This doesn't become `Foo<BarInt>` ?
> > > The name stays as `Foo<Foo<int>>` but the type of the template parameter becomes `BarInt`. So the dwarf would look like:
> > > ```
> > > DW_TAG_structure_type
> > > DW_AT_name ("Foo<Foo<int> >")
> > >
> > > DW_TAG_template_type_parameter
> > > DW_AT_type (0x00000095 "BarInt")
> > > DW_AT_name ("T")
> > >
> > > ```
> > > Will add the parameter metadata to the test
> > Hmm, that seems buggy - why doesn't `Foo<Foo<int> >` become `Foo<BarInt>`? (is the preferred name ever used in the DW_AT_name? I'd have thought it should be unless it's explicitly avoided to ensure type compatibility/collapsing with debug info built without this feature enabled?)
> I suspect it's because the name is constructed using the clang TypePrinter. And we turn off `PrintingPolicy::UsePreferredNames` by default to avoid divergence from GCC.
>
> Will double check though
Yeah, that sounds right/OK to me. Sorry for the diversion.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145803/new/
https://reviews.llvm.org/D145803
More information about the lldb-commits
mailing list