From 6ac373717c28cc2befebd1e926dc5fcf39dda39f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 28 Jan 2021 10:09:02 -0500 Subject: gdb: rename type::{arch,objfile} -> type::{arch_owner,objfile_owner} I think this makes the names of the methods clearer, especially for the arch. The type::arch method (which gets the arch owner, or NULL if the type is not arch owned) is easily confused with the get_type_arch method (which returns an arch no matter what). The name "arch_owner" will make it intuitive that the method returns NULL if the type is not arch-owned. Also, this frees the type::arch name, so we will be able to morph the get_type_arch function into the type::arch method. gdb/ChangeLog: * gdbtypes.h (struct type) : Rename to... : ... this, update all users. : Rename to... : ... this, update all users. Change-Id: Ie7c28684c7b565adec05a7619c418c69429bd8c0 --- gdb/compile/compile-c-types.c | 8 ++++---- gdb/compile/compile-cplus-types.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gdb/compile') diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c index 104e619f16d..eaeb83284d4 100644 --- a/gdb/compile/compile-c-types.c +++ b/gdb/compile/compile-c-types.c @@ -165,9 +165,9 @@ convert_func (compile_c_instance *context, struct type *type) if (target_type == NULL) { if (type->is_objfile_owned ()) - target_type = objfile_type (type->objfile ())->builtin_int; + target_type = objfile_type (type->objfile_owner ())->builtin_int; else - target_type = builtin_type (type->arch ())->builtin_int; + target_type = builtin_type (type->arch_owner ())->builtin_int; warning (_("function has unknown return type; assuming int")); } @@ -324,9 +324,9 @@ convert_type_basic (compile_c_instance *context, struct type *type) built-in parser used to do, but at least warn. */ struct type *fallback; if (type->is_objfile_owned ()) - fallback = objfile_type (type->objfile ())->builtin_int; + fallback = objfile_type (type->objfile_owner ())->builtin_int; else - fallback = builtin_type (type->arch ())->builtin_int; + fallback = builtin_type (type->arch_owner ())->builtin_int; warning (_("variable has unknown type; assuming int")); return convert_int (context, fallback); } diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c index 0f32b0e1ade..d666ac3a83e 100644 --- a/gdb/compile/compile-cplus-types.c +++ b/gdb/compile/compile-cplus-types.c @@ -971,9 +971,9 @@ compile_cplus_convert_func (compile_cplus_instance *instance, if (target_type == nullptr) { if (type->is_objfile_owned ()) - target_type = objfile_type (type->objfile ())->builtin_int; + target_type = objfile_type (type->objfile_owner ())->builtin_int; else - target_type = builtin_type (type->arch ())->builtin_int; + target_type = builtin_type (type->arch_owner ())->builtin_int; warning (_("function has unknown return type; assuming int")); } -- cgit v1.2.1