]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Update libiberty demangler
authorMark Wielaard <mark@klomp.org>
Sat, 18 Oct 2025 00:36:25 +0000 (02:36 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 18 Oct 2025 00:43:04 +0000 (02:43 +0200)
Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit 7921bb4afcb7a3be8e10e63b10acfc2bfa477cae.

This update includes:

- Support for unnamed unscoped enums.
- Fix whaever -> whatever, comment typo.
- Update copyright years.

12 files changed:
auxprogs/update-demangler
coregrind/m_demangle/ansidecl.h
coregrind/m_demangle/cp-demangle.c
coregrind/m_demangle/cp-demangle.h
coregrind/m_demangle/cplus-dem.c
coregrind/m_demangle/d-demangle.c
coregrind/m_demangle/demangle.h
coregrind/m_demangle/dyn-string.c
coregrind/m_demangle/dyn-string.h
coregrind/m_demangle/rust-demangle.c
coregrind/m_demangle/safe-ctype.c
coregrind/m_demangle/safe-ctype.h

index 39682397598afb1be025eedf366d5e38c4b6eb4a..3ac0c04ea0105d5ae02451795e16c9fa64e52ab1 100755 (executable)
@@ -17,8 +17,8 @@ set -e
 #---------------------------------------------------------------------
 
 # You need to modify these revision numbers for your update.
-old_gcc_revision=ca2f7c84927f85b95f0f48f82b93f1460c372db4 # the revision of the previous update
-new_gcc_revision=94bea5dd6c9a06ddb6244be1e5196ff5fbe2b186 # the revision for this update
+old_gcc_revision=94bea5dd6c9a06ddb6244be1e5196ff5fbe2b186 # the revision of the previous update
+new_gcc_revision=7921bb4afcb7a3be8e10e63b10acfc2bfa477cae # the revision for this update
 
 # Unless the organization of demangler related files has changed, no
 # changes below this line should be necessary.
index 323ff8be3278b55d22d1f6587d398fb2e54366ef..534b05251d46b5d345bbc665a2bd324f8c946650 100644 (file)
@@ -1,5 +1,5 @@
 /* Compiler compatibility macros
-   Copyright (C) 1991-2024 Free Software Foundation, Inc.
+   Copyright (C) 1991-2025 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 This program is free software; you can redistribute it and/or modify
index adec005b41c4e46ac26d59821dbf43d143f33dc8..3bf5a372efce138061ffd9841313885ca96d44f5 100644 (file)
@@ -1,5 +1,5 @@
 /* Demangler for g++ V3 ABI.
-   Copyright (C) 2003-2024 Free Software Foundation, Inc.
+   Copyright (C) 2003-2025 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@wasabisystems.com>.
 
    This file is part of the libiberty library, which is part of GCC.
@@ -516,6 +516,8 @@ static struct demangle_component *d_lambda (struct d_info *);
 
 static struct demangle_component *d_unnamed_type (struct d_info *);
 
+static struct demangle_component *d_unnamed_enum (struct d_info *);
+
 static struct demangle_component *
 d_clone_suffix (struct d_info *, struct demangle_component *);
 
@@ -1441,7 +1443,7 @@ d_encoding (struct d_info *di, int top_level)
 
              /* If this is a non-top-level local-name, clear the
                 return type, so it doesn't confuse the user by
-                being confused with the return type of whaever
+                being confused with the return type of whatever
                 this is nested within.  */
              if (!top_level && dc->type == DEMANGLE_COMPONENT_LOCAL_NAME
                  && ftype->type == DEMANGLE_COMPONENT_FUNCTION_TYPE)
@@ -1816,6 +1818,9 @@ d_unqualified_name (struct d_info *di, struct demangle_component *scope,
     {
       switch (d_peek_next_char (di))
        {
+       case 'e':
+         ret = d_unnamed_enum (di);
+         break;
        case 'l':
          ret = d_lambda (di);
          break;
@@ -2745,13 +2750,20 @@ cplus_demangle_type (struct d_info *di)
       break;
 
     case 'U':
-      d_advance (di, 1);
-      ret = d_source_name (di);
-      if (d_peek_char (di) == 'I')
-       ret = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, ret,
-                          d_template_args (di));
-      ret = d_make_comp (di, DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL,
-                        cplus_demangle_type (di), ret);
+      peek = d_peek_next_char (di);
+      if (IS_DIGIT (peek))
+       {
+         d_advance (di, 1);
+         ret = d_source_name (di);
+         if (d_peek_char (di) == 'I')
+           ret = d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, ret,
+                              d_template_args (di));
+         ret = d_make_comp (di, DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL,
+                            cplus_demangle_type (di), ret);
+       }
+      else
+       /* Could be a closure type or an unnamed enum.  */
+       ret = d_unqualified_name (di, NULL, NULL);
       break;
 
     case 'D':
@@ -4107,6 +4119,33 @@ d_unnamed_type (struct d_info *di)
   return ret;
 }
 
+/* <unnamed-enum-name> ::= Ue <underlying type> <enumerator source-name> */
+
+static struct demangle_component *
+d_unnamed_enum (struct d_info *di)
+{
+  if (! d_check_char (di, 'U'))
+    return NULL;
+  if (! d_check_char (di, 'e'))
+    return NULL;
+
+  struct demangle_component *underlying = cplus_demangle_type (di);
+  struct demangle_component *name = d_source_name (di);
+
+  struct demangle_component *ret = d_make_empty (di);
+  if (ret)
+    {
+      ret->type = DEMANGLE_COMPONENT_UNNAMED_ENUM;
+      d_left (ret) = underlying;
+      d_right (ret) = name;
+    }
+
+  if (! d_add_substitution (di, ret))
+    return NULL;
+
+  return ret;
+}
+
 /* <clone-suffix> ::= [ . <clone-type-identifier> ] [ . <nonnegative number> ]*
 */
 
@@ -4413,6 +4452,7 @@ d_count_templates_scopes (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_CHARACTER:
     case DEMANGLE_COMPONENT_NUMBER:
     case DEMANGLE_COMPONENT_UNNAMED_TYPE:
+    case DEMANGLE_COMPONENT_UNNAMED_ENUM:
     case DEMANGLE_COMPONENT_STRUCTURED_BINDING:
     case DEMANGLE_COMPONENT_MODULE_NAME:
     case DEMANGLE_COMPONENT_MODULE_PARTITION:
@@ -4813,6 +4853,7 @@ d_find_pack (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_CHARACTER:
     case DEMANGLE_COMPONENT_FUNCTION_PARAM:
     case DEMANGLE_COMPONENT_UNNAMED_TYPE:
+    case DEMANGLE_COMPONENT_UNNAMED_ENUM:
     case DEMANGLE_COMPONENT_DEFAULT_ARG:
     case DEMANGLE_COMPONENT_NUMBER:
       return NULL;
@@ -6291,6 +6332,14 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
       d_append_char (dpi, '}');
       return;
 
+    case DEMANGLE_COMPONENT_UNNAMED_ENUM:
+      d_append_string (dpi, "{enum:");
+      d_print_comp (dpi, options, d_left (dc));
+      d_append_string (dpi, "{");
+      d_print_comp (dpi, options, d_right (dc));
+      d_append_string (dpi, "}}");
+      return;
+
     case DEMANGLE_COMPONENT_CLONE:
       d_print_comp (dpi, options, d_left (dc));
       d_append_string (dpi, " [clone ");
index cc5bab0ca34709702e1f8b5603d5a9003e9fc2cf..9b33a2f84c1c08dba1330dfdbed7d5764087095c 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal demangler interface for g++ V3 ABI.
-   Copyright (C) 2003-2024 Free Software Foundation, Inc.
+   Copyright (C) 2003-2025 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@wasabisystems.com>.
 
    This file is part of the libiberty library, which is part of GCC.
index cbe69736156702edd38d810f99a32c549a4c3a91..9d173c03db676c82dab05ef3b8a2cde4bdb6af6f 100644 (file)
@@ -1,5 +1,5 @@
 /* Demangler for GNU C++
-   Copyright (C) 1989-2024 Free Software Foundation, Inc.
+   Copyright (C) 1989-2025 Free Software Foundation, Inc.
    Written by James Clark (jjc@jclark.uucp)
    Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
    Modified by Satish Pai (pai@apollo.hp.com) for HP demangling
index 9a6a893324f7cf61f4fea50d87953562ab92a925..2f44211eb7ef4869cf70eb108010fb8443d8df2a 100644 (file)
@@ -1,5 +1,5 @@
 /* Demangler for the D programming language
-   Copyright (C) 2014-2024 Free Software Foundation, Inc.
+   Copyright (C) 2014-2025 Free Software Foundation, Inc.
    Written by Iain Buclaw (ibuclaw@gdcproject.org)
 
 This file is part of the libiberty library.
index 70cd90bfaa3daea6c09a6b89a23943137b18a10c..010c103d0be43cccce7051358768c052de5c02f9 100644 (file)
@@ -1,5 +1,5 @@
 /* Defs for interface to demanglers.
-   Copyright (C) 1992-2024 Free Software Foundation, Inc.
+   Copyright (C) 1992-2025 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License
@@ -437,6 +437,8 @@ enum demangle_component_type
   DEMANGLE_COMPONENT_DEFAULT_ARG,
   /* An unnamed type.  */
   DEMANGLE_COMPONENT_UNNAMED_TYPE,
+  /* An unnamed enum.  */
+  DEMANGLE_COMPONENT_UNNAMED_ENUM,
   /* A transactional clone.  This has one subtree, the encoding for
      which it is providing alternative linkage.  */
   DEMANGLE_COMPONENT_TRANSACTION_CLONE,
index af9d41ea123d703db7c298cb872473ca064a7cbd..38ad5eb5ff3fcedde09ecfa87c375b0d2e45c3ca 100644 (file)
@@ -1,5 +1,5 @@
 /* An abstract string datatype.
-   Copyright (C) 1998-2024 Free Software Foundation, Inc.
+   Copyright (C) 1998-2025 Free Software Foundation, Inc.
    Contributed by Mark Mitchell (mark@markmitchell.com).
 
 This file is part of GNU CC.
index 76e23e0c364de84fb660ca40e91fac0988a1e1d2..7e07a4d9267fe4d02c6fb2874526ae7d15db16e8 100644 (file)
@@ -1,5 +1,5 @@
 /* An abstract string datatype.
-   Copyright (C) 1998-2024 Free Software Foundation, Inc.
+   Copyright (C) 1998-2025 Free Software Foundation, Inc.
    Contributed by Mark Mitchell (mark@markmitchell.com).
 
 This file is part of GCC.
index 4024813c20b1b356e8f1f852d55128305eb83cfc..70f13d7c4d0f23fea3e104e71698f06f905d94d9 100644 (file)
@@ -1,5 +1,5 @@
 /* Demangler for the Rust programming language
-   Copyright (C) 2016-2024 Free Software Foundation, Inc.
+   Copyright (C) 2016-2025 Free Software Foundation, Inc.
    Written by David Tolnay (dtolnay@gmail.com).
    Rewritten by Eduard-Mihai Burtescu (eddyb@lyken.rs) for v0 support.
 
index 32654ef1e2efa30c243bdd31a3f106eb1a53cdf2..95c41cd68f01ce712ce1a13be715b9f16ebc08de 100644 (file)
@@ -1,6 +1,6 @@
 /* <ctype.h> replacement macros.
 
-   Copyright (C) 2000-2024 Free Software Foundation, Inc.
+   Copyright (C) 2000-2025 Free Software Foundation, Inc.
    Contributed by Zack Weinberg <zackw@stanford.edu>.
 
 This file is part of the libiberty library.
index d3e5214d5818f122f6db932384c3d1bde706eb71..c0f8042281eb85bec394b39dbcd3c163371f01bd 100644 (file)
@@ -1,6 +1,6 @@
 /* <ctype.h> replacement macros.
 
-   Copyright (C) 2000-2024 Free Software Foundation, Inc.
+   Copyright (C) 2000-2025 Free Software Foundation, Inc.
    Contributed by Zack Weinberg <zackw@stanford.edu>.
 
 This file is part of the libiberty library.