From bdfea17ea9bbd9f92ad19a70d770af42473d9c07 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 5 Feb 2021 07:17:11 -0700 Subject: 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 * 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. --- gdb/language.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/language.c') diff --git a/gdb/language.c b/gdb/language.c index 8dde504..c23f291 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -46,6 +46,7 @@ #include "c-lang.h" #include #include "gdbarch.h" +#include "compile/compile-internal.h" static void set_range_case (void); @@ -704,6 +705,14 @@ language_defn::is_string_type_p (struct type *type) const return c_is_string_type_p (type); } +/* See language.h. */ + +std::unique_ptr +language_defn::get_compile_instance () const +{ + return {}; +} + /* The default implementation of the get_symbol_name_matcher_inner method from the language_defn class. Matches with strncmp_iw. */ -- cgit v1.1