emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 1f105d5 3/8: * Improve 'add_driver_options'


From: Andrea Corallo
Subject: feature/native-comp 1f105d5 3/8: * Improve 'add_driver_options'
Date: Wed, 26 Aug 2020 15:49:58 -0400 (EDT)

branch: feature/native-comp
commit 1f105d5554e37a0c4994806a0f910c6686f2014d
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Improve 'add_driver_options'
    
        * src/comp.c (add_driver_options): Use
        load_gccjit_if_necessary and FOR_EACH_TAIL + GNU style.
---
 src/comp.c | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 03409cb..6cde761 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4130,27 +4130,19 @@ add_driver_options (void)
 #if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
   || defined (WINDOWSNT)
 #pragma GCC diagnostic ignored "-Waddress"
-  if (gcc_jit_context_add_driver_option)
-    {
-      while (CONSP (options))
-        {
-          gcc_jit_context_add_driver_option (comp.ctxt,
-                                            SSDATA (XCAR (options)));
-          options = XCDR (options);
-        }
-
-      return;
-    }
+  load_gccjit_if_necessary (true);
+  FOR_EACH_TAIL (options)
+    gcc_jit_context_add_driver_option (comp.ctxt,
+                                      SSDATA (XCAR (options)));
+  return;
 #pragma GCC diagnostic pop
 #endif
   if (CONSP (options))
-    {
-      xsignal1 (Qnative_compiler_error,
-                build_string ("Customizing native compiler options"
-                              " via `comp-native-driver-options' is"
-                              " only available on libgccjit version 9"
-                              " and above."));
-    }
+    xsignal1 (Qnative_compiler_error,
+             build_string ("Customizing native compiler options"
+                           " via `comp-native-driver-options' is"
+                           " only available on libgccjit version 9"
+                           " and above."));
 }
 
 static void



reply via email to

[Prev in Thread] Current Thread [Next in Thread]