]> git.eshelyaron.com Git - emacs.git/commitdiff
* Improve 'add_driver_options'
authorAndrea Corallo <akrl@sdf.org>
Wed, 19 Aug 2020 15:47:37 +0000 (17:47 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 26 Aug 2020 19:25:45 +0000 (21:25 +0200)
* src/comp.c (add_driver_options): Use
load_gccjit_if_necessary and FOR_EACH_TAIL + GNU style.

src/comp.c

index 03409cba0cdf8694b415cfc0254f99e82789de25..6cde761f761c041b08055d78858d302e8b101f2a 100644 (file)
@@ -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