From 67607e24d0413828acdfa9bc38f6fbac40b860b9 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 14 May 2020 13:45:40 -0400 Subject: gdb: add type::code / type::set_code Add the code and set_code methods on code, in order to remove the TYPE_CODE macro. In this patch, the TYPE_CODE macro is changed to use type::code, so all the call sites that are used to set the type code are changed to use type::set_code. The next patch will remove TYPE_CODE completely. gdb/ChangeLog: * gdbtypes.h (struct type) : New methods. (TYPE_CODE): Use type::code. Change all call sites used to set the code to use type::set_code instead. --- gdb/valops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/valops.c') diff --git a/gdb/valops.c b/gdb/valops.c index aa995e6..2e7abf5 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -3792,7 +3792,7 @@ value_slice (struct value *array, int lowbound, int length) slice_type = create_array_type (NULL, element_type, slice_range_type); - TYPE_CODE (slice_type) = TYPE_CODE (array_type); + slice_type->set_code (TYPE_CODE (array_type)); if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) slice = allocate_value_lazy (slice_type); -- cgit v1.1