Mercurial > emacs
comparison lisp/emacs-lisp/bytecomp.el @ 48719:0cc3c6bc6da0
(byte-compile-eval): Handle (t . SYMBOL) elements in load-history.
(byte-compile-cl-warn): No cl warnings for cl-defsubst-expand
and cl-struct-setf-expander.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 07 Dec 2002 21:33:19 +0000 |
parents | 106dc88e8055 |
children | 162c286faa11 |
comparison
equal
deleted
inserted
replaced
48718:c1ae448c795b | 48719:0cc3c6bc6da0 |
---|---|
8 ;; Maintainer: FSF | 8 ;; Maintainer: FSF |
9 ;; Keywords: lisp | 9 ;; Keywords: lisp |
10 | 10 |
11 ;;; This version incorporates changes up to version 2.10 of the | 11 ;;; This version incorporates changes up to version 2.10 of the |
12 ;;; Zawinski-Furuseth compiler. | 12 ;;; Zawinski-Furuseth compiler. |
13 (defconst byte-compile-version "$Revision: 2.117 $") | 13 (defconst byte-compile-version "$Revision: 2.118 $") |
14 | 14 |
15 ;; This file is part of GNU Emacs. | 15 ;; This file is part of GNU Emacs. |
16 | 16 |
17 ;; GNU Emacs is free software; you can redistribute it and/or modify | 17 ;; GNU Emacs is free software; you can redistribute it and/or modify |
18 ;; it under the terms of the GNU General Public License as published by | 18 ;; it under the terms of the GNU General Public License as published by |
780 (let ((hist-new load-history) | 780 (let ((hist-new load-history) |
781 (hist-nil-new current-load-list)) | 781 (hist-nil-new current-load-list)) |
782 ;; Go through load-history, look for newly loaded files | 782 ;; Go through load-history, look for newly loaded files |
783 ;; and mark all the functions defined therein. | 783 ;; and mark all the functions defined therein. |
784 (while (and hist-new (not (eq hist-new hist-orig))) | 784 (while (and hist-new (not (eq hist-new hist-orig))) |
785 (let ((xs (pop hist-new))) | 785 (let ((xs (pop hist-new)) |
786 old-autoloads) | |
786 ;; Make sure the file was not already loaded before. | 787 ;; Make sure the file was not already loaded before. |
787 (unless (assoc (car xs) hist-orig) | 788 (unless (assoc (car xs) hist-orig) |
788 (dolist (s xs) | 789 (dolist (s xs) |
789 (cond | 790 (cond |
790 ((symbolp s) (put s 'byte-compile-noruntime t)) | 791 ((symbolp s) |
792 (unless (memq s old-autoloads) | |
793 (put s 'byte-compile-noruntime t))) | |
794 ((and (consp s) (eq t (car s))) | |
795 (push s old-autoloads)) | |
791 ((and (consp s) (eq 'autoload (car s))) | 796 ((and (consp s) (eq 'autoload (car s))) |
792 (put (cdr s) 'byte-compile-noruntime t))))))) | 797 (put (cdr s) 'byte-compile-noruntime t))))))) |
793 ;; Go through current-load-list for the locally defined funs. | 798 ;; Go through current-load-list for the locally defined funs. |
794 (while (and hist-nil-new (not (eq hist-nil-new hist-nil-orig))) | 799 (let (old-autoloads) |
795 (let ((s (pop hist-nil-new))) | 800 (while (and hist-nil-new (not (eq hist-nil-new hist-nil-orig))) |
796 (when (symbolp s) | 801 (let ((s (pop hist-nil-new))) |
797 (put s 'byte-compile-noruntime t))))))))) | 802 (when (and (symbolp s) (not (memq s old-autoloads))) |
803 (put s 'byte-compile-noruntime t)) | |
804 (when (and (consp s) (eq t (car s))) | |
805 (push s old-autoloads)))))))))) | |
798 | 806 |
799 (defun byte-compile-eval-before-compile (form) | 807 (defun byte-compile-eval-before-compile (form) |
800 "Evaluate FORM for `eval-and-compile'." | 808 "Evaluate FORM for `eval-and-compile'." |
801 (let ((hist-nil-orig current-load-list)) | 809 (let ((hist-nil-orig current-load-list)) |
802 (prog1 (eval form) | 810 (prog1 (eval form) |
1243 ;; avoid hardwiring the list. | 1251 ;; avoid hardwiring the list. |
1244 (not (memq func | 1252 (not (memq func |
1245 '(cl-block-wrapper cl-block-throw | 1253 '(cl-block-wrapper cl-block-throw |
1246 multiple-value-call nth-value | 1254 multiple-value-call nth-value |
1247 copy-seq first second rest endp cl-member | 1255 copy-seq first second rest endp cl-member |
1256 ;; These are included in generated code | |
1257 ;; that can't be called except at compile time | |
1258 ;; or unless cl is loaded anyway. | |
1259 cl-defsubst-expand cl-struct-setf-expander | |
1248 ;; These would sometimes be warned about | 1260 ;; These would sometimes be warned about |
1249 ;; but such warnings are never useful, | 1261 ;; but such warnings are never useful, |
1250 ;; so don't warn about them. | 1262 ;; so don't warn about them. |
1251 macroexpand cl-macroexpand-all cl-compiling-file)))) | 1263 macroexpand cl-macroexpand-all cl-compiling-file)))) |
1252 (byte-compile-warn "Function `%s' from cl package called at runtime" | 1264 (byte-compile-warn "Function `%s' from cl package called at runtime" |