diff --git a/compiler/array-tran.lisp b/compiler/array-tran.lisp index 76449e95b9fc0eba29395c5ccb4a675b498e0ece..e4fcd9112843980392bb88cf6d9166d04c962597 100644 --- a/compiler/array-tran.lisp +++ b/compiler/array-tran.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/array-tran.lisp,v 1.19 1997/04/01 19:23:56 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/array-tran.lisp,v 1.20 1997/08/24 03:46:45 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -580,3 +580,23 @@ (deftransform bit-not ((bit-array-1 result-bit-array) (bit-vector (constant-argument t))) '(bit-not bit-array-1 bit-array-1)) + + +;;; ARRAY-HEADER-P -- transform. +;;; +;;; Pick off some constant cases. +;;; +(deftransform array-header-p ((array) (array)) + (let ((type (continuation-type array))) + (declare (optimize (safety 3))) + (unless (array-type-p type) + (give-up)) + (let ((dims (array-type-dimensions type))) + (cond ((csubtypep type (specifier-type '(simple-array * (*)))) + ;; No array header. + nil) + ((and (listp dims) (> (length dims) 1)) + ;; Multi-dimensional array, will have a header. + t) + (t + (give-up))))))