Skip to content

Commit 979526c

Browse files
eddybjakubjelinek
authored andcommitted
demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
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
1 parent 2499017 commit 979526c

File tree

6 files changed

+58
-18
lines changed

6 files changed

+58
-18
lines changed

include/ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-07-18 Eduard-Mihai Burtescu <[email protected]>
2+
3+
* demangle.h (rust_is_mangled): Move to libiberty/rust-demangle.h.
4+
(rust_demangle_sym): Move to libiberty/rust-demangle.h.
5+
16
2019-06-18 Thomas Schwinge <[email protected]>
27

38
* gomp-constants.h (enum gomp_map_kind): Fix description of

include/demangle.h

-18
Original file line numberDiff line numberDiff line change
@@ -159,24 +159,6 @@ ada_demangle (const char *mangled, int options);
159159
extern char *
160160
dlang_demangle (const char *mangled, int options);
161161

162-
/* Returns non-zero iff MANGLED is a rust mangled symbol. MANGLED must
163-
already have been demangled through cplus_demangle_v3. If this function
164-
returns non-zero then MANGLED can be demangled (in-place) using
165-
RUST_DEMANGLE_SYM. */
166-
extern int
167-
rust_is_mangled (const char *mangled);
168-
169-
/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.
170-
If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might
171-
replace characters that cannot be demangled with '?' and might truncate
172-
SYM. After calling RUST_DEMANGLE_SYM SYM might be shorter, but never
173-
larger. */
174-
extern void
175-
rust_demangle_sym (char *sym);
176-
177-
/* Demangles MANGLED if it was GNU_V3 and then RUST mangled, otherwise
178-
returns NULL. Uses CPLUS_DEMANGLE_V3, RUST_IS_MANGLED and
179-
RUST_DEMANGLE_SYM. Returns a new string that is owned by the caller. */
180162
extern char *
181163
rust_demangle (const char *mangled, int options);
182164

libiberty/ChangeLog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2019-07-18 Eduard-Mihai Burtescu <[email protected]>
2+
3+
* cplus-dem.c: Include rust-demangle.h.
4+
* rust-demangle.c: Include rust-demangle.h.
5+
* rust-demangle.h: New file.
6+
17
2019-05-31 Michael Forney <[email protected]>
28

39
* cp-demangle.c: Don't define CP_DYNAMIC_ARRAYS if __STDC_NO_VLA__

libiberty/cplus-dem.c

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ void * realloc ();
5252
#define CURRENT_DEMANGLING_STYLE options
5353

5454
#include "libiberty.h"
55+
#include "rust-demangle.h"
5556

5657
enum demangling_styles current_demangling_style = auto_demangling;
5758

libiberty/rust-demangle.c

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ extern void *memset(void *s, int c, size_t n);
4747

4848
#include <demangle.h>
4949
#include "libiberty.h"
50+
#include "rust-demangle.h"
5051

5152

5253
/* Mangled Rust symbols look like this:

libiberty/rust-demangle.h

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Internal demangler interface for the Rust programming language.
2+
Copyright (C) 2016-2019 Free Software Foundation, Inc.
3+
Written by David Tolnay ([email protected]).
4+
5+
This file is part of the libiberty library.
6+
Libiberty is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Library General Public
8+
License as published by the Free Software Foundation; either
9+
version 2 of the License, or (at your option) any later version.
10+
11+
In addition to the permissions in the GNU Library General Public
12+
License, the Free Software Foundation gives you unlimited permission
13+
to link the compiled version of this file into combinations with other
14+
programs, and to distribute those combinations without any restriction
15+
coming from the use of this file. (The Library Public License
16+
restrictions do apply in other respects; for example, they cover
17+
modification of the file, and distribution when not linked into a
18+
combined executable.)
19+
20+
Libiberty is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23+
Library General Public License for more details.
24+
25+
You should have received a copy of the GNU Library General Public
26+
License along with libiberty; see the file COPYING.LIB.
27+
If not, see <http://www.gnu.org/licenses/>. */
28+
29+
/* This file provides some definitions shared by cplus-dem.c and
30+
rust-demangle.c. It should not be included by any other files. */
31+
32+
/* Returns non-zero iff MANGLED is a rust mangled symbol. MANGLED must
33+
already have been demangled through cplus_demangle_v3. If this function
34+
returns non-zero then MANGLED can be demangled (in-place) using
35+
RUST_DEMANGLE_SYM. */
36+
extern int
37+
rust_is_mangled (const char *mangled);
38+
39+
/* Demangles SYM (in-place) if RUST_IS_MANGLED returned non-zero for SYM.
40+
If RUST_IS_MANGLED returned zero for SYM then RUST_DEMANGLE_SYM might
41+
replace characters that cannot be demangled with '?' and might truncate
42+
SYM. After calling RUST_DEMANGLE_SYM SYM might be shorter, but never
43+
larger. */
44+
extern void
45+
rust_demangle_sym (char *sym);

0 commit comments

Comments
 (0)