diff options
| author | Andrea Corallo | 2021-03-07 20:19:20 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-03-07 20:19:20 +0100 |
| commit | dbdc44db15ef9daa24d92c59d4e158f3963a172f (patch) | |
| tree | cf48697f66299efc55f9eddf369b9597b31e38b6 | |
| parent | 38b4ac3e6b5ac7e88003e02b30bbe2bdb82e6e6a (diff) | |
| download | emacs-dbdc44db15ef9daa24d92c59d4e158f3963a172f.tar.gz emacs-dbdc44db15ef9daa24d92c59d4e158f3963a172f.zip | |
Allow for `comp-native-driver-options' to work as a file-local variable.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 4 | ||||
| -rw-r--r-- | src/comp.c | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 4169b0756df..3ee8113c4f4 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2272,7 +2272,10 @@ With argument ARG, insert value in current buffer after the form." | |||
| 2272 | (defvar comp-speed) | 2272 | (defvar comp-speed) |
| 2273 | (push `(comp-speed . ,comp-speed) byte-native-qualities) | 2273 | (push `(comp-speed . ,comp-speed) byte-native-qualities) |
| 2274 | (defvar comp-debug) | 2274 | (defvar comp-debug) |
| 2275 | (push `(comp-debug . ,comp-debug) byte-native-qualities)) | 2275 | (push `(comp-debug . ,comp-debug) byte-native-qualities) |
| 2276 | (defvar comp-native-driver-options) | ||
| 2277 | (push `(comp-native-driver-options . ,comp-native-driver-options) | ||
| 2278 | byte-native-qualities)) | ||
| 2276 | 2279 | ||
| 2277 | ;; Compile the forms from the input buffer. | 2280 | ;; Compile the forms from the input buffer. |
| 2278 | (while (progn | 2281 | (while (progn |
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 70e10644ca8..cedbb786237 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -712,6 +712,8 @@ Returns ELT." | |||
| 712 | :documentation "Default speed for this compilation unit.") | 712 | :documentation "Default speed for this compilation unit.") |
| 713 | (debug comp-debug :type number | 713 | (debug comp-debug :type number |
| 714 | :documentation "Default debug level for this compilation unit.") | 714 | :documentation "Default debug level for this compilation unit.") |
| 715 | (driver-options comp-native-driver-options :type list | ||
| 716 | :documentation "Options for the GCC driver.") | ||
| 715 | (top-level-forms () :type list | 717 | (top-level-forms () :type list |
| 716 | :documentation "List of spilled top level forms.") | 718 | :documentation "List of spilled top level forms.") |
| 717 | (funcs-h (make-hash-table :test #'equal) :type hash-table | 719 | (funcs-h (make-hash-table :test #'equal) :type hash-table |
| @@ -1298,6 +1300,8 @@ clashes." | |||
| 1298 | byte-native-qualities) | 1300 | byte-native-qualities) |
| 1299 | (comp-ctxt-debug comp-ctxt) (alist-get 'comp-debug | 1301 | (comp-ctxt-debug comp-ctxt) (alist-get 'comp-debug |
| 1300 | byte-native-qualities) | 1302 | byte-native-qualities) |
| 1303 | (comp-ctxt-driver-options comp-ctxt) (alist-get 'comp-native-driver-options | ||
| 1304 | byte-native-qualities) | ||
| 1301 | (comp-ctxt-top-level-forms comp-ctxt) | 1305 | (comp-ctxt-top-level-forms comp-ctxt) |
| 1302 | (cl-loop | 1306 | (cl-loop |
| 1303 | for form in (reverse byte-to-native-top-level-forms) | 1307 | for form in (reverse byte-to-native-top-level-forms) |
diff --git a/src/comp.c b/src/comp.c index bea9945bbfe..b2d8b8ec987 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -516,6 +516,7 @@ typedef struct { | |||
| 516 | typedef struct { | 516 | typedef struct { |
| 517 | EMACS_INT speed; | 517 | EMACS_INT speed; |
| 518 | EMACS_INT debug; | 518 | EMACS_INT debug; |
| 519 | Lisp_Object driver_options; | ||
| 519 | gcc_jit_context *ctxt; | 520 | gcc_jit_context *ctxt; |
| 520 | gcc_jit_type *void_type; | 521 | gcc_jit_type *void_type; |
| 521 | gcc_jit_type *bool_type; | 522 | gcc_jit_type *bool_type; |
| @@ -4333,7 +4334,7 @@ DEFUN ("comp-native-driver-options-effective-p", | |||
| 4333 | static void | 4334 | static void |
| 4334 | add_driver_options (void) | 4335 | add_driver_options (void) |
| 4335 | { | 4336 | { |
| 4336 | Lisp_Object options = Fsymbol_value (Qcomp_native_driver_options); | 4337 | Lisp_Object options = comp.driver_options; |
| 4337 | 4338 | ||
| 4338 | #if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \ | 4339 | #if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \ |
| 4339 | || defined (WINDOWSNT) | 4340 | || defined (WINDOWSNT) |
| @@ -4400,6 +4401,7 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, | |||
| 4400 | eassert (comp.speed < INT_MAX); | 4401 | eassert (comp.speed < INT_MAX); |
| 4401 | comp.debug = XFIXNUM (CALL1I (comp-ctxt-debug, Vcomp_ctxt)); | 4402 | comp.debug = XFIXNUM (CALL1I (comp-ctxt-debug, Vcomp_ctxt)); |
| 4402 | eassert (comp.debug < INT_MAX); | 4403 | eassert (comp.debug < INT_MAX); |
| 4404 | comp.driver_options = CALL1I (comp-ctxt-driver-options, Vcomp_ctxt); | ||
| 4403 | 4405 | ||
| 4404 | if (comp.debug) | 4406 | if (comp.debug) |
| 4405 | gcc_jit_context_set_bool_option (comp.ctxt, | 4407 | gcc_jit_context_set_bool_option (comp.ctxt, |