From 9592deabf3c6b9e23aa7a5b84724672cb7c8d560 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Thu, 25 Feb 2021 08:33:05 -0800 Subject: c++: Rename new -flang-note-module-read option [PR 99166] I realized that the just-added flang-note-module-read option should also cover module writes, and was therefore misnamed. This addresses that, replacing it with a -flang-note-module-cmi pair of options. As this was such a recent addition, I didn't leave the old option available. PR c++/99166 gcc/c-family/ * c.opt (-flang-info-module-cmi): Renamed option. gcc/ * doc/invoke.texi (flang-info-module-cmi): Renamed option. gcc/cp/ * module.cc (module_state::inform_cmi_p): Renamed field. (module_state::do_import): Adjust. (init_modules, finish_module_processing): Likewise. (handle_module_option): Likewise. gcc/testsuite/ * g++.dg/modules/pr99166_a.X: Adjust. * g++.dg/modules/pr99166_b.C: Adjust. * g++.dg/modules/pr99166_c.C: Adjust. * g++.dg/modules/pr99166_d.C: Adjust. --- gcc/cp/module.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gcc/cp/module.cc') diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index e576fac..0cb5bd9 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -3552,7 +3552,7 @@ class GTY((chain_next ("%h.parent"), for_user)) module_state { do it again */ bool call_init_p : 1; /* This module's global initializer needs calling. */ - bool inform_read_p : 1; /* Inform of a read. */ + bool inform_cmi_p : 1; /* Inform of a read/write. */ bool visited_p : 1; /* A walk-once flag. */ /* Record extensions emitted or permitted. */ unsigned extensions : SE_BITS; @@ -3789,7 +3789,7 @@ module_state::module_state (tree name, module_state *parent, bool partition) partition_p = partition; - inform_read_p = false; + inform_cmi_p = false; visited_p = false; extensions = 0; @@ -18699,7 +18699,7 @@ module_state::do_import (cpp_reader *reader, bool outermost) { const char *file = maybe_add_cmi_prefix (filename); dump () && dump ("CMI is %s", file); - if (note_module_read_yes || inform_read_p) + if (note_module_cmi_yes || inform_cmi_p) inform (loc, "reading CMI %qs", file); fd = open (file, O_RDONLY | O_CLOEXEC | O_BINARY); e = errno; @@ -19695,7 +19695,7 @@ init_modules (cpp_reader *reader) 0, is_pathname, name, len); } if (auto module = get_module (name)) - module->inform_read_p = 1; + module->inform_cmi_p = 1; else error ("invalid module name %qs", name); } @@ -19903,6 +19903,8 @@ finish_module_processing (cpp_reader *reader) break; create_dirs (tmp_name); } + if (note_module_cmi_yes || state->inform_cmi_p) + inform (state->loc, "writing CMI %qs", path); dump () && dump ("CMI is %s", path); } @@ -19915,7 +19917,7 @@ finish_module_processing (cpp_reader *reader) if (to.begin ()) { auto loc = input_location; - /* So crashes finger point the module decl. */ + /* So crashes finger-point the module decl. */ input_location = state->loc; state->write (&to, reader); input_location = loc; @@ -20085,7 +20087,7 @@ handle_module_option (unsigned code, const char *str, int) vec_safe_push (note_includes, str); return true; - case OPT_flang_info_module_read_: + case OPT_flang_info_module_cmi_: vec_safe_push (note_cmis, str); return true; -- cgit v1.1