diff options
author | Keith Seitz <keiths@redhat.com> | 2011-08-18 16:17:39 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2011-08-18 16:17:39 +0000 |
commit | 3a93a0c2ef1629add02bfdb6efe81015819acd35 (patch) | |
tree | 40d5b97e7a1d2698688510f6cb66c831daac5da2 /gdb/cp-support.h | |
parent | 7230378dfd17300cd58e07acda312299f6bd1936 (diff) | |
download | gdb-3a93a0c2ef1629add02bfdb6efe81015819acd35.zip gdb-3a93a0c2ef1629add02bfdb6efe81015819acd35.tar.gz gdb-3a93a0c2ef1629add02bfdb6efe81015819acd35.tar.bz2 |
PR c++/12266
* cp-name-parser.y (struct demangle_info): Remove unused
member PREV.
(d_grab): Likewise.
(allocate_info): Change return type to struct demangle_info *.
Always allocate a new demangle_info.
Remove unused PREV pointer.
(cp_new_demangle_parse_info): New function.
(cp_demangled_name_parse_free): New function.
(do_demangled_name_parse_free_cleanup): New function.
(make_cleanup_cp_demangled_name_parse_free): New function.
(cp_demangled_name_to_comp): Change return type to
struct demangle_parse_info *.
Allocate a new storage for each call.
(main): Update usage for cp_demangled_name_to_comp
API change.
* cp-support.h (struct demangle_parse_info): New structure.
(cp_demangled_name_to_comp): Update API change for
return type.
(cp_new_demangle_parse_info): Declare.
(make_cleanup_cp_demangled_name_parse_free): New declaration.
(cp_demangled_name_parse_free): Declare.
* cp-support.c (cp_canonicalize_string): Update API
change for cp_demangled_name_to_comp.
(mangled_name_to_comp): Likewise.
Return struct demangle_parse_info, too.
(cp_class_name_from_physname): Update mangled_name_to_comp
API change.
(method_name_from_physname): Likewise.
(cp_func_name): Update API change for cp_demangled_name_to_comp.
(cp_remove_params): Likewise.
* python/py-type.c (typy_legacy_template_argument): Likewise.
* cp-support.h (cp_canonicalize_string_no_typedefs): Declare.
(cp_merge_demangle_parse_infos): Declare.
* cp-support.c (ignore_typedefs): New file global.
(copy_string_to_obstack): New function.
(inspect_type): New function.
(replace_typedefs): New function.
(replace_typedefs_qualified_name): New function.
(cp_canonicalize_string_no_typedefs): New function.
* cp-name-parser.y (cp_merge_demangle_parse_infos): New function.
(cp_new_demangle__parse_info): Allocate and initialize the obstack.
* linespec.c (find_methods): Use cp_canonicalize_string_no_typedefs
instead of cp_canonicalize_string.
(find_method): Likewise.
(decode_compound): Before looking up the name, call
cp_canonicalize_string_no_typedefs.
(decode_variable): Likewise.
Diffstat (limited to 'gdb/cp-support.h')
-rw-r--r-- | gdb/cp-support.h | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/gdb/cp-support.h b/gdb/cp-support.h index d23f19e..51f808f 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -26,13 +26,12 @@ /* We need this for 'domain_enum', alas... */ #include "symtab.h" - #include "vec.h" +#include "gdb_obstack.h" /* Opaque declarations. */ struct symbol; -struct obstack; struct block; struct objfile; struct type; @@ -46,6 +45,20 @@ struct demangle_component; #define CP_ANONYMOUS_NAMESPACE_LEN 21 +/* The result of parsing a name. */ + +struct demangle_parse_info +{ + /* The memory used during the parse. */ + struct demangle_info *info; + + /* The result of the parse. */ + struct demangle_component *tree; + + /* Any temporary memory used during typedef replacement. */ + struct obstack obstack; +}; + /* This struct is designed to store data from using directives. It says that names from namespace IMPORT_SRC should be visible within namespace IMPORT_DEST. These form a linked list; NEXT is the next @@ -134,6 +147,8 @@ struct using_direct extern char *cp_canonicalize_string (const char *string); +extern char *cp_canonicalize_string_no_typedefs (const char *string); + extern char *cp_class_name_from_physname (const char *physname); extern char *method_name_from_physname (const char *physname); @@ -214,12 +229,21 @@ struct type *cp_lookup_transparent_type (const char *name); /* Functions from cp-name-parser.y. */ -extern struct demangle_component *cp_demangled_name_to_comp - (const char *demangled_name, const char **errmsg); +extern struct demangle_parse_info *cp_demangled_name_to_comp + (const char *demangled_name, const char **errmsg); extern char *cp_comp_to_string (struct demangle_component *result, int estimated_len); +extern void cp_demangled_name_parse_free (struct demangle_parse_info *); +extern struct cleanup *make_cleanup_cp_demangled_name_parse_free + (struct demangle_parse_info *); +extern void cp_merge_demangle_parse_infos (struct demangle_parse_info *, + struct demangle_component *, + struct demangle_parse_info *); + +extern struct demangle_parse_info *cp_new_demangle_parse_info (void); + /* The list of "maint cplus" commands. */ extern struct cmd_list_element *maint_cplus_cmd_list; |