mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
Move malformed-function warning from byte-opt to cconv (bug#67483)
We shouldn't be warning inside the optimiser in the first place. * lisp/emacs-lisp/byte-opt.el (byte-optimize-form): Remove byte-compile-form-stack manipulation. (byte-optimize-form-code-walker): Move malformed function warning from here... * lisp/emacs-lisp/cconv.el: ...to here.
This commit is contained in:
parent
e87644baa3
commit
8525be6d5e
2 changed files with 9 additions and 11 deletions
|
|
@ -485,10 +485,6 @@ There can be multiple entries for the same NAME if it has several aliases.")
|
||||||
(`(,(pred byte-code-function-p) . ,exps)
|
(`(,(pred byte-code-function-p) . ,exps)
|
||||||
(cons fn (mapcar #'byte-optimize-form exps)))
|
(cons fn (mapcar #'byte-optimize-form exps)))
|
||||||
|
|
||||||
(`(,(pred (not symbolp)) . ,_)
|
|
||||||
(byte-compile-warn-x form "`%s' is a malformed function" fn)
|
|
||||||
form)
|
|
||||||
|
|
||||||
((guard (when for-effect
|
((guard (when for-effect
|
||||||
(if-let ((tmp (byte-opt--fget fn 'side-effect-free)))
|
(if-let ((tmp (byte-opt--fget fn 'side-effect-free)))
|
||||||
(or byte-compile-delete-errors
|
(or byte-compile-delete-errors
|
||||||
|
|
@ -514,7 +510,6 @@ There can be multiple entries for the same NAME if it has several aliases.")
|
||||||
(byte-optimize-form form for-effect)))
|
(byte-optimize-form form for-effect)))
|
||||||
|
|
||||||
(defun byte-optimize-form (form &optional for-effect)
|
(defun byte-optimize-form (form &optional for-effect)
|
||||||
(push form byte-compile-form-stack)
|
|
||||||
(while
|
(while
|
||||||
(progn
|
(progn
|
||||||
;; First, optimize all sub-forms of this one.
|
;; First, optimize all sub-forms of this one.
|
||||||
|
|
@ -531,7 +526,6 @@ There can be multiple entries for the same NAME if it has several aliases.")
|
||||||
(byte-compile-log " %s\t==>\t%s" old new)
|
(byte-compile-log " %s\t==>\t%s" old new)
|
||||||
(setq form new)
|
(setq form new)
|
||||||
(not (eq new old))))))))
|
(not (eq new old))))))))
|
||||||
(pop byte-compile-form-stack)
|
|
||||||
form)
|
form)
|
||||||
|
|
||||||
(defun byte-optimize--rename-var-body (var new-var body)
|
(defun byte-optimize--rename-var-body (var new-var body)
|
||||||
|
|
|
||||||
|
|
@ -615,11 +615,15 @@ places where they originally did not directly appear."
|
||||||
(cconv-convert exp env extend))
|
(cconv-convert exp env extend))
|
||||||
|
|
||||||
(`(,func . ,forms)
|
(`(,func . ,forms)
|
||||||
;; First element is function or whatever function-like forms are: or, and,
|
(if (symbolp func)
|
||||||
;; if, catch, progn, prog1, while, until
|
;; First element is function or whatever function-like forms are:
|
||||||
`(,func . ,(mapcar (lambda (form)
|
;; or, and, if, catch, progn, prog1, while, until
|
||||||
(cconv-convert form env extend))
|
`(,func . ,(mapcar (lambda (form)
|
||||||
forms)))
|
(cconv-convert form env extend))
|
||||||
|
forms))
|
||||||
|
(macroexp--warn-wrap form (format-message "Malformed function `%S'"
|
||||||
|
(car form))
|
||||||
|
nil nil)))
|
||||||
|
|
||||||
(_ (or (cdr (assq form env)) form))))
|
(_ (or (cdr (assq form env)) form))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue