Michael137 marked an inline comment as not done.
Michael137 added inline comments.


================
Comment at: clang/test/CodeGen/preferred_name.cpp:49
+
+    Foo<Foo<int>> varFooInt;
+
----------------
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


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145803/new/

https://reviews.llvm.org/D145803

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to