public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] gm2-lang.cc further tidyup of code.
@ 2022-12-06  2:45 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2022-12-06  2:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5405813b8aab29b9ca035a8c7bceac178494649f

commit 5405813b8aab29b9ca035a8c7bceac178494649f
Author: Gaius Mulley <gaiusmod2@gmail.com>
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 <gaiusmod2@gmail.com>

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<bool> (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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-06  2:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06  2:45 [gcc/devel/modula-2] gm2-lang.cc further tidyup of code Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).