summaryrefslogtreecommitdiff
path: root/gdb/compile/compile.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-01-23 12:20:11 -0700
committerTom Tromey <tom@tromey.com>2021-01-23 20:33:25 -0700
commit3637a558a50141676f9997979491296dc007168d (patch)
tree6a15b32e0bbf8f7d81f6557cbc0ce0e343bddbd2 /gdb/compile/compile.h
parent18454c151f5824564130ba626bd90e9de30444ef (diff)
downloadbinutils-gdb-3637a558a50141676f9997979491296dc007168d.tar.gz
Use std::vector for "registers_used" in compile feature
This changes the GDB compile code to use std::vector<bool> when computing which registers are used. This is a bit more idiomatic, but the main benefit is that it also adds some checking when the libstd++ debug mode is enabled. 2021-01-23 Tom Tromey <tom@tromey.com> * symtab.h (struct symbol_computed_ops) <generate_c_location>: Change type of "registers_used". * dwarf2/loc.h (dwarf2_compile_property_to_c): Update. * dwarf2/loc.c (dwarf2_compile_property_to_c) (locexpr_generate_c_location, loclist_generate_c_location): Change type of "registers_used". * compile/compile.h (compile_dwarf_expr_to_c) (compile_dwarf_bounds_to_c): Update. * compile/compile-loc2c.c (pushf_register_address) (pushf_register, do_compile_dwarf_expr_to_c) (compile_dwarf_expr_to_c, compile_dwarf_bounds_to_c): Change type of "registers_used". * compile/compile-c.h (generate_c_for_variable_locations): Update. * compile/compile-c-symbols.c (generate_vla_size) (generate_c_for_for_one_variable): Change type of "registers_used". (generate_c_for_variable_locations): Return std::vector. * compile/compile-c-support.c (generate_register_struct): Change type of "registers_used". (compute): Update.
Diffstat (limited to 'gdb/compile/compile.h')
-rw-r--r--gdb/compile/compile.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/compile/compile.h b/gdb/compile/compile.h
index 9dd7f38ebd9..5e733f3e647 100644
--- a/gdb/compile/compile.h
+++ b/gdb/compile/compile.h
@@ -64,7 +64,7 @@ extern void compile_dwarf_expr_to_c (string_file *stream,
struct symbol *sym,
CORE_ADDR pc,
struct gdbarch *arch,
- unsigned char *registers_used,
+ std::vector<bool> &registers_used,
unsigned int addr_size,
const gdb_byte *op_ptr,
const gdb_byte *op_end,
@@ -103,7 +103,7 @@ extern void compile_dwarf_bounds_to_c (string_file *stream,
const struct dynamic_prop *prop,
struct symbol *sym, CORE_ADDR pc,
struct gdbarch *arch,
- unsigned char *registers_used,
+ std::vector<bool> &registers_used,
unsigned int addr_size,
const gdb_byte *op_ptr,
const gdb_byte *op_end,