aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile/compile-object-load.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-09-23 09:32:54 -0600
committerTom Tromey <tom@tromey.com>2020-09-23 09:32:55 -0600
commite947a8482ac8ea529869c15b6949e4f19272c747 (patch)
tree30112aeacd185ae60be2662e6dda1134ab66af07 /gdb/compile/compile-object-load.h
parent0dbf6ee6a074208ef8f95ee3d2f7e4369265e456 (diff)
downloadbinutils-e947a8482ac8ea529869c15b6949e4f19272c747.zip
binutils-e947a8482ac8ea529869c15b6949e4f19272c747.tar.gz
binutils-e947a8482ac8ea529869c15b6949e4f19272c747.tar.bz2
Introduce and use compile_module_up
This introduces compile_module_up, a unique pointer for compile_module, and changes a few spots to use it. gdb/ChangeLog 2020-09-23 Tom Tromey <tom@tromey.com> * compile/compile.c (eval_compile_command): Update. * compile/compile-object-run.h (compile_object_run): Take a compile_module_up. * compile/compile-object-run.c (compile_object_run): Take a compile_module_up. * compile/compile-object-load.h (struct compile_module): Add constructor, destructor. (compile_module_up): New typedef. (compile_object_load): Return compile_object_up. * compile/compile-object-load.c (compile_object_load): Return compile_module_up.
Diffstat (limited to 'gdb/compile/compile-object-load.h')
-rw-r--r--gdb/compile/compile-object-load.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/compile/compile-object-load.h b/gdb/compile/compile-object-load.h
index c4adc71..9def29e 100644
--- a/gdb/compile/compile-object-load.h
+++ b/gdb/compile/compile-object-load.h
@@ -46,6 +46,13 @@ private:
struct compile_module
{
+ compile_module () = default;
+
+ DISABLE_COPY_AND_ASSIGN (compile_module);
+
+ compile_module &operator= (compile_module &&other) = default;
+ compile_module (compile_module &&other) = default;
+
/* objfile for the compiled module. */
struct objfile *objfile;
@@ -77,7 +84,10 @@ struct compile_module
struct munmap_list *munmap_list_head;
};
-extern struct compile_module *compile_object_load
+/* A unique pointer for a compile_module. */
+typedef std::unique_ptr<compile_module> compile_module_up;
+
+extern compile_module_up compile_object_load
(const compile_file_names &fnames,
enum compile_i_scope_types scope, void *scope_data);