[libcxx-commits] [libcxxabi] [llvm] [ItaniumDemangle] Set `InConstraintExpr` to `true` when demangling a c… (PR #107385)

Ilya Biryukov via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 10 04:52:31 PDT 2024


================
@@ -0,0 +1,3 @@
+RUN: llvm-cxxfilt -n _ZN3FooIiE6methodITk4TrueIT_EiEEvS3_ | FileCheck %s
+
+CHECK: void Foo<int>::method<int>(T)
----------------
ilya-biryukov wrote:

> I  don't think we ever print out generic template parameter names

I think @VitaNuo showed me an example where we do already print those names (in constraints, not in lambda parameters). Hence, this workaround made sense until the proper fix lands.
@VitaNuo do you have those examples?

> Maybe just avoiding clearing the level if we're parsing a Tk is enough? 

It's probably more complicated than this. Apart from `Tk`, we should also handle constraints (`Q` IIRC). And the actual parameters we track do need to be reset at certain points when the new "top-level" name is being parsed. To put it another way, the parameter numbering is not "global" to the mangled name, instead the same numbering can mean different types at different points of the mangled name and we are not sure what are the points at which the template numbering should be reset or backtracked. @VitaNuo is in the process of figuring that out.

Also wanted to share https://gcc.godbolt.org/z/dqT877q6K and https://gcc.godbolt.org/z/bcfWqGdGz that we came up with yesterday that use `TL<n>` numbering referencing different types at different points in the mangled name.

PS Maybe the solution you have in mind already covers that, but I wasn't sure, so wanted to bring this up.

https://github.com/llvm/llvm-project/pull/107385


More information about the libcxx-commits mailing list