diff options
author | Tom Tromey <tom@tromey.com> | 2021-02-05 07:17:11 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-02-05 07:17:12 -0700 |
commit | bdfea17ea9bbd9f92ad19a70d770af42473d9c07 (patch) | |
tree | cd14e3cb96c9123721ac6416a4b94d7682c65c93 /gdb/compile/compile.c | |
parent | 1b30f42106cfd50ef1c020db2ca31f2fbe51ef8a (diff) | |
download | binutils-bdfea17ea9bbd9f92ad19a70d770af42473d9c07.zip binutils-bdfea17ea9bbd9f92ad19a70d770af42473d9c07.tar.gz binutils-bdfea17ea9bbd9f92ad19a70d770af42473d9c07.tar.bz2 |
Return unique_ptr from language_defn::get_compile_context
This changes language_defn::get_compile_context to return a
unique_ptr. This makes the ownership transfer clear.
gdb/ChangeLog
2021-02-05 Tom Tromey <tom@tromey.com>
* compile/compile-c-support.c (get_compile_context)
(c_get_compile_context, cplus_get_compile_context): Change return
type.
* language.c (language_defn::get_compile_instance): New method.
* language.h (language_defn::get_compile_instance): Change return
type. No longer inline.
* c-lang.c (c_language::get_compile_instance): Change return type.
(cplus_language::get_compile_instance): Change return type.
* c-lang.h (c_get_compile_context, cplus_get_compile_context):
Change return type.
* compile/compile.c (compile_to_object): Update.
Diffstat (limited to 'gdb/compile/compile.c')
-rw-r--r-- | gdb/compile/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 4e72adc..d9c99bf 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -649,8 +649,8 @@ compile_to_object (struct command_line *cmd, const char *cmd_string, expr_pc = get_frame_address_in_block (get_selected_frame (NULL)); /* Set up instance and context for the compiler. */ - std::unique_ptr <compile_instance> compiler - (current_language->get_compile_instance ()); + std::unique_ptr<compile_instance> compiler + = current_language->get_compile_instance (); if (compiler == nullptr) error (_("No compiler support for language %s."), current_language->name ()); |