diff --git a/src/cmp/cmpbackend-cxx/cmppass2-special.lsp b/src/cmp/cmpbackend-cxx/cmppass2-special.lsp index d649804cb..3e794287f 100644 --- a/src/cmp/cmpbackend-cxx/cmppass2-special.lsp +++ b/src/cmp/cmpbackend-cxx/cmppass2-special.lsp @@ -18,16 +18,9 @@ (declare (ignore c1form)) (progv symbols values (c2expr body))) -(defun c2function (c1form kind funob fun) - (declare (ignore c1form funob)) - (case kind - (GLOBAL - (unwind-exit `(FDEFINITION ,fun))) - (CLOSURE - ;; XXX: we have some code after baboon – is CLOSURE legal or not? - (baboon :format-control "c2function: c1form is of unexpected kind.") - (new-local fun) - (unwind-exit `(MAKE-CCLOSURE ,fun))))) +(defun c2function (c1form fname) + (declare (ignore c1form)) + (unwind-exit `(FDEFINITION ,fname))) ;;; Mechanism for sharing code. (defun new-local (fun) diff --git a/src/cmp/cmppass1-special.lsp b/src/cmp/cmppass1-special.lsp index 643494471..ffe886698 100644 --- a/src/cmp/cmppass1-special.lsp +++ b/src/cmp/cmppass1-special.lsp @@ -64,17 +64,16 @@ (defun c1function (args) (check-args-number 'FUNCTION args 1 1) (let ((fun (car args))) - (cond ((si::valid-function-name-p fun) - (let ((funob (local-function-ref fun t))) - (if funob - (let* ((var (fun-var funob))) - (add-to-read-nodes var (make-c1form* 'VAR :args var nil))) - (make-c1form* 'FUNCTION - :type 'FUNCTION - :sp-change (not (and (symbolp fun) - (si:get-sysprop fun 'NO-SP-CHANGE))) - :args 'GLOBAL nil fun)))) - ((and (consp fun) (member (car fun) '(LAMBDA EXT::LAMBDA-BLOCK))) + (cond ((si:valid-function-name-p fun) + (ext:if-let ((funob (local-function-ref fun t))) + (let ((var (fun-var funob))) + (add-to-read-nodes var (make-c1form* 'VAR :args var nil))) + (make-c1form* 'FUNCTION + :type 'FUNCTION + :sp-change (not (and (symbolp fun) + (si:get-sysprop fun 'NO-SP-CHANGE))) + :args fun))) + ((and (consp fun) (member (car fun) '(LAMBDA EXT:LAMBDA-BLOCK))) (cmpck (endp (cdr fun)) "The lambda expression ~s is illegal." fun) (let (name body) diff --git a/src/cmp/cmptables.lsp b/src/cmp/cmptables.lsp index 94e1913ed..b9e618481 100644 --- a/src/cmp/cmptables.lsp +++ b/src/cmp/cmptables.lsp @@ -62,7 +62,7 @@ (CL:MULTIPLE-VALUE-SETQ vars-list values-c1form-list :side-effects) (CL:MULTIPLE-VALUE-BIND vars-list init-c1form body :pure) - (CL:FUNCTION (GLOBAL/CLOSURE) lambda-form fun-object :single-valued) + (CL:FUNCTION fname :single-valued) (CL:RPLACD (dest-c1form value-c1form) :side-effects) (SI:STRUCTURE-REF struct-c1form type-name slot-index (:UNSAFE/NIL) :pure)