Make copy_name return std::string
authorTom Tromey <tom@tromey.com>
Sun, 7 Apr 2019 21:29:58 +0000 (15:29 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 19 Apr 2019 20:10:23 +0000 (14:10 -0600)
commit61f4b350419e91560be94e0671a760b2e4902c65
treef1cc08b31b813c81d730ccd69974772d82cbcd12
parent189b8c2e104017600104457b97315da74a22f549
Make copy_name return std::string

This changes copy_name to return a std::string, updating all the
callers.  In some cases, an extra copy was removed.  This also
required a little bit of constification.

Tested by the buildbot.

gdb/ChangeLog
2019-04-19  Tom Tromey  <tom@tromey.com>

* type-stack.h (struct type_stack) <insert>: Constify string.
* type-stack.c (type_stack::insert): Constify string.
* gdbtypes.h (lookup_template_type): Update.
(address_space_name_to_int): Update.
* gdbtypes.c (address_space_name_to_int): Make space_identifier
const.
(lookup_template_type): Make name const.
* c-exp.y: Update rules.
(lex_one_token, classify_name, classify_inner_name)
(c_print_token): Update.
* p-exp.y: Update rules.
(yylex): Update.
* f-exp.y: Update rules.
(yylex): Update.
* d-exp.y: Update rules.
(lex_one_token, classify_name, classify_inner_name): Update.
* parse.c (write_dollar_variable, copy_name): Return std::string.
* parser-defs.h (copy_name): Change return type.
* m2-exp.y: Update rules.
(yylex): Update.
* go-exp.y (lex_one_token): Update.
Update rules.
(classify_unsafe_function, classify_packaged_name)
(classify_name, yylex): Update.
13 files changed:
gdb/ChangeLog
gdb/c-exp.y
gdb/d-exp.y
gdb/f-exp.y
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/go-exp.y
gdb/m2-exp.y
gdb/p-exp.y
gdb/parse.c
gdb/parser-defs.h
gdb/type-stack.c
gdb/type-stack.h