1.0.48.9: better source information for compile-time type errors
[sbcl.git] / src / compiler / fndb.lisp
index 66d8f46..9f1085f 100644 (file)
@@ -80,7 +80,7 @@
 ;;;; classes
 
 (sb!xc:deftype name-for-class () t)
-(defknown classoid-name (classoid) name-for-class (flushable))
+(defknown classoid-name (classoid) symbol (flushable))
 (defknown find-classoid (name-for-class &optional t)
   (or classoid null) ())
 (defknown classoid-of (t) classoid (flushable))
   (movable foldable flushable explicit-check))
 
 (defknown decode-float (float) (values float float-exponent float)
-  (movable foldable flushable explicit-check))
+  (movable foldable unsafely-flushable explicit-check))
 (defknown scale-float (float integer) float
   (movable foldable unsafely-flushable explicit-check))
 (defknown float-radix (float) float-radix
-  (movable foldable flushable))
+  (movable foldable unsafely-flushable))
 (defknown float-sign (float &optional float) float
-  (movable foldable flushable explicit-check))
+  (movable foldable unsafely-flushable explicit-check))
 (defknown (float-digits float-precision) (float) float-digits
-  (movable foldable flushable explicit-check))
+  (movable foldable unsafely-flushable explicit-check))
 (defknown integer-decode-float (float)
-          (values integer float-int-exponent (member -1 1))
-          (movable foldable flushable explicit-check))
+    (values integer float-int-exponent (member -1 1))
+    (movable foldable unsafely-flushable explicit-check))
 
 (defknown complex (real &optional real) number
   (movable foldable flushable explicit-check))
 (defknown deposit-field (integer byte-specifier integer) integer
   (movable foldable flushable))
 (defknown random ((or (float (0.0)) (integer 1)) &optional random-state)
-  (or (float 0.0) (integer 0)) ())
-(defknown make-random-state (&optional (or (member nil t) random-state))
+  (or (float 0.0) (integer 0))
+  (explicit-check))
+(defknown make-random-state (&optional
+                             (or (member nil t) random-state unsigned-byte
+                                 (simple-array (unsigned-byte 8) (*))
+                                 (simple-array (unsigned-byte 32) (*))))
   random-state (flushable))
 (defknown random-state-p (t) boolean (movable foldable flushable))
 \f
 
 (defknown array-has-fill-pointer-p (array) boolean
   (movable foldable flushable))
-(defknown fill-pointer (vector) index (foldable unsafely-flushable))
-(defknown vector-push (t vector) (or index null) ()
+(defknown fill-pointer (complex-vector) index
+    (unsafely-flushable explicit-check))
+(defknown vector-push (t complex-vector) (or index null)
+    (explicit-check)
   :destroyed-constant-args (nth-constant-args 2))
-(defknown vector-push-extend (t vector &optional (and index (integer 1)))
-  index ()
+(defknown vector-push-extend (t complex-vector &optional (and index (integer 1))) index
+    (explicit-check)
   :destroyed-constant-args (nth-constant-args 2))
-(defknown vector-pop (vector) t ()
+(defknown vector-pop (complex-vector) t
+    (explicit-check)
   :destroyed-constant-args (nth-constant-args 1))
 
 ;;; FIXME: complicated :DESTROYED-CONSTANT-ARGS
   (flushable unsafe))
 (defknown make-string-output-stream
     (&key (:element-type type-specifier))
-    stream
+    string-output-stream
   (flushable))
 (defknown get-output-stream-string (stream) simple-string ())
 (defknown streamp (t) boolean (movable foldable flushable))
                                            :rename-and-delete :overwrite
                                            :append :supersede nil))
                        (:if-does-not-exist (member :error :create nil))
-                       (:external-format keyword))
+                       (:external-format external-format-designator))
   (or stream null))
 
 (defknown rename-file (pathname-designator filename)
    (:verbose t)
    (:print t)
    (:if-does-not-exist t)
-   (:external-format keyword))
+   (:external-format external-format-designator))
   t)
 
 (defknown directory (pathname-designator &key (:resolve-symlinks t))
 \f
 ;;;; from the "Conditions" chapter:
 
-(defknown cell-error-name (cell-error) t)
 (defknown error (t &rest t) nil)
 (defknown cerror (format-control t &rest t) null)
 (defknown invalid-method-error (t format-control &rest t) *) ; FIXME: first arg is METHOD
 (defknown method-combination-error (format-control &rest t) *)
 (defknown signal (t &rest t) null)
-(defknown simple-condition-format-control (condition)
-  format-control)
-(defknown simple-condition-format-arguments (condition)
-  list)
 (defknown warn (t &rest t) null)
 (defknown invoke-debugger (condition) nil)
 (defknown break (&optional format-control &rest t) null)
   null)
 
 ;;; and analogous SBCL extension:
+(defknown sb!impl::%failed-aver (t) nil)
 (defknown bug (t &rest t) nil) ; never returns
+
 \f
 ;;;; from the "Miscellaneous" Chapter:
 
                      (member t)))
    (:verbose t)
    (:print t)
-   (:external-format keyword)
+   (:external-format external-format-designator)
 
    ;; extensions
    (:trace-file t)
-   (:block-compile t))
+   (:block-compile t)
+   (:emit-cfasl t))
   (values (or pathname null) boolean boolean))
 
 ;; FIXME: consider making (OR CALLABLE CONS) something like
 (defknown get-bytes-consed () unsigned-byte (flushable))
 (defknown mask-signed-field ((integer 0 *) integer) integer
           (movable flushable foldable))
+
+(defknown array-storage-vector (array) (simple-array * (*))
+    (any))
 \f
 ;;;; magical compiler frobs
 
 (defknown %typep (t (or type-specifier ctype)) boolean
   (movable flushable explicit-check))
 (defknown %instance-typep (t (or type-specifier ctype)) boolean
-  (movable flushable explicit-check))
+  (movable flushable explicit-check always-translatable))
 
 (defknown %cleanup-point () t)
 (defknown %special-bind (t t) t)
 
 ;; FIXME: This function does not return, but due to the implementation
 ;; of FILTER-LVAR we cannot write it here.
-(defknown %compile-time-type-error (t t t) *)
+(defknown %compile-time-type-error (t t t t) *)
+(defknown sb!kernel::case-failure (t t t) nil)
 
 (defknown %odd-key-args-error () nil)
 (defknown %unknown-key-arg-error (t) nil)
 (defknown %set-symbol-plist (symbol list) list (unsafe))
 (defknown %setnth (unsigned-byte list t) t (unsafe)
   :destroyed-constant-args (nth-constant-args 2))
-(defknown %set-fill-pointer (vector index) index (unsafe)
+(defknown %set-fill-pointer (complex-vector index) index
+    (unsafe explicit-check)
   :destroyed-constant-args (nth-constant-args 1))
 \f
 ;;;; ALIEN and call-out-to-C stuff
   ())
 (defknown style-warn (t &rest t) null ())
 
+
+;;;; memory barriers
+
+(defknown sb!vm:%compiler-barrier () (values) ())
+(defknown sb!vm:%memory-barrier () (values) ())
+(defknown sb!vm:%read-barrier () (values) ())
+(defknown sb!vm:%write-barrier () (values) ())
+(defknown sb!vm:%data-dependency-barrier () (values) ())
+
+
 ;;;; atomic ops
 (defknown %compare-and-swap-svref (simple-vector index t t) t
     (unsafe))