libiberty: d-demangle: use distinguishable tuple()

Message ID 20211013153459.160132-1-contact@lsferreira.net
State New
Headers show
Series
  • libiberty: d-demangle: use distinguishable tuple()
Related show

Commit Message

Luís Ferreira Oct. 13, 2021, 3:34 p.m.
Since Tuple!() is templated type from standard library, this can make two
demangled names undistinguishable.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>


libiberty/ChangeLog:

	* d-demangle.c (dlang_parse_tuple): use tuple() instead of Tuple!()
---
 libiberty/d-demangle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.33.0

Comments

Luís Ferreira Oct. 13, 2021, 3:42 p.m. | #1
On Wed, 2021-10-13 at 16:34 +0100, Luís Ferreira wrote:
> Since Tuple!() is templated type from standard library, this can make

> two

> demangled names undistinguishable.

> 

> Signed-off-by: Luís Ferreira <contact@lsferreira.net>

> 

> libiberty/ChangeLog:

> 

>         * d-demangle.c (dlang_parse_tuple): use tuple() instead of

> Tuple!()

> ---

>  libiberty/d-demangle.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c

> index 880f2ec85a4..5dbdc36adbe 100644

> --- a/libiberty/d-demangle.c

> +++ b/libiberty/d-demangle.c

> @@ -1711,7 +1711,7 @@ dlang_parse_tuple (string *decl, const char

> *mangled, struct dlang_info *info)

>    if (mangled == NULL)

>      return NULL;

>  

> -  string_append (decl, "Tuple!(");

> +  string_append (decl, "tuple(");

>  

>    while (elements--)

>      {


I need to update tests

-- 
Sincerely,
Luís Ferreira @ lsferreira.net
Luís Ferreira Oct. 13, 2021, 4:05 p.m. | #2
On Wed, 2021-10-13 at 16:42 +0100, Luís Ferreira wrote:
> On Wed, 2021-10-13 at 16:34 +0100, Luís Ferreira wrote:

> > Since Tuple!() is templated type from standard library, this can

> > make

> > two

> > demangled names undistinguishable.

> > 

> > Signed-off-by: Luís Ferreira <contact@lsferreira.net>

> > 

> > libiberty/ChangeLog:

> > 

> >         * d-demangle.c (dlang_parse_tuple): use tuple() instead of

> > Tuple!()

> > ---

> >  libiberty/d-demangle.c | 2 +-

> >  1 file changed, 1 insertion(+), 1 deletion(-)

> > 

> > diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c

> > index 880f2ec85a4..5dbdc36adbe 100644

> > --- a/libiberty/d-demangle.c

> > +++ b/libiberty/d-demangle.c

> > @@ -1711,7 +1711,7 @@ dlang_parse_tuple (string *decl, const char

> > *mangled, struct dlang_info *info)

> >    if (mangled == NULL)

> >      return NULL;

> >  

> > -  string_append (decl, "Tuple!(");

> > +  string_append (decl, "tuple(");

> >  

> >    while (elements--)

> >      {

> 

> I need to update tests

> 


Updated on PATCH v2.

-- 
Sincerely,
Luís Ferreira @ lsferreira.net

Patch

diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c
index 880f2ec85a4..5dbdc36adbe 100644
--- a/libiberty/d-demangle.c
+++ b/libiberty/d-demangle.c
@@ -1711,7 +1711,7 @@  dlang_parse_tuple (string *decl, const char *mangled, struct dlang_info *info)
   if (mangled == NULL)
     return NULL;
 
-  string_append (decl, "Tuple!(");
+  string_append (decl, "tuple(");
 
   while (elements--)
     {