]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
authorEduard-Mihai Burtescu <eddyb@lyken.rs>
Thu, 18 Jul 2019 14:10:51 +0000 (16:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 18 Jul 2019 14:10:51 +0000 (16:10 +0200)
include/
* demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
(rust_demangle_sym): Move to libiberty/rust-demangle.h.
libiberty/
* cplus-dem.c: Include rust-demangle.h.
* rust-demangle.c: Include rust-demangle.h.
* rust-demangle.h: New file.

From-SVN: r273573

include/ChangeLog
include/demangle.h
libiberty/ChangeLog
libiberty/cplus-dem.c
libiberty/rust-demangle.c
libiberty/rust-demangle.h [new file with mode: 0644]

index 6d09a8d6e07bc9f37bcf273dae27186809a8d29a..a4f3fe5d5cefe3b5b1a43df60288c64133d889ab 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-18  Eduard-Mihai Burtescu  <eddyb@lyken.rs>
+
+       * demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
+       (rust_demangle_sym): Move to libiberty/rust-demangle.h.
+
 2019-06-18  Thomas Schwinge  <thomas@codesourcery.com>
 
        * gomp-constants.h (enum gomp_map_kind): Fix description of
index f5d9b9e8b5bf40bf98200c4cb47de4e95cd27ed8..06c32571d5ce09590f367bb187c83eb373f4fa92 100644 (file)
@@ -159,24 +159,6 @@ ada_demangle (const char *mangled, int options);
 extern char *
 dlang_demangle (const char *mangled, int options);
 
-/* 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);
-
-/* Demangles MANGLED if it was GNU_V3 and then RUST mangled, otherwise
-   returns NULL. Uses CPLUS_DEMANGLE_V3, RUST_IS_MANGLED and
-   RUST_DEMANGLE_SYM.  Returns a new string that is owned by the caller.  */
 extern char *
 rust_demangle (const char *mangled, int options);
 
index c3daf2ae8c881fd399a21b8b9401f1549315568d..af242573a4258e98f17ea13a1bbaa4e01e27d883 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-18  Eduard-Mihai Burtescu  <eddyb@lyken.rs>
+
+       * cplus-dem.c: Include rust-demangle.h.
+       * rust-demangle.c: Include rust-demangle.h.
+       * rust-demangle.h: New file.
+
 2019-05-31  Michael Forney  <mforney@mforney.org>
 
        * cp-demangle.c: Don't define CP_DYNAMIC_ARRAYS if __STDC_NO_VLA__
index afceed2a1a751155fcfa4cbccd4e12e3f0377c34..a39e2bf2ed46eaaee01a95b363b46a70be31fc9f 100644 (file)
@@ -52,6 +52,7 @@ void * realloc ();
 #define CURRENT_DEMANGLING_STYLE options
 
 #include "libiberty.h"
+#include "rust-demangle.h"
 
 enum demangling_styles current_demangling_style = auto_demangling;
 
index 9b2d2dbe6311bcb2388be8ee2006956c8a9cea8b..2302db45b6fbce2798721298f64149a3d3cb68ef 100644 (file)
@@ -47,6 +47,7 @@ extern void *memset(void *s, int c, size_t n);
 
 #include <demangle.h>
 #include "libiberty.h"
+#include "rust-demangle.h"
 
 
 /* Mangled Rust symbols look like this:
diff --git a/libiberty/rust-demangle.h b/libiberty/rust-demangle.h
new file mode 100644 (file)
index 0000000..abf4c6c
--- /dev/null
@@ -0,0 +1,45 @@
+/* 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);