From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id BB789395252F; Tue, 6 Dec 2022 02:45:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB789395252F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670294757; bh=8dDfUDjZz73w4kQihEnaE3Xud1nfEZpJQWM8xiX7fL0=; h=From:To:Subject:Date:From; b=ASnvOYBLyDrbqqMb2M+r4F64rCUF2ZiPBt+A5xU2+XEbnb3TvajWe4h9CTdD8/vxR L2CGmXlpAR1yJJTfKFXZ0WdrFKr27T7xhJOI/FdtCJGPLavVNgyUYmVGGEty8X8KAQ 3ZGjSAj955V755Vi/1KDIokhEX67/5U0yIrDywNg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] gm2-lang.cc further tidyup of code. X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/devel/modula-2 X-Git-Oldrev: db80db0aab7035ea91f16e82963ea38e088c7d00 X-Git-Newrev: 5405813b8aab29b9ca035a8c7bceac178494649f Message-Id: <20221206024557.BB789395252F@sourceware.org> Date: Tue, 6 Dec 2022 02:45:57 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5405813b8aab29b9ca035a8c7bceac178494649f commit 5405813b8aab29b9ca035a8c7bceac178494649f Author: Gaius Mulley Date: Tue Dec 6 02:45:37 2022 +0000 gm2-lang.cc further tidyup of code. More tidying and complete the feedback suggestions made during the code review. gcc/m2/ChangeLog: * m2/gm2-lang.cc (gm2_langhook_init_options_struct): Remove x_flag_non_call_exceptions. Remove commented code. Add for loop to check whether any prebuilt integer types are suitable for use. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-lang.cc | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/gcc/m2/gm2-lang.cc b/gcc/m2/gm2-lang.cc index 1319ef73562..2f57d740a36 100644 --- a/gcc/m2/gm2-lang.cc +++ b/gcc/m2/gm2-lang.cc @@ -130,10 +130,8 @@ gm2_langhook_init_options_struct (struct gcc_options *opts) opts->x_flag_errno_math = 0; opts->frontend_set_flag_errno_math = true; - /* Exceptions are used to handle recovering from panics. */ + /* Exceptions are used. */ opts->x_flag_exceptions = 1; - opts->x_flag_non_call_exceptions = 1; - init_FrontEndInit (); } @@ -151,8 +149,6 @@ gm2_langhook_init_options (unsigned int decoded_options_count, unsigned int i; bool in_cpp_args = false; - // filename_cpp = ggc_vec_alloc (decoded_options_count); - for (i = 1; i < decoded_options_count; i++) { switch (decoded_options[i].opt_index) @@ -471,6 +467,12 @@ gm2_langhook_type_for_mode (machine_mode mode, int unsignedp) { tree type; + for (int i = 0; i < NUM_INT_N_ENTS; i ++) + if (int_n_enabled_p[i] + && mode == int_n_data[i].m) + return (unsignedp ? int_n_trees[i].unsigned_type + : int_n_trees[i].signed_type); + if (VECTOR_MODE_P (mode)) { tree inner; @@ -496,9 +498,6 @@ gm2_langhook_type_for_mode (machine_mode mode, int unsignedp) if (COMPLEX_MODE_P (mode)) { - machine_mode inner_mode; - tree inner_type; - if (mode == TYPE_MODE (complex_float_type_node)) return complex_float_type_node; if (mode == TYPE_MODE (complex_double_type_node)) @@ -537,11 +536,7 @@ gm2_langhook_global_bindings_p (void) return current_function_decl == NULL_TREE; } -/* Push a declaration into the current binding level. We can't - usefully implement this since we don't want to convert from tree back - to one of our internal data structures. I think the only way this is - used is to record a decl which is to be returned by getdecls, and we - could implement it for that purpose if necessary. */ +/* Unused langhook. */ static tree gm2_langhook_pushdecl (tree decl ATTRIBUTE_UNUSED)