Commit c13db5d1 by Jason Merrill

demangle.h (cplus_demangle_v3): Add "options" parm.

        * demangle.h (cplus_demangle_v3): Add "options" parm.
        (cplus_demangle_v3_type): Remove prototype.
        (DMGL_VERBOSE): New macro.
        (DMGL_TYPES): New macro.

        * cplus-dem.c (flags): Add DMGL_VERBOSE
        (cplus_demangle_v3_p): Remove.
        (demangle_it): Add DMGL_TYPES to passed flags.
        * cp-demangle.c (cplus_demangle_v3_all): Remove.
        (cplus_demangle_v3_type): Remove.
        (cplus_demangle_v3): Add options parm.

        * collect2.c (dump_file): Pass DMGL_VERBOSE to cplus_demangle.

From-SVN: r49525
parent e07554eb
2002-02-05 Jason Merrill <jason@redhat.com>
* c-typeck.c (convert_for_assignment): Don't allow conversions
between pointers and references. Only allow lvalues to convert to
reference.
* c-decl.c (finish_function): Warn about a non-void function with
no return statement and no abnormal exit.
(current_function_returns_abnormally): New variable.
(start_function): Clear it.
(struct c_language_function): Add returns_abnormally.
(push_c_function_context): Save it.
(pop_c_function_context): Restore it.
* c-tree.h: Declare current_function_returns_abnormally.
* c-typeck.c (build_function_call): Set it.
* collect2.c (dump_file): Pass DMGL_VERBOSE to cplus_demangle.
2002-02-05 Andreas Jaeger <aj@suse.de> 2002-02-05 Andreas Jaeger <aj@suse.de>
* crtstuff.c: Fix comments. * crtstuff.c: Fix comments.
...@@ -14,12 +32,12 @@ ...@@ -14,12 +32,12 @@
2002-02-05 Aldy Hernandez <aldyh@redhat.com> 2002-02-05 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/altivec.h (vec_step_help): Rename to * config/rs6000/altivec.h (vec_step_help): Rename to
__vec_step_help. __vec_step_help.
2002-02-05 Aldy Hernandez <aldyh@redhat.com> 2002-02-05 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/altivec.h: Fix typos. * config/rs6000/altivec.h: Fix typos.
2002-02-05 Jason Thorpe <thorpej@wasabisystems.com> 2002-02-05 Jason Thorpe <thorpej@wasabisystems.com>
...@@ -27,13 +45,13 @@ ...@@ -27,13 +45,13 @@
2002-02-05 Aldy Hernandez <aldyh@redhat.com> 2002-02-05 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.c (altivec_init_builtins): Fix typo * config/rs6000/rs6000.c (altivec_init_builtins): Fix typo
building void typed builtins. building void typed builtins.
* config/rs6000/altivec.h (vec_ld*): Fix typos. * config/rs6000/altivec.h (vec_ld*): Fix typos.
(vec_step): Implement for C++. (vec_step): Implement for C++.
Mon Feb 4 19:23:19 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Mon Feb 4 19:23:19 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* final.c (final_scan_insn): Add case for NOTE_INSN_LOOP_END_TOP_COND. * final.c (final_scan_insn): Add case for NOTE_INSN_LOOP_END_TOP_COND.
...@@ -44,20 +62,20 @@ Mon Feb 4 19:23:19 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -44,20 +62,20 @@ Mon Feb 4 19:23:19 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2002-02-05 Aldy Hernandez <aldyh@redhat.com> 2002-02-05 Aldy Hernandez <aldyh@redhat.com>
* doc/extend.texi: Warn about unsupported usage of altivec * doc/extend.texi: Warn about unsupported usage of altivec
builtins. builtins.
* config/rs6000/rs6000.md (altivec_vcmp*_p): Remove. * config/rs6000/rs6000.md (altivec_vcmp*_p): Remove.
(altivec_predicate_*): New. (altivec_predicate_*): New.
* config/rs6000/altivec.h: Rewrite predicates to use new builtins. * config/rs6000/altivec.h: Rewrite predicates to use new builtins.
Add C++ version of vec_*() functions. Add C++ version of vec_*() functions.
* config/rs6000/rs6000.c (bdesc_altivec_preds): New. * config/rs6000/rs6000.c (bdesc_altivec_preds): New.
(bdesc_2arg): Remove altivec predicates. (bdesc_2arg): Remove altivec predicates.
(altivec_expand_builtin): Handle predicates. (altivec_expand_builtin): Handle predicates.
(altivec_init_builtins): Handle predicates. (altivec_init_builtins): Handle predicates.
(altivec_expand_predicate_builtin): New. (altivec_expand_predicate_builtin): New.
2002-02-04 John David Anglin <dave@hiauly1.hia.nrc.ca> 2002-02-04 John David Anglin <dave@hiauly1.hia.nrc.ca>
......
...@@ -532,7 +532,7 @@ dump_file (name) ...@@ -532,7 +532,7 @@ dump_file (name)
if (no_demangle) if (no_demangle)
result = 0; result = 0;
else else
result = cplus_demangle (p, DMGL_PARAMS | DMGL_ANSI); result = cplus_demangle (p, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
if (result) if (result)
{ {
......
2002-02-05 Jason Merrill <jason@redhat.com>
* demangle.h (cplus_demangle_v3): Add "options" parm.
(cplus_demangle_v3_type): Remove prototype.
(DMGL_VERBOSE): New macro.
(DMGL_TYPES): New macro.
2002-02-02 H.J. Lu (hjl@gnu.org) 2002-02-02 H.J. Lu (hjl@gnu.org)
* demangle.h (cplus_demangle_v3_type): New prototype. * demangle.h (cplus_demangle_v3_type): New prototype.
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#define DMGL_PARAMS (1 << 0) /* Include function args */ #define DMGL_PARAMS (1 << 0) /* Include function args */
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ #define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
#define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
#define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
#define DMGL_AUTO (1 << 8) #define DMGL_AUTO (1 << 8)
#define DMGL_GNU (1 << 9) #define DMGL_GNU (1 << 9)
...@@ -125,12 +127,7 @@ cplus_demangle_name_to_style PARAMS ((const char *name)); ...@@ -125,12 +127,7 @@ cplus_demangle_name_to_style PARAMS ((const char *name));
/* V3 ABI demangling entry points, defined in cp-demangle.c. */ /* V3 ABI demangling entry points, defined in cp-demangle.c. */
extern char* extern char*
cplus_demangle_v3 PARAMS ((const char* mangled)); cplus_demangle_v3 PARAMS ((const char* mangled, int options));
/* V3 ABI demangling entry points, defined in cp-demangle.c. Also
demagle types. */
extern char*
cplus_demangle_v3_type PARAMS ((const char* mangled));
extern char* extern char*
java_demangle_v3 PARAMS ((const char* mangled)); java_demangle_v3 PARAMS ((const char* mangled));
......
2002-02-05 Jason Merrill <jason@redhat.com>
* cplus-dem.c (flags): Add DMGL_VERBOSE
(cplus_demangle_v3_p): Remove.
(demangle_it): Add DMGL_TYPES to passed flags.
* cp-demangle.c (cplus_demangle_v3_all): Remove.
(cplus_demangle_v3_type): Remove.
(cplus_demangle_v3): Add options parm.
2002-02-02 H.J. Lu (hjl@gnu.org) 2002-02-02 H.J. Lu (hjl@gnu.org)
* cp-demangle.c (cp_demangle_type): Do not protect with * cp-demangle.c (cp_demangle_type): Do not protect with
......
...@@ -940,8 +940,6 @@ static status_t cp_demangle ...@@ -940,8 +940,6 @@ static status_t cp_demangle
PARAMS ((const char *, dyn_string_t, int)); PARAMS ((const char *, dyn_string_t, int));
static status_t cp_demangle_type static status_t cp_demangle_type
PARAMS ((const char*, dyn_string_t)); PARAMS ((const char*, dyn_string_t));
static char* cplus_demangle_v3_all
PARAMS ((const char*, int));
/* When passed to demangle_bare_function_type, indicates that the /* When passed to demangle_bare_function_type, indicates that the
function's return type is not encoded before its parameter types. */ function's return type is not encoded before its parameter types. */
...@@ -3687,26 +3685,13 @@ __cxa_demangle (mangled_name, output_buffer, length, status) ...@@ -3687,26 +3685,13 @@ __cxa_demangle (mangled_name, output_buffer, length, status)
If the demangling failes, returns NULL. */ If the demangling failes, returns NULL. */
char * char *
cplus_demangle_v3 (mangled) cplus_demangle_v3 (mangled, options)
const char* mangled; const char* mangled;
{ int options;
return cplus_demangle_v3_all (mangled, 0);
}
char *
cplus_demangle_v3_type (mangled)
const char* mangled;
{
return cplus_demangle_v3_all (mangled, 1);
}
static char *
cplus_demangle_v3_all (mangled, type)
const char* mangled;
int type;
{ {
dyn_string_t demangled; dyn_string_t demangled;
status_t status; status_t status;
int type = !!(options & DMGL_TYPES);
if (mangled[0] == '_' && mangled[1] == 'Z') if (mangled[0] == '_' && mangled[1] == 'Z')
/* It is not a type. */ /* It is not a type. */
...@@ -3718,6 +3703,8 @@ cplus_demangle_v3_all (mangled, type) ...@@ -3718,6 +3703,8 @@ cplus_demangle_v3_all (mangled, type)
return NULL; return NULL;
} }
flag_verbose = !!(options & DMGL_VERBOSE);
/* Create a dyn_string to hold the demangled name. */ /* Create a dyn_string to hold the demangled name. */
demangled = dyn_string_new (0); demangled = dyn_string_new (0);
/* Attempt the demangling. */ /* Attempt the demangling. */
......
...@@ -478,9 +478,6 @@ do_hpacc_template_literal PARAMS ((struct work_stuff *, const char **, string *) ...@@ -478,9 +478,6 @@ do_hpacc_template_literal PARAMS ((struct work_stuff *, const char **, string *)
static int static int
snarf_numeric_literal PARAMS ((const char **, string *)); snarf_numeric_literal PARAMS ((const char **, string *));
static char* (*cplus_demangle_v3_p) PARAMS ((const char* mangled))
= cplus_demangle_v3;
/* There is a TYPE_QUAL value for each type qualifier. They can be /* There is a TYPE_QUAL value for each type qualifier. They can be
combined by bitwise-or to form the complete set of qualifiers for a combined by bitwise-or to form the complete set of qualifiers for a
type. */ type. */
...@@ -914,7 +911,7 @@ cplus_demangle (mangled, options) ...@@ -914,7 +911,7 @@ cplus_demangle (mangled, options)
/* The V3 ABI demangling is implemented elsewhere. */ /* The V3 ABI demangling is implemented elsewhere. */
if (GNU_V3_DEMANGLING || AUTO_DEMANGLING) if (GNU_V3_DEMANGLING || AUTO_DEMANGLING)
{ {
ret = cplus_demangle_v3_p (mangled); ret = cplus_demangle_v3 (mangled, work->options);
if (ret || GNU_V3_DEMANGLING) if (ret || GNU_V3_DEMANGLING)
return ret; return ret;
} }
...@@ -4877,7 +4874,7 @@ string_append_template_idx (s, idx) ...@@ -4877,7 +4874,7 @@ string_append_template_idx (s, idx)
static const char *program_name; static const char *program_name;
static const char *program_version = VERSION; static const char *program_version = VERSION;
static int flags = DMGL_PARAMS | DMGL_ANSI; static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE;
static void demangle_it PARAMS ((char *)); static void demangle_it PARAMS ((char *));
static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;
...@@ -4890,7 +4887,8 @@ demangle_it (mangled_name) ...@@ -4890,7 +4887,8 @@ demangle_it (mangled_name)
{ {
char *result; char *result;
result = cplus_demangle (mangled_name, flags); /* For command line args, also try to demangle type encodings. */
result = cplus_demangle (mangled_name, flags | DMGL_TYPES);
if (result == NULL) if (result == NULL)
{ {
printf ("%s\n", mangled_name); printf ("%s\n", mangled_name);
...@@ -5089,7 +5087,6 @@ main (argc, argv) ...@@ -5089,7 +5087,6 @@ main (argc, argv)
if (optind < argc) if (optind < argc)
{ {
cplus_demangle_v3_p = cplus_demangle_v3_type;
for ( ; optind < argc; optind++) for ( ; optind < argc; optind++)
{ {
demangle_it (argv[optind]); demangle_it (argv[optind]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment