From 2f89cd6c70e220ec7cbc07c124ebd0a403c79e22 Mon Sep 17 00:00:00 2001 From: dehao Date: Thu, 9 Jan 2014 23:01:46 +0000 Subject: [PATCH] Remove mod_id_to_name_t because its info is already encoded in module_infos. 2014-01-09 Dehao Chen * gcc/coverage.c (get_module_name): Use modules_infos to get name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@206500 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc-4_8/gcc/coverage.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/gcc-4_8/gcc/coverage.c b/gcc-4_8/gcc/coverage.c index 9fbb77ad651..e7dddbdfbd2 100644 --- a/gcc-4_8/gcc/coverage.c +++ b/gcc-4_8/gcc/coverage.c @@ -615,37 +615,17 @@ reorder_module_groups (const char *imports_file, unsigned max_group) module_name_tab.dispose (); } -typedef struct { - unsigned int mod_id; - const char *mod_name; -} mod_id_to_name_t; - -static vec *mod_names; - -static void -record_module_name (unsigned int mod_id, const char *name) -{ - mod_id_to_name_t t; - - t.mod_id = mod_id; - t.mod_name = xstrdup (name); - if (!mod_names) - vec_alloc (mod_names, 10); - mod_names->safe_push (t); -} - /* Return the module name for module with MOD_ID. */ const char * get_module_name (unsigned int mod_id) { size_t i; - mod_id_to_name_t *elt; - for (i = 0; mod_names->iterate (i, &elt); i++) + for (i = 0; i < num_in_fnames; i++) { - if (elt->mod_id == mod_id) - return elt->mod_name; + if (module_infos[i]->ident == mod_id) + return lbasename (module_infos[i]->source_filename); } gcc_assert (0); @@ -927,9 +907,6 @@ read_counts_file (const char *da_file_name, unsigned module_id) } } - record_module_name (mod_info->ident, - lbasename (mod_info->source_filename)); - if (dump_enabled_p ()) { dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location, -- 2.11.4.GIT