gdb/cp-name-parser.y: Eliminate make_empty, use cplus_demangle_fill_component
authorPedro Alves <palves@redhat.com>
Mon, 27 Mar 2017 12:56:49 +0000 (13:56 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 27 Mar 2017 14:28:17 +0000 (15:28 +0100)
commita7e80b9e21eb907ac5c90de7452588c059db0cec
tree4ba0712f3199454aabac1e814419e54bc2aafb44
parentb1a42fdfa31937d7e05df34afee970ac0ad239e1
gdb/cp-name-parser.y: Eliminate make_empty, use cplus_demangle_fill_component

The demangler exports the cplus_demangle_fill_component function that
clients should use to initialize demangle_component components that
use the "s_binary" union member.  cp-name-parser.y uses it in some
places, via the fill_comp wrapper, but not all.  Several places
instead use a GDB-specific "make_empty" function.  Because this
function does not call any of the demangler "fill" functions, we had
to patch it recently to clear the allocated demangle_component's
"d_printing" field, which is supposedly a "private" demangler field.
To avoid such problems in the future, this commit switches those
places to use "fill_comp" instead, and eliminates the "make_empty"
function.

gdb/ChangeLog:
2017-03-27  Pedro Alves  <palves@redhat.com>

* cp-name-parser.y (make_empty): Delete.
(demangler_special, nested_name, ptr_operator, array_indicator)
(direct_declarator, declarator_1): Use fill_comp instead of
make_empty.
gdb/ChangeLog
gdb/cp-name-parser.y