[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bytecomp.el
From: |
Richard M . Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/bytecomp.el |
Date: |
Tue, 09 Nov 2004 05:39:37 -0500 |
Index: emacs/lisp/emacs-lisp/bytecomp.el
diff -c emacs/lisp/emacs-lisp/bytecomp.el:2.156
emacs/lisp/emacs-lisp/bytecomp.el:2.157
*** emacs/lisp/emacs-lisp/bytecomp.el:2.156 Tue Nov 2 09:22:16 2004
--- emacs/lisp/emacs-lisp/bytecomp.el Tue Nov 9 10:33:11 2004
***************
*** 447,453 ****
"Alist of functions defined in the file being compiled.
This is so we can inline them when necessary.
Each element looks like (FUNCTIONNAME . DEFINITION). It is
! \(FUNCTIONNAME . nil) when a function is redefined as a macro.")
(defvar byte-compile-unresolved-functions nil
"Alist of undefined functions to which calls have been compiled.
--- 447,455 ----
"Alist of functions defined in the file being compiled.
This is so we can inline them when necessary.
Each element looks like (FUNCTIONNAME . DEFINITION). It is
! \(FUNCTIONNAME . nil) when a function is redefined as a macro.
! It is \(FUNCTIONNAME . t) when all we know is that it was defined,
! and we don't know the definition.")
(defvar byte-compile-unresolved-functions nil
"Alist of undefined functions to which calls have been compiled.
***************
*** 1103,1108 ****
--- 1105,1114 ----
;;; sanity-checking arglists
+ ;; If a function has an entry saying (FUNCTION . t).
+ ;; that means we know it is defined but we don't know how.
+ ;; If a function has an entry saying (FUNCTION . nil),
+ ;; that means treat it as not defined.
(defun byte-compile-fdefinition (name macro-p)
(let* ((list (if macro-p
byte-compile-macro-environment
***************
*** 1168,1174 ****
(defun byte-compile-callargs-warn (form)
(let* ((def (or (byte-compile-fdefinition (car form) nil)
(byte-compile-fdefinition (car form) t)))
! (sig (if def
(byte-compile-arglist-signature
(if (eq 'lambda (car-safe def))
(nth 1 def)
--- 1174,1180 ----
(defun byte-compile-callargs-warn (form)
(let* ((def (or (byte-compile-fdefinition (car form) nil)
(byte-compile-fdefinition (car form) t)))
! (sig (if (and def (not (eq def t)))
(byte-compile-arglist-signature
(if (eq 'lambda (car-safe def))
(nth 1 def)
***************
*** 1198,1204 ****
(byte-compile-format-warn form)
;; Check to see if the function will be available at runtime
;; and/or remember its arity if it's unknown.
! (or (and (or sig (fboundp (car form))) ; might be a subr or autoload.
(not (memq (car form) byte-compile-noruntime-functions)))
(eq (car form) byte-compile-current-form) ; ## this doesn't work
; with recursion.
--- 1204,1210 ----
(byte-compile-format-warn form)
;; Check to see if the function will be available at runtime
;; and/or remember its arity if it's unknown.
! (or (and (or def (fboundp (car form))) ; might be a subr or autoload.
(not (memq (car form) byte-compile-noruntime-functions)))
(eq (car form) byte-compile-current-form) ; ## this doesn't work
; with recursion.
***************
*** 1243,1249 ****
;; number of arguments.
(defun byte-compile-arglist-warn (form macrop)
(let ((old (byte-compile-fdefinition (nth 1 form) macrop)))
! (if old
(let ((sig1 (byte-compile-arglist-signature
(if (eq 'lambda (car-safe old))
(nth 1 old)
--- 1249,1255 ----
;; number of arguments.
(defun byte-compile-arglist-warn (form macrop)
(let ((old (byte-compile-fdefinition (nth 1 form) macrop)))
! (if (and old (not (eq old t)))
(let ((sig1 (byte-compile-arglist-signature
(if (eq 'lambda (car-safe old))
(nth 1 old)
***************
*** 3714,3730 ****
(if (and (consp (cdr form)) (consp (nth 1 form))
(eq (car (nth 1 form)) 'quote)
(consp (cdr (nth 1 form)))
! (symbolp (nth 1 (nth 1 form)))
! (consp (nthcdr 2 form))
! (consp (nth 2 form))
! (eq (car (nth 2 form)) 'quote)
! (consp (cdr (nth 2 form)))
! (symbolp (nth 1 (nth 2 form))))
! (progn
(byte-compile-defalias-warn (nth 1 (nth 1 form)))
(setq byte-compile-function-environment
(cons (cons (nth 1 (nth 1 form))
! (nth 1 (nth 2 form)))
byte-compile-function-environment))))
(byte-compile-normal-call form))
--- 3720,3736 ----
(if (and (consp (cdr form)) (consp (nth 1 form))
(eq (car (nth 1 form)) 'quote)
(consp (cdr (nth 1 form)))
! (symbolp (nth 1 (nth 1 form))))
! (let ((constant
! (and (consp (nthcdr 2 form))
! (consp (nth 2 form))
! (eq (car (nth 2 form)) 'quote)
! (consp (cdr (nth 2 form)))
! (symbolp (nth 1 (nth 2 form))))))
(byte-compile-defalias-warn (nth 1 (nth 1 form)))
(setq byte-compile-function-environment
(cons (cons (nth 1 (nth 1 form))
! (if constant (nth 1 (nth 2 form)) t))
byte-compile-function-environment))))
(byte-compile-normal-call form))
***************
*** 3928,3934 ****
(while rest
(or (nth 1 (car rest))
(null (setq f (car (car rest))))
! (byte-compile-fdefinition f t)
(commandp (byte-compile-fdefinition f nil))
(setq uncalled (cons f uncalled)))
(setq rest (cdr rest)))
--- 3934,3940 ----
(while rest
(or (nth 1 (car rest))
(null (setq f (car (car rest))))
! (functionp (byte-compile-fdefinition f t))
(commandp (byte-compile-fdefinition f nil))
(setq uncalled (cons f uncalled)))
(setq rest (cdr rest)))