[Openmcl-cvs-notifications] r12533 - in /trunk/source/compiler: nx-basic.lisp nx0.lisp
gz at clozure.com
gz at clozure.com
Wed Aug 5 15:31:21 EDT 2009
Author: gz
Date: Wed Aug 5 15:31:20 2009
New Revision: 12533
Log:
Merge r12531: more declaration warnings
Modified:
trunk/source/compiler/nx-basic.lisp
trunk/source/compiler/nx0.lisp
Modified: trunk/source/compiler/nx-basic.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/nx-basic.lisp (original)
+++ trunk/source/compiler/nx-basic.lisp Wed Aug 5 15:31:20 2009
@@ -627,6 +627,7 @@
(:bad-declaration . "Unknown or invalid declaration ~S")
(:invalid-type . report-invalid-type-compiler-warning)
(:unknown-declaration-variable . "~s declaration for unknown variable =
~s")
+ (:unknown-declaration-function . "~s declaration for unknown function =
~s")
(:macro-used-before-definition . "Macro function ~S was used before it=
was defined.")
(:unsettable . "Shouldn't assign to variable ~S")
(:global-mismatch . report-compile-time-argument-mismatch)
Modified: trunk/source/compiler/nx0.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/nx0.lisp (original)
+++ trunk/source/compiler/nx0.lisp Wed Aug 5 15:31:20 2009
@@ -719,6 +719,20 @@
(and (null info) (not (nx-proclaimed-special-p sym))))
(nx1-whine :unknown-declaration-variable (cadr decl) sym)))))
=
+(defun nx-check-fdecl-var-ref (decl env &aux (sym (car decl)))
+ (unless (eq (cadr decl) 'ftype)
+ ;; Complain about forward references, since need a def to use the decl=
aration.
+ ;; Perhaps should complain if regular macro, but don't for now. Compi=
ler macros
+ ;; specifically allowed by spec for inline decls
+ (unless (or (nx-lexical-finfo sym env)
+ (fboundp sym)
+ (retrieve-environment-function-info sym env)
+ (gethash sym *nx1-alphatizers*)
+ (assq sym *nx-compile-time-compiler-macros*)
+ (gethash sym *compiler-macros*)
+ (eq sym *nx-global-function-name*))
+ (nx1-whine :unknown-declaration-function (cadr decl) sym))))
+
=
(defun nx-effect-other-decls (pending env)
(flet ((merge-decls (new old)
@@ -738,7 +752,12 @@
(unless (eq merged-type newtype)
(rplacd (cdr decl) merged-type))))
(push decl env-vdecls)))))
- (when fdecls (setf (lexenv.fdecls env) (merge-decls fdecls (lexenv.f=
decls env))))
+ (when fdecls
+ (let ((env-fdecls (lexenv.fdecls env)))
+ (dolist (decl fdecls (setf (lexenv.fdecls env) env-fdecls))
+ (unless (memq decl env-fdecls)
+ (nx-check-fdecl-var-ref decl env)
+ (push decl env-fdecls)))))
(when mdecls (setf (lexenv.mdecls env) (merge-decls mdecls (lexenv.m=
decls env))))
(setq *nx-inlined-self* (and (nx-self-calls-inlineable env) =
(let ((name *nx-global-function-name*)) =
More information about the Openmcl-cvs-notifications
mailing list