summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-11-07 00:13:01 +0100
committerAndrea Corallo <akrl@sdf.org>2020-11-07 11:45:55 +0100
commit4a69e953f34d504809b94a0c4634444d34100039 (patch)
tree642550eb4114f1e65849c7aea29d2b026a324349 /lisp/emacs-lisp/bytecomp.el
parentacf101c63644da5587822afbea1b186d91ff3348 (diff)
downloademacs-4a69e953f34d504809b94a0c4634444d34100039.tar.gz
emacs-4a69e953f34d504809b94a0c4634444d34100039.tar.bz2
emacs-4a69e953f34d504809b94a0c4634444d34100039.zip
Allow for native compilation qualities to be specified per input file
* lisp/emacs-lisp/bytecomp.el (byte-native-qualities): Define variable. (byte-compile-from-buffer): Spill compilation qualities. * lisp/emacs-lisp/comp.el (comp-speed, comp-debug): Make them file local variables. (comp-ctxt): Add `speed' and `debug' slots. (comp-spill-speed, comp-spill-lap-function): Make use of these. (comp-spill-lap-function): Spill qualities from `byte-native-qualities'. (comp-limplify-top-level): Do not use `comp-speed' but ctxt value unstead. (comp-final): Do not propagate qualities as they are already in the `comp-ctxt'. (comp--native-compile): Close on `byte-native-qualities'. * src/comp.c (comp_t): Add 'speed' and 'debug' fields. (emit_comment, emit_mvar_rval, emit_static_object) (emit_ctxt_code, Fcomp__init_ctxt): Use these instead of the global variables. (Fcomp__compile_ctxt_to_file): Set comp.speed and comp.debug and use them.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index a3c830e60dd..5508a60c444 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -598,6 +598,8 @@ Each element is (INDEX . VALUE)")
(defvar byte-native-compiling nil
"Non nil while native compiling.")
+(defvar byte-native-qualities nil
+ "To spill default qualities from the compiled file.")
(defvar byte-native-for-bootstrap nil
"Non nil while compiling for bootstrap."
;; During boostrap we produce both the .eln and the .elc together.
@@ -2216,6 +2218,11 @@ With argument ARG, insert value in current buffer after the form."
(setq byte-compile-unresolved-functions nil)
(setq byte-compile-noruntime-functions nil)
(setq byte-compile-new-defuns nil)
+ (when byte-native-compiling
+ (defvar comp-speed)
+ (push `(comp-speed . ,comp-speed) byte-native-qualities)
+ (defvar comp-debug)
+ (push `(comp-debug . ,comp-debug) byte-native-qualities))
;; Compile the forms from the input buffer.
(while (progn