X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir1tran.lisp;h=b2bd2e7aa20026b864a3592c41d4143be60f1a64;hb=69e6aef5e6fb3bd682c7a2cbf774034d2ea58ee8;hp=984db3118b78f3dd68c5289e0d3d38ff12ddd6d5;hpb=ed066199124c46998798122cc776e615c9c50372;p=sbcl.git diff --git a/src/compiler/ir1tran.lisp b/src/compiler/ir1tran.lisp index 984db31..b2bd2e7 100644 --- a/src/compiler/ir1tran.lisp +++ b/src/compiler/ir1tran.lisp @@ -320,7 +320,10 @@ symbol number character - string))) + string + #!+sb-simd-pack + #+sb-xc-host nil + #-sb-xc-host sb!kernel:simd-pack))) (grovel (value) ;; Unless VALUE is an object which which obviously ;; can't contain other objects @@ -682,6 +685,8 @@ ;; processing our own code, though. #+sb-xc-host (warn "reading an ignored variable: ~S" name))) + (when (global-var-p var) + (check-deprecated-variable name)) (reference-leaf start next result var name)) (cons (aver (eq (car var) 'macro)) @@ -695,7 +700,8 @@ (defun find-compiler-macro (opname form) (if (eq opname 'funcall) (let ((fun-form (cadr form))) - (cond ((and (consp fun-form) (eq 'function (car fun-form))) + (cond ((and (consp fun-form) (eq 'function (car fun-form)) + (not (cddr fun-form))) (let ((real-fun (cadr fun-form))) (if (legal-fun-name-p real-fun) (values (sb!xc:compiler-macro-function real-fun *lexenv*) @@ -732,7 +738,11 @@ ;; CLHS 3.2.2.1.3 specifies that NOTINLINE ;; suppresses compiler-macros. (not (fun-lexically-notinline-p cmacro-fun-name))) - (let ((res (careful-expand-macro cmacro-fun form t))) + (let ((res (handler-case + (careful-expand-macro cmacro-fun form t) + (compiler-macro-keyword-problem (c) + (print-compiler-message *error-output* "note: ~A" (list c)) + form)))) (cond ((eq res form) (ir1-convert-common-functoid start next result form op)) (t @@ -797,15 +807,16 @@ (let (;; We rely on the printer to abbreviate FORM. (*print-length* 3) (*print-level* 3)) - (format - nil - #-sb-xc-host "~@<~;during ~A of ~S. Use ~S to intercept:~%~:@>" - ;; longer message to avoid ambiguity "Was it the xc host - ;; or the cross-compiler which encountered the problem?" - #+sb-xc-host "~@<~;during cross-compiler ~A of ~S. Use ~S to intercept:~%~:@>" - (if cmacro "compiler-macroexpansion" "macroexpansion") - form - '*break-on-signals*)))) + (format nil + "~@<~A of ~S. Use ~S to intercept.~%~:@>" + (cond (cmacro + #-sb-xc-host "Error during compiler-macroexpansion" + #+sb-xc-host "Error during XC compiler-macroexpansion") + (t + #-sb-xc-host "during macroexpansion" + #+sb-xc-host "during XC macroexpansion")) + form + '*break-on-signals*)))) (handler-bind (;; KLUDGE: CMU CL in its wisdom (version 2.4.6 for Debian ;; Linux, anyway) raises a CL:WARNING condition (not a ;; CL:STYLE-WARNING) for undefined symbols when converting @@ -836,9 +847,18 @@ (wherestring) c) (muffle-warning-or-die))) - (error (lambda (c) - (compiler-error "~@<~A~@:_ ~A~:>" - (wherestring) c)))) + (error + (lambda (c) + (cond + (cmacro + ;; The spec is silent on what we should do. Signaling + ;; a full warning but declining to expand seems like + ;; a conservative and sane thing to do. + (compiler-warn "~@<~A~@:_ ~A~:>" (wherestring) c) + (return-from careful-expand-macro form)) + (t + (compiler-error "~@<~A~@:_ ~A~:>" + (wherestring) c)))))) (funcall sb!xc:*macroexpand-hook* fun form *lexenv*)))) ;;;; conversion utilities @@ -1205,6 +1225,9 @@ (declare (type list names fvars) (type lexenv res)) (let ((type (compiler-specifier-type spec))) + (unless (csubtypep type (specifier-type 'function)) + (compiler-style-warn "ignoring declared FTYPE: ~S (not a function type)" spec) + (return-from process-ftype-decl res)) (collect ((res nil cons)) (dolist (name names) (when (fboundp name) @@ -1326,13 +1349,13 @@ ;;; like FIND-IN-BINDINGS, but looks for #'FOO in the FVARS (defun find-in-bindings-or-fbindings (name vars fvars) (declare (list vars fvars)) - (if (consp name) - (destructuring-bind (wot fn-name) name - (unless (eq wot 'function) - (compiler-error "The function or variable name ~S is unrecognizable." - name)) - (find fn-name fvars :key #'leaf-source-name :test #'equal)) - (find-in-bindings vars name))) + (typecase name + (atom + (find-in-bindings vars name)) + ((cons (eql function) (cons * null)) + (find (cadr name) fvars :key #'leaf-source-name :test #'equal)) + (t + (compiler-error "Malformed function or variable name ~S." name)))) ;;; Process an ignore/ignorable declaration, checking for various losing ;;; conditions.