Merge upstream GCC changes for include/ and libiberty/ directories

Message ID 20200219191821.5007-1-andrew.burgess@embecosm.com
State New
Headers show
Series
  • Merge upstream GCC changes for include/ and libiberty/ directories
Related show

Commit Message

Andrew Burgess Feb. 19, 2020, 7:18 p.m.
This commit pulls in the latest changes for the include/ and
libiberty/ directories.  The last sync was in commit
533da48302a26885a972e4379eccc26b364e5b53.

This commit also removes the file libiberty/rust-demangle.h, this file
has been removed in upstream GCC, and should have been deleted as part
of the previous sync up, which included this ChangeLog entry:

  2019-11-16  Eduard-Mihai Burtescu  <eddyb@lyken.rs>

        ....
	* rust-demangle.h: Remove.

I've grep'd over the binutils-gdb source and can find no reference to
the rust-demangle.h file, and everything seems to build fine without
it, so I assume its continued existence was a mistake.

include/ChangeLog:

	Import from gcc mainline:
	2020-02-05  Andrew Burgess  <andrew.burgess@embecosm.com>

        * hashtab.h (htab_remove_elt): Make a parameter const.
        (htab_remove_elt_with_hash): Likewise.

libiberty/ChangeLog:

	* rust-demangle.h: Removed.

	Import from gcc mainline:
	2020-02-05  Andrew Burgess  <andrew.burgess@embecosm.com>

        * hashtab.c (htab_remove_elt): Make a parameter const.
        (htab_remove_elt_with_hash): Likewise.

	2020-01-23  Alexandre Oliva <oliva@adacore.com>

        * argv.c (writeargv): Output empty args as "".

	2020-01-18  Iain Sandoe  <iain@sandoe.co.uk>

	* cp-demangle.c (cplus_demangle_operators): Add the co_await
	operator.
	* testsuite/demangle-expected: Test co_await operator mangling.
---
 include/ChangeLog                     |  8 +++++++
 include/hashtab.h                     |  4 ++--
 libiberty/ChangeLog                   | 20 ++++++++++++++++
 libiberty/argv.c                      |  8 +++++++
 libiberty/cp-demangle.c               |  1 +
 libiberty/hashtab.c                   |  4 ++--
 libiberty/rust-demangle.h             | 45 -----------------------------------
 libiberty/testsuite/demangle-expected |  3 +++
 8 files changed, 44 insertions(+), 49 deletions(-)
 delete mode 100644 libiberty/rust-demangle.h

-- 
2.14.5

Comments

Tom Tromey Feb. 20, 2020, 8:24 p.m. | #1
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:


Andrew> This commit pulls in the latest changes for the include/ and
Andrew> libiberty/ directories.  The last sync was in commit
Andrew> 533da48302a26885a972e4379eccc26b364e5b53.
[...]

Seems like a good idea to me.
Thank you for doing this.

Tom
Andrew Burgess Feb. 25, 2020, 5:27 p.m. | #2
I went ahead and pushed this change as obvious - given I'm just
merging back changes from GCC.

Do let me know if anyone sees any problems.

Thanks,
Andrew


* Andrew Burgess <andrew.burgess@embecosm.com> [2020-02-19 19:18:21 +0000]:

> This commit pulls in the latest changes for the include/ and

> libiberty/ directories.  The last sync was in commit

> 533da48302a26885a972e4379eccc26b364e5b53.

> 

> This commit also removes the file libiberty/rust-demangle.h, this file

> has been removed in upstream GCC, and should have been deleted as part

> of the previous sync up, which included this ChangeLog entry:

> 

>   2019-11-16  Eduard-Mihai Burtescu  <eddyb@lyken.rs>

> 

>         ....

> 	* rust-demangle.h: Remove.

> 

> I've grep'd over the binutils-gdb source and can find no reference to

> the rust-demangle.h file, and everything seems to build fine without

> it, so I assume its continued existence was a mistake.

> 

> include/ChangeLog:

> 

> 	Import from gcc mainline:

> 	2020-02-05  Andrew Burgess  <andrew.burgess@embecosm.com>

> 

>         * hashtab.h (htab_remove_elt): Make a parameter const.

>         (htab_remove_elt_with_hash): Likewise.

> 

> libiberty/ChangeLog:

> 

> 	* rust-demangle.h: Removed.

> 

> 	Import from gcc mainline:

> 	2020-02-05  Andrew Burgess  <andrew.burgess@embecosm.com>

> 

>         * hashtab.c (htab_remove_elt): Make a parameter const.

>         (htab_remove_elt_with_hash): Likewise.

> 

> 	2020-01-23  Alexandre Oliva <oliva@adacore.com>

> 

>         * argv.c (writeargv): Output empty args as "".

> 

> 	2020-01-18  Iain Sandoe  <iain@sandoe.co.uk>

> 

> 	* cp-demangle.c (cplus_demangle_operators): Add the co_await

> 	operator.

> 	* testsuite/demangle-expected: Test co_await operator mangling.

> ---

>  include/ChangeLog                     |  8 +++++++

>  include/hashtab.h                     |  4 ++--

>  libiberty/ChangeLog                   | 20 ++++++++++++++++

>  libiberty/argv.c                      |  8 +++++++

>  libiberty/cp-demangle.c               |  1 +

>  libiberty/hashtab.c                   |  4 ++--

>  libiberty/rust-demangle.h             | 45 -----------------------------------

>  libiberty/testsuite/demangle-expected |  3 +++

>  8 files changed, 44 insertions(+), 49 deletions(-)

>  delete mode 100644 libiberty/rust-demangle.h

> 

> diff --git a/include/hashtab.h b/include/hashtab.h

> index d94b54c3c41..6cca342b989 100644

> --- a/include/hashtab.h

> +++ b/include/hashtab.h

> @@ -173,8 +173,8 @@ extern void *	htab_find_with_hash (htab_t, const void *, hashval_t);

>  extern void **	htab_find_slot_with_hash (htab_t, const void *,

>  					  hashval_t, enum insert_option);

>  extern void	htab_clear_slot	(htab_t, void **);

> -extern void	htab_remove_elt	(htab_t, void *);

> -extern void	htab_remove_elt_with_hash (htab_t, void *, hashval_t);

> +extern void	htab_remove_elt	(htab_t, const void *);

> +extern void	htab_remove_elt_with_hash (htab_t, const void *, hashval_t);

>  

>  extern void	htab_traverse (htab_t, htab_trav, void *);

>  extern void	htab_traverse_noresize (htab_t, htab_trav, void *);

> diff --git a/libiberty/argv.c b/libiberty/argv.c

> index 8c9794db6a2..6a72208d845 100644

> --- a/libiberty/argv.c

> +++ b/libiberty/argv.c

> @@ -327,6 +327,14 @@ writeargv (char * const *argv, FILE *f)

>            arg++;

>          }

>  

> +      /* Write out a pair of quotes for an empty argument.  */

> +      if (arg == *argv)

> +	if (EOF == fputs ("\"\"", f))

> +	  {

> +	    status = 1;

> +	    goto done;

> +	  }

> +

>        if (EOF == fputc ('\n', f))

>          {

>            status = 1;

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

> index 3639bfbfd43..fc55b7fae1f 100644

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

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

> @@ -1802,6 +1802,7 @@ const struct demangle_operator_info cplus_demangle_operators[] =

>    { "ad", NL ("&"),         1 },

>    { "an", NL ("&"),         2 },

>    { "at", NL ("alignof "),   1 },

> +  { "aw", NL ("co_await "), 1 },

>    { "az", NL ("alignof "),   1 },

>    { "cc", NL ("const_cast"), 2 },

>    { "cl", NL ("()"),        2 },

> diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c

> index 26c98ce2d68..225e9e540a7 100644

> --- a/libiberty/hashtab.c

> +++ b/libiberty/hashtab.c

> @@ -709,7 +709,7 @@ htab_find_slot (htab_t htab, const PTR element, enum insert_option insert)

>     element in the hash table, this function does nothing.  */

>  

>  void

> -htab_remove_elt (htab_t htab, PTR element)

> +htab_remove_elt (htab_t htab, const PTR element)

>  {

>    htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element));

>  }

> @@ -720,7 +720,7 @@ htab_remove_elt (htab_t htab, PTR element)

>     function does nothing.  */

>  

>  void

> -htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash)

> +htab_remove_elt_with_hash (htab_t htab, const PTR element, hashval_t hash)

>  {

>    PTR *slot;

>  

> diff --git a/libiberty/rust-demangle.h b/libiberty/rust-demangle.h

> deleted file mode 100644

> index abf4c6cde55..00000000000

> --- a/libiberty/rust-demangle.h

> +++ /dev/null

> @@ -1,45 +0,0 @@

> -/* Internal demangler interface for the Rust programming language.

> -   Copyright (C) 2016-2019 Free Software Foundation, Inc.

> -   Written by David Tolnay (dtolnay@gmail.com).

> -

> -This file is part of the libiberty library.

> -Libiberty is free software; you can redistribute it and/or

> -modify it under the terms of the GNU Library General Public

> -License as published by the Free Software Foundation; either

> -version 2 of the License, or (at your option) any later version.

> -

> -In addition to the permissions in the GNU Library General Public

> -License, the Free Software Foundation gives you unlimited permission

> -to link the compiled version of this file into combinations with other

> -programs, and to distribute those combinations without any restriction

> -coming from the use of this file.  (The Library Public License

> -restrictions do apply in other respects; for example, they cover

> -modification of the file, and distribution when not linked into a

> -combined executable.)

> -

> -Libiberty is distributed in the hope that it will be useful,

> -but WITHOUT ANY WARRANTY; without even the implied warranty of

> -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

> -Library General Public License for more details.

> -

> -You should have received a copy of the GNU Library General Public

> -License along with libiberty; see the file COPYING.LIB.

> -If not, see <http://www.gnu.org/licenses/>.  */

> -

> -/* This file provides some definitions shared by cplus-dem.c and

> -   rust-demangle.c.  It should not be included by any other files.  */

> -

> -/* Returns non-zero iff MANGLED is a rust mangled symbol.  MANGLED must

> -   already have been demangled through cplus_demangle_v3.  If this function

> -   returns non-zero then MANGLED can be demangled (in-place) using

> -   RUST_DEMANGLE_SYM.  */

> -extern int

> -rust_is_mangled (const char *mangled);

> -

> -/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.

> -   If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might

> -   replace characters that cannot be demangled with '?' and might truncate

> -   SYM.  After calling RUST_DEMANGLE_SYM SYM might be shorter, but never

> -   larger.  */

> -extern void

> -rust_demangle_sym (char *sym);

> diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected

> index 5d0c62bd137..ccadf84e608 100644

> --- a/libiberty/testsuite/demangle-expected

> +++ b/libiberty/testsuite/demangle-expected

> @@ -1450,3 +1450,6 @@ Foo<int>()::{lambda(auto:1)#1}::operator()<char>(char) const::X::fn

>  

>  _Z3fooILPv0EEvPN9enable_ifIXeqT_LDnEEvE4typeE

>  void foo<(void*)0>(enable_if<((void*)0)==(decltype(nullptr)), void>::type*)

> +

> +_ZNK5coro15emptyawEv

> +coro1::empty::operator co_await() const

> -- 

> 2.14.5

>

Patch

diff --git a/include/hashtab.h b/include/hashtab.h
index d94b54c3c41..6cca342b989 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -173,8 +173,8 @@  extern void *	htab_find_with_hash (htab_t, const void *, hashval_t);
 extern void **	htab_find_slot_with_hash (htab_t, const void *,
 					  hashval_t, enum insert_option);
 extern void	htab_clear_slot	(htab_t, void **);
-extern void	htab_remove_elt	(htab_t, void *);
-extern void	htab_remove_elt_with_hash (htab_t, void *, hashval_t);
+extern void	htab_remove_elt	(htab_t, const void *);
+extern void	htab_remove_elt_with_hash (htab_t, const void *, hashval_t);
 
 extern void	htab_traverse (htab_t, htab_trav, void *);
 extern void	htab_traverse_noresize (htab_t, htab_trav, void *);
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 8c9794db6a2..6a72208d845 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -327,6 +327,14 @@  writeargv (char * const *argv, FILE *f)
           arg++;
         }
 
+      /* Write out a pair of quotes for an empty argument.  */
+      if (arg == *argv)
+	if (EOF == fputs ("\"\"", f))
+	  {
+	    status = 1;
+	    goto done;
+	  }
+
       if (EOF == fputc ('\n', f))
         {
           status = 1;
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 3639bfbfd43..fc55b7fae1f 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1802,6 +1802,7 @@  const struct demangle_operator_info cplus_demangle_operators[] =
   { "ad", NL ("&"),         1 },
   { "an", NL ("&"),         2 },
   { "at", NL ("alignof "),   1 },
+  { "aw", NL ("co_await "), 1 },
   { "az", NL ("alignof "),   1 },
   { "cc", NL ("const_cast"), 2 },
   { "cl", NL ("()"),        2 },
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 26c98ce2d68..225e9e540a7 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -709,7 +709,7 @@  htab_find_slot (htab_t htab, const PTR element, enum insert_option insert)
    element in the hash table, this function does nothing.  */
 
 void
-htab_remove_elt (htab_t htab, PTR element)
+htab_remove_elt (htab_t htab, const PTR element)
 {
   htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element));
 }
@@ -720,7 +720,7 @@  htab_remove_elt (htab_t htab, PTR element)
    function does nothing.  */
 
 void
-htab_remove_elt_with_hash (htab_t htab, PTR element, hashval_t hash)
+htab_remove_elt_with_hash (htab_t htab, const PTR element, hashval_t hash)
 {
   PTR *slot;
 
diff --git a/libiberty/rust-demangle.h b/libiberty/rust-demangle.h
deleted file mode 100644
index abf4c6cde55..00000000000
--- a/libiberty/rust-demangle.h
+++ /dev/null
@@ -1,45 +0,0 @@ 
-/* Internal demangler interface for the Rust programming language.
-   Copyright (C) 2016-2019 Free Software Foundation, Inc.
-   Written by David Tolnay (dtolnay@gmail.com).
-
-This file is part of the libiberty library.
-Libiberty is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-In addition to the permissions in the GNU Library General Public
-License, the Free Software Foundation gives you unlimited permission
-to link the compiled version of this file into combinations with other
-programs, and to distribute those combinations without any restriction
-coming from the use of this file.  (The Library Public License
-restrictions do apply in other respects; for example, they cover
-modification of the file, and distribution when not linked into a
-combined executable.)
-
-Libiberty is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with libiberty; see the file COPYING.LIB.
-If not, see <http://www.gnu.org/licenses/>.  */
-
-/* This file provides some definitions shared by cplus-dem.c and
-   rust-demangle.c.  It should not be included by any other files.  */
-
-/* Returns non-zero iff MANGLED is a rust mangled symbol.  MANGLED must
-   already have been demangled through cplus_demangle_v3.  If this function
-   returns non-zero then MANGLED can be demangled (in-place) using
-   RUST_DEMANGLE_SYM.  */
-extern int
-rust_is_mangled (const char *mangled);
-
-/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.
-   If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might
-   replace characters that cannot be demangled with '?' and might truncate
-   SYM.  After calling RUST_DEMANGLE_SYM SYM might be shorter, but never
-   larger.  */
-extern void
-rust_demangle_sym (char *sym);
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 5d0c62bd137..ccadf84e608 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -1450,3 +1450,6 @@  Foo<int>()::{lambda(auto:1)#1}::operator()<char>(char) const::X::fn
 
 _Z3fooILPv0EEvPN9enable_ifIXeqT_LDnEEvE4typeE
 void foo<(void*)0>(enable_if<((void*)0)==(decltype(nullptr)), void>::type*)
+
+_ZNK5coro15emptyawEv
+coro1::empty::operator co_await() const