/[emacs]/emacs/lisp/emacs-lisp/bytecomp.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/bytecomp.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.156 by rms, Tue Nov 2 09:22:16 2004 UTC revision 2.157 by rms, Tue Nov 9 10:33:11 2004 UTC
# Line 447  Each element looks like (MACRONAME . DEF Line 447  Each element looks like (MACRONAME . DEF
447    "Alist of functions defined in the file being compiled.    "Alist of functions defined in the file being compiled.
448  This is so we can inline them when necessary.  This is so we can inline them when necessary.
449  Each element looks like (FUNCTIONNAME . DEFINITION).  It is  Each element looks like (FUNCTIONNAME . DEFINITION).  It is
450  \(FUNCTIONNAME . nil) when a function is redefined as a macro.")  \(FUNCTIONNAME . nil) when a function is redefined as a macro.
451    It is \(FUNCTIONNAME . t) when all we know is that it was defined,
452    and we don't know the definition.")
453    
454  (defvar byte-compile-unresolved-functions nil  (defvar byte-compile-unresolved-functions nil
455    "Alist of undefined functions to which calls have been compiled.    "Alist of undefined functions to which calls have been compiled.
# Line 1103  Each function's symbol gets added to `by Line 1105  Each function's symbol gets added to `by
1105    
1106  ;;; sanity-checking arglists  ;;; sanity-checking arglists
1107    
1108    ;; If a function has an entry saying (FUNCTION . t).
1109    ;; that means we know it is defined but we don't know how.
1110    ;; If a function has an entry saying (FUNCTION . nil),
1111    ;; that means treat it as not defined.
1112  (defun byte-compile-fdefinition (name macro-p)  (defun byte-compile-fdefinition (name macro-p)
1113    (let* ((list (if macro-p    (let* ((list (if macro-p
1114                     byte-compile-macro-environment                     byte-compile-macro-environment
# Line 1168  Each function's symbol gets added to `by Line 1174  Each function's symbol gets added to `by
1174  (defun byte-compile-callargs-warn (form)  (defun byte-compile-callargs-warn (form)
1175    (let* ((def (or (byte-compile-fdefinition (car form) nil)    (let* ((def (or (byte-compile-fdefinition (car form) nil)
1176                    (byte-compile-fdefinition (car form) t)))                    (byte-compile-fdefinition (car form) t)))
1177           (sig (if def           (sig (if (and def (not (eq def t)))
1178                    (byte-compile-arglist-signature                    (byte-compile-arglist-signature
1179                     (if (eq 'lambda (car-safe def))                     (if (eq 'lambda (car-safe def))
1180                         (nth 1 def)                         (nth 1 def)
# Line 1198  Each function's symbol gets added to `by Line 1204  Each function's symbol gets added to `by
1204      (byte-compile-format-warn form)      (byte-compile-format-warn form)
1205      ;; Check to see if the function will be available at runtime      ;; Check to see if the function will be available at runtime
1206      ;; and/or remember its arity if it's unknown.      ;; and/or remember its arity if it's unknown.
1207      (or (and (or sig (fboundp (car form))) ; might be a subr or autoload.      (or (and (or def (fboundp (car form))) ; might be a subr or autoload.
1208               (not (memq (car form) byte-compile-noruntime-functions)))               (not (memq (car form) byte-compile-noruntime-functions)))
1209          (eq (car form) byte-compile-current-form) ; ## this doesn't work          (eq (car form) byte-compile-current-form) ; ## this doesn't work
1210                                          ; with recursion.                                          ; with recursion.
# Line 1243  extra args." Line 1249  extra args."
1249  ;; number of arguments.  ;; number of arguments.
1250  (defun byte-compile-arglist-warn (form macrop)  (defun byte-compile-arglist-warn (form macrop)
1251    (let ((old (byte-compile-fdefinition (nth 1 form) macrop)))    (let ((old (byte-compile-fdefinition (nth 1 form) macrop)))
1252      (if old      (if (and old (not (eq old t)))
1253          (let ((sig1 (byte-compile-arglist-signature          (let ((sig1 (byte-compile-arglist-signature
1254                        (if (eq 'lambda (car-safe old))                        (if (eq 'lambda (car-safe old))
1255                            (nth 1 old)                            (nth 1 old)
# Line 3714  being undefined will be suppressed." Line 3720  being undefined will be suppressed."
3720    (if (and (consp (cdr form)) (consp (nth 1 form))    (if (and (consp (cdr form)) (consp (nth 1 form))
3721             (eq (car (nth 1 form)) 'quote)             (eq (car (nth 1 form)) 'quote)
3722             (consp (cdr (nth 1 form)))             (consp (cdr (nth 1 form)))
3723             (symbolp (nth 1 (nth 1 form)))             (symbolp (nth 1 (nth 1 form))))
3724             (consp (nthcdr 2 form))        (let ((constant
3725             (consp (nth 2 form))               (and (consp (nthcdr 2 form))
3726             (eq (car (nth 2 form)) 'quote)                    (consp (nth 2 form))
3727             (consp (cdr (nth 2 form)))                    (eq (car (nth 2 form)) 'quote)
3728             (symbolp (nth 1 (nth 2 form))))                    (consp (cdr (nth 2 form)))
3729        (progn                    (symbolp (nth 1 (nth 2 form))))))
3730          (byte-compile-defalias-warn (nth 1 (nth 1 form)))          (byte-compile-defalias-warn (nth 1 (nth 1 form)))
3731          (setq byte-compile-function-environment          (setq byte-compile-function-environment
3732                (cons (cons (nth 1 (nth 1 form))                (cons (cons (nth 1 (nth 1 form))
3733                            (nth 1 (nth 2 form)))                            (if constant (nth 1 (nth 2 form)) t))
3734                      byte-compile-function-environment))))                      byte-compile-function-environment))))
3735    (byte-compile-normal-call form))    (byte-compile-normal-call form))
3736    
# Line 3928  invoked interactively." Line 3934  invoked interactively."
3934          (while rest          (while rest
3935            (or (nth 1 (car rest))            (or (nth 1 (car rest))
3936                (null (setq f (car (car rest))))                (null (setq f (car (car rest))))
3937                (byte-compile-fdefinition f t)                (functionp (byte-compile-fdefinition f t))
3938                (commandp (byte-compile-fdefinition f nil))                (commandp (byte-compile-fdefinition f nil))
3939                (setq uncalled (cons f uncalled)))                (setq uncalled (cons f uncalled)))
3940            (setq rest (cdr rest)))            (setq rest (cdr rest)))

Legend:
Removed from v.2.156  
changed lines
  Added in v.2.157

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26