diff --git a/src/cmp/cmpffi.lsp b/src/cmp/cmpffi.lsp index a13f49b6a..6114a81e6 100644 --- a/src/cmp/cmpffi.lsp +++ b/src/cmp/cmpffi.lsp @@ -55,12 +55,17 @@ (t (error "Unknown representation type ~S" rep-type))))) (defun lisp-type->rep-type (type) - (if (getf +representation-types+ type) - type - (do ((l +representation-types+ (cddr l))) - ((endp l) :object) - (when (subtypep type (first (second l))) - (return-from lisp-type->rep-type (first l)))))) + (cond + ;; We expect type = NIL when we have no information. Should be fixed. FIXME! + ((null type) + :object) + ((getf +representation-types+ type) + type) + (t + (do ((l +representation-types+ (cddr l))) + ((endp l) :object) + (when (subtypep type (first (second l))) + (return-from lisp-type->rep-type (first l))))))) (defun rep-type-name (type) (or (second (getf +representation-types+ type)) @@ -100,6 +105,7 @@ (C-INLINE (let ((type (first (second loc)))) (if (lisp-type-p type) type (rep-type->lisp-type type)))) (BIND (var-type (second loc))) + (LCL (or (third loc) T)) (otherwise T))))) (defun loc-representation-type (loc) @@ -116,6 +122,7 @@ (C-INLINE (let ((type (first (second loc)))) (if (lisp-type-p type) (lisp-type->rep-type type) type))) (BIND (var-rep-type (second loc))) + (LCL (lisp-type->rep-type (or (third loc) T))) (otherwise :object))))) (defun wt-coerce-loc (dest-rep-type loc) diff --git a/src/cmp/cmploc.lsp b/src/cmp/cmploc.lsp index 780c6e20d..b3db0a1ed 100644 --- a/src/cmp/cmploc.lsp +++ b/src/cmp/cmploc.lsp @@ -22,7 +22,7 @@ ;;; ( VALUE i ) VALUES(i) ;;; ( VV vv-index ) ;;; ( VV-temp vv-index ) -;;; ( LCL lcl ) local variable, type unboxed +;;; ( LCL lcl [representation-type]) local variable, type unboxed ;;; ( TEMP temp ) local variable, type object ;;; ( CALL c-fun-name args fname ) locs are locations containing the arguments ;;; ( CALL-NORMAL fun locs) similar as CALL, but number of arguments is fixed @@ -150,7 +150,7 @@ (wt "VVtemp[" vv "]") (wt vv))) -(defun wt-lcl-loc (lcl) +(defun wt-lcl-loc (lcl &optional type) (wt-lcl lcl)) (defun wt-temp (temp)