mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 10:03:47 +08:00
Clean up demangle_parse_info
This changes demangle_parse_info to use inline initializers and to remove some manual memory management. Approved-By: John Baldwin <jhb@FreeBSD.org>
This commit is contained in:
parent
d1587e198f
commit
ed4eabdf63
@ -1955,15 +1955,6 @@ cp_comp_to_string (struct demangle_component *result, int estimated_len)
|
||||
return gdb::unique_xmalloc_ptr<char> (res);
|
||||
}
|
||||
|
||||
/* Constructor for demangle_parse_info. */
|
||||
|
||||
demangle_parse_info::demangle_parse_info ()
|
||||
: info (NULL),
|
||||
tree (NULL)
|
||||
{
|
||||
obstack_init (&obstack);
|
||||
}
|
||||
|
||||
/* Destructor for demangle_parse_info. */
|
||||
|
||||
demangle_parse_info::~demangle_parse_info ()
|
||||
@ -1976,9 +1967,6 @@ demangle_parse_info::~demangle_parse_info ()
|
||||
free (info);
|
||||
info = next;
|
||||
}
|
||||
|
||||
/* Free any memory allocated during typedef replacement. */
|
||||
obstack_free (&obstack, NULL);
|
||||
}
|
||||
|
||||
/* Merge the two parse trees given by DEST and SRC. The parse tree
|
||||
|
@ -58,18 +58,18 @@ struct using_direct;
|
||||
|
||||
struct demangle_parse_info
|
||||
{
|
||||
demangle_parse_info ();
|
||||
demangle_parse_info () = default;
|
||||
|
||||
~demangle_parse_info ();
|
||||
|
||||
/* The memory used during the parse. */
|
||||
struct demangle_info *info;
|
||||
struct demangle_info *info = nullptr;
|
||||
|
||||
/* The result of the parse. */
|
||||
struct demangle_component *tree;
|
||||
struct demangle_component *tree = nullptr;
|
||||
|
||||
/* Any temporary memory used during typedef replacement. */
|
||||
struct obstack obstack;
|
||||
auto_obstack obstack;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user