Class-ify macro_buffer
authorTom Tromey <tom@tromey.com>
Tue, 6 Feb 2018 19:10:20 +0000 (12:10 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 8 Feb 2018 18:46:56 +0000 (11:46 -0700)
commit1739cf248ff21b21271d1e9d5f77a12589c3856c
tree57ff7a5b756c0eda46d092ce2ddd941dd7a3a643
parentf6c2623eb8ac7296b6d7a76657394272a71f5aee
Class-ify macro_buffer

This patch changes macro_buffer to be a bit more of a C++ class,
adding constructors, a destructor, and some members.  Then this is
used to remove various cleanups in macroexp.c.

2018-02-08  Tom Tromey  <tom@tromey.com>

* macroexp.c (struct macro_buffer): Add initializers for some
members.
(init_buffer, init_shared_buffer, free_buffer)
(free_buffer_return_text): Remove.
(macro_buffer): New constructors.
(~macro_buffer): New destructor.
(macro_buffer::set_shared): New method.
(macro_buffer::resize_buffer, macro_buffer::appendc)
(macro_buffer::appendmem): Now methods, not free functions.
(set_token, append_tokens_without_splicing, stringify)
(macro_stringify): Update.
(gather_arguments): Change return type.  Remove argc_p argument,
add args_ptr argument.  Use std::vector.
(substitute_args): Remove argc argument.  Accept std::vector.
(expand): Update.  Use std::vector.
(scan, macro_expand, macro_expand_next): Update.
gdb/ChangeLog
gdb/macroexp.c
This page took 0.041056 seconds and 4 git commands to generate.