binutils-gdb/gdb/compile
Simon Marchi 5d10a2041e gdb: add string_file::release method
A common pattern for string_file is to want to move out the internal
string buffer, because it is the result of the computation that we want
to return.  It is the reason why string_file::string returns a non-const
reference, as explained in the comment.  I think it would make sense to
have a dedicated method for that instead and make string_file::string
return a const reference.

This allows removing the explicit std::move in the typical case.  Note
that compile_program::compute was missing a move, meaning that the
resulting string was copied.  With the new version, it's not possible to
forget to move.

Change-Id: Ieaefa35b73daa7930b2f3a26988b6e3b4121bb79
2022-01-26 10:01:40 -05:00
..
compile-c-support.c gdb: add string_file::release method 2022-01-26 10:01:40 -05:00
compile-c-symbols.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-c-types.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-c.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-cplus-symbols.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-cplus-types.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-cplus.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-internal.h Introduce gdb-hashtab module in gdbsupport 2022-01-18 10:14:43 -07:00
compile-loc2c.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-object-load.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-object-load.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-object-run.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-object-run.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile.c Move gdb_argv to gdbsupport 2022-01-18 10:14:42 -07:00
compile.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gcc-c-plugin.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gcc-cp-plugin.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00