Changeset 9620


Ignore:
Timestamp:
May 29, 2008, 6:47:03 PM (11 years ago)
Author:
gz
Message:

Warn about declarations referring to unknown variables; then fix a whole bunch of them in ccl, a surprisingly large number of which actually mattered

Location:
branches/working-0711/ccl
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/X86/x86-backend.lisp

    r7859 r9620  
    5656    (let* ((name (string (car form)))
    5757           (templates (gethash name x86::*x86-opcode-template-lists*)))
    58       (declare (fixnum node-size))
    5958      (when templates
    6059        (flet ((optype (thing)
     
    149148               (error "Duplicate name ~s in vinsn ~s" vname vinsn-name)
    150149               (push vname name-list))))
    151       (declare (dynamic-extent valid-spec-name add-spec-name))
     150      (declare (dynamic-extent #'valid-spec-name #'add-spec-name))
    152151      (when (consp vinsn-name)
    153152        (setq attrs (encode-vinsn-attributes (cdr vinsn-name))
  • branches/working-0711/ccl/compiler/X86/x86-lap.lisp

    r8867 r9620  
    13741374         (code-words (ash code-bytes (- target::word-shift)))
    13751375         (function-vector (allocate-typed-vector :function code-words)))
    1376     (declare (fixnum num-constants code-bytes code-words))
     1376    (declare (fixnum code-bytes code-words))
    13771377    (let* ((target-offset 0))
    13781378      (declare (fixnum target-offset))
  • branches/working-0711/ccl/compiler/X86/x862.lisp

    r9578 r9620  
    51385138        (let* ((num-temp-frames 0)
    51395139               (num-c-frames 0))
    5140           (declare (fixnum numnlispareas num-c-frames))
     5140          (declare (fixnum num-temp-frames num-c-frames))
    51415141          (flet ((pop-temp-frames ()
    51425142                   (dotimes (i num-temp-frames)
     
    57065706           (reserved-lcells nil)
    57075707           (*x862-vstack* 0))
    5708       (declare (type (unsigned-byte 16) num-req num-opt num-inh reqvloc))
     5708      (declare (type (unsigned-byte 16) num-req num-opt num-inh))
    57095709      (with-x86-p2-declarations p2decls
    57105710        (setq *x862-inhibit-register-allocation*
     
    67836783           (*x862-top-vstack-lcell* *x862-top-vstack-lcell*)
    67846784           (nargs (x862-formlist seg (car arglist) (cadr arglist))))
    6785       (declare (fixnum args))
     6785      (declare (fixnum nargs))
    67866786      (when (> nargs 1)
    67876787        (x862-set-nargs seg (1- nargs))
     
    86818681         (ngpr-args 0)
    86828682         (simple-foreign-args nil))
    8683       (declare (fixnum   ngpr-args narg-words
     8683      (declare (fixnum  ngpr-args nother-words
    86848684                        gpr-offset other-offset))
    86858685      (dolist (argspec argspecs)
     
    87818781         (fp-loads ())
    87828782         (return-registers ()))
    8783       (declare (fixnum  nshort-floats ndouble-floats nfpr-args ngpr-args narg-words
     8783      (declare (fixnum  nsingle-floats ndouble-floats nfpr-args ngpr-args nother-words
    87848784                        gpr-offset other-offset single-float-offset double-float-offset))
    87858785      (dolist (argspec argspecs)
  • branches/working-0711/ccl/compiler/nx-basic.lisp

    r9578 r9620  
    498498    (:unknown-declaration . "Unknown declaration ~S")
    499499    (:unknown-type-declaration . "Unknown type ~S")
     500    (:unknown-declaration-variable . "~s declaration for unknown variable ~s")
    500501    (:macro-used-before-definition . "Macro function ~S was used before it was defined.")
    501502    (:unsettable . "Shouldn't assign to variable ~S")
  • branches/working-0711/ccl/compiler/nx0.lisp

    r9578 r9620  
    681681           (%cadr acode-expression)))))
    682682
     683(defun nx-check-vdecl-var-ref (decl)
     684  (unless (eq (cadr decl) 'special)
     685    (let* ((sym (car decl))
     686           (info (nx-lex-info sym)))
     687      (when (or (eq info :symbol-macro)
     688                (and (null info) (not (nx-proclaimed-special-p sym))))
     689        (nx1-whine :unknown-declaration-variable (cadr decl) sym)))))
     690
     691
    683692(defun nx-effect-other-decls (pending env)
    684693  (flet ((merge-decls (new old)
     
    691700          (dolist (decl vdecls (setf (lexenv.vdecls env) env-vdecls))
    692701            (unless (memq decl env-vdecls)
     702              (nx-check-vdecl-var-ref decl)
    693703              (when (eq (cadr decl) 'type)
    694704                (let* ((var (car decl))
  • branches/working-0711/ccl/compiler/optimizers.lisp

    r9617 r9620  
    17231723
    17241724(define-compiler-macro slot-boundp (&whole whole instance slot-name-form)
    1725   (declare (ignore env))
    17261725  (let* ((name (and (quoted-form-p slot-name-form)
    17271726                    (typep (cadr slot-name-form) 'symbol)
  • branches/working-0711/ccl/compiler/vinsn.lisp

    r7941 r9620  
    370370         (*available-backend-crf-temps* *available-backend-crf-temps*))
    371371    (declare (fixnum nvp ntemps nsupp)
    372              (list result-specs temp-specs arg-specs))
     372             (list temp-specs))
    373373    (unless (= nsupp nra)
    374374      (error "Vinsn ~A expects ~D result/argument specs, received ~D ."
     
    611611(defun create-flow-graph (vinsns)
    612612  (let* ((nodes ()))
    613     (declare (fixnum id))
    614613    (flet ((label->fgn (label) (dll-node-pred label)))
    615614      (loop
     
    622621                             (make-condnode id)
    623622                             (make-jumpnode id)))))
     623              (declare (fixnum id))
    624624              (insert-dll-node-after label node last)
    625625              (push node nodes))))
  • branches/working-0711/ccl/level-0/l0-hash.lisp

    r9578 r9620  
    11491149         (vector-index (index->vector-index (fast-mod hash-code (ash count -1))))
    11501150         (table-key (%svref vector vector-index)))
    1151     (declare (fixnum hash-code length count entries vector-index))
     1151    (declare (fixnum hash-code length count vector-index))
    11521152    (if (or (eq key table-key)
    11531153            (eq table-key free-hash-key-marker))
  • branches/working-0711/ccl/level-0/l0-int.lisp

    r5079 r9620  
    125125                    )  ; warn
    126126               (declare (dynamic-extent temstring)
    127                         (fixnum i strlen rem))
     127                        (fixnum i strlen))
    128128               (flet ((do-it (newbig)
    129129                        (print-bignum-2 newbig radix temstring digit-string)))
  • branches/working-0711/ccl/level-0/l0-misc.lisp

    r7925 r9620  
    639639         (level *interrupt-level*)
    640640         (ptr (recursive-lock-ptr lock)))
    641     (declare (fixnum self val))
     641    (declare (fixnum self))
    642642    (note-lock-wait lock)
    643643    (without-interrupts
  • branches/working-0711/ccl/level-0/nfasload.lisp

    r9578 r9620  
    7373         (bufptr (%get-ptr buffer)))
    7474    (declare (dynamic-extent bufptr)
    75              (type macptr buffer bufptr pb))
     75             (type macptr buffer bufptr))
    7676    (%setf-macptr bufptr (%inc-ptr buffer target::node-size))
    7777    (setf (%get-ptr buffer) bufptr)
     
    169169         (n nchars)
    170170         (str (faslstate.faslstr s)))
    171     (declare (fixnum n nbytes))
     171    (declare (fixnum n nchars))
    172172    (if (> n (length str))
    173173        (setq str (make-string n :element-type 'base-char))
     
    205205
    206206(defun %fasl-vmake-symbol (s &optional idx)
    207   (declare (fixnum subtype))
    208207  (let* ((n (%fasl-read-count s))
    209208         (str (make-string n :element-type 'base-char)))
     
    215214
    216215(defun %fasl-nvmake-symbol (s &optional idx)
    217   (declare (fixnum subtype))
    218216  (let* ((n (%fasl-read-count s))
    219217         (str (make-string n :element-type 'base-char)))
     
    578576         (size-in-bytes (* element-count 4))
    579577         (num (%alloc-misc element-count target::subtag-bignum)))
    580     (declare (fixnum subtag element-count size-in-bytes))
     578    (declare (fixnum element-count size-in-bytes))
    581579    (%fasl-read-n-bytes s num 0 size-in-bytes)
    582580    (setq num (%normalize-bignum-2 t num))
  • branches/working-0711/ccl/level-1/l1-clos-boot.lisp

    r9604 r9620  
    15001500      (dolist (class cpl)
    15011501        (let* ((ordinal (instance.hash class)))
    1502           (declare (fixnum ordinale))
     1502          (declare (fixnum ordinal))
    15031503          (when (> ordinal max)
    15041504            (setq max ordinal))))
     
    26402640
    26412641(defmethod initialize-instance ((instance standard-object) &rest initargs)
    2642   (declare (dynamic-extent ini targs))
     2642  (declare (dynamic-extent initargs))
    26432643  (apply 'shared-initialize instance t initargs))
    26442644
     
    33393339         (new-object (allocate-instance new-class)))
    33403340    (declare (fixnum num-new-instance-slots)
    3341              (simple-vector new-instance-slots old-instance-slots))
     3341             (simple-vector new-instance-slots-vector old-instance-slots-vector))
    33423342    ;; Retain local slots shared between the new class and the old.
    33433343    (do* ((new-pos 0 (1+ new-pos))
    33443344          (new-slot-location 1 (1+ new-slot-location)))
    33453345         ((= new-pos num-new-instance-slots))
    3346       (declare (fixnum new-pos new-slot-vector-pos))
     3346      (declare (fixnum new-pos new-slot-location))
    33473347      (let* ((old-pos (position (svref new-instance-slots-vector new-pos)
    33483348                                old-instance-slots-vector :test #'eq)))
  • branches/working-0711/ccl/level-1/l1-io.lisp

    r9484 r9620  
    718718(defun print-a-float (float stream &optional exp-p nanning)
    719719  (let ((strlen 0) (exponent-char (float-exponent-char float)))
    720     (declare (fixnum exp strlen))
     720    (declare (fixnum strlen))
    721721    (setq stream (%real-print-stream stream))
    722722    (if (and (not nanning)(nan-or-infinity-p float))
     
    724724      (multiple-value-bind (string before-pt #|after-pt|#)
    725725                           (flonum-to-string float)
    726         (declare (fixnum before-pt after-pt))
     726        (declare (fixnum before-pt #|after-pt|#))
    727727        (setq strlen (length string))
    728728        (when (minusp (float-sign float))
     
    966966        (i 0 (1+ i)))
    967967       ((= i limit))
    968     (declare (type fixnum last)) (declare (type fixnum limit) (type fixnum i))
     968    (declare (type fixnum limit) (type fixnum i))
    969969    (let* ((char (char string i))
    970970           (needs-escape? (%char-needs-escape-p char #\\ delim)))
     
    10531053                           (return nil))
    10541054                         (setq sofar c-case))))))))
    1055         (declare (dynamic-extent slashify? single-case-p))
     1055        (declare (dynamic-extent #'slashify? #'single-case-p))
    10561056        (block alice
    10571057          (let ((len (length name))
  • branches/working-0711/ccl/level-1/l1-processes.lisp

    r9181 r9620  
    166166                          (allocation-quantum (default-allocation-quantum)))
    167167  "Create and return a new process."
    168   (declare (ignore flavor))
    169168  (let* ((p (make-instance
    170169             class
  • branches/working-0711/ccl/level-1/l1-reader.lisp

    r9578 r9620  
    24102410        (let* ((string (token.string tb))
    24112411               (len (token.opos tb)))
    2412           (declare (fixnum len ndots nondots))
     2412          (declare (fixnum len))
    24132413          (if (not nondots)
    24142414            (if (= len 1)
  • branches/working-0711/ccl/level-1/l1-streams.lisp

    r9578 r9620  
    23772377        (rcf (ioblock-read-char-when-locked-function ioblock)))
    23782378       ((= i end) end)
    2379     (declare (fixnum i need))
     2379    (declare (fixnum i))
    23802380    (let* ((ch (funcall rcf ioblock)))
    23812381      (if (eq ch :eof)
     
    26462646;;; strings.
    26472647(defun %ioblock-write-simple-string-with-newline-translation (ioblock string start-pos num-chars)
    2648   (declare (fixnum start-char num-chars) (simple-string string))
     2648  (declare (fixnum start-pos num-chars) (simple-string string))
    26492649  (let* ((col (ioblock-charpos ioblock))
    26502650         (wcf (ioblock-write-char-when-locked-function ioblock)))
  • branches/working-0711/ccl/level-1/l1-symhash.lisp

    r9578 r9620  
    448448             (ivec (car itab))
    449449             (icount&limit (cdr itab)))
    450         (declare (type cons etab itab icount&limit))
     450        (declare (type cons itab icount&limit))
    451451        (setf (svref evec external-offset) (package-deleted-marker))
    452452        (setf (svref ivec internal-offset) (%symbol->symptr foundsym))
  • branches/working-0711/ccl/level-1/l1-unicode.lisp

    r9578 r9620  
    33323332             (index idx))
    33333333            ((= index end) index)
    3334          (declare (fixnum i len index))
     3334         (declare (fixnum i end index))
    33353335         (let* ((1st-unit (%native-u8-ref-u16 vector index)))
    33363336           (declare (type (unsigned-byte 16) 1st-unit))
     
    33763376             (index idx))
    33773377            ((>= index end) index)
    3378          (declare (fixnum i index p))
     3378         (declare (fixnum i index end))
    33793379         (let* ((1st-unit (%get-unsigned-word pointer index)))
    33803380           (declare (type (unsigned-byte 16) 1st-unit))
     
    34963496           (index idx))
    34973497          ((= index end) index)
    3498        (declare (fixnum i len index))
     3498       (declare (fixnum i end index))
    34993499       (let* ((1st-unit (%reversed-u8-ref-u16 vector index)))
    35003500         (declare (type (unsigned-byte 16) 1st-unit))
     
    35403540           (index idx))
    35413541          ((>= index end) index)
    3542        (declare (fixnum i index p))
     3542       (declare (fixnum i index end))
    35433543       (let* ((1st-unit (%swap-u16 (%get-unsigned-word pointer index))))
    35443544         (declare (type (unsigned-byte 16) 1st-unit))
     
    36733673             (index idx))
    36743674            ((= index end) index)
    3675          (declare (fixnum i len index))
     3675         (declare (fixnum i end index))
    36763676         (let* ((1st-unit (if swap
    36773677                            (%reversed-u8-ref-u16 vector index)
     
    37033703              (highbits (- code #x10000)))
    37043704         (declare (type (mod #x110000) code)
    3705                   (fixnum p highbits))
     3705                  (fixnum highbits))
    37063706         (cond ((< highbits 0)
    37073707                (setf (%get-unsigned-word pointer idx) #+big-endian-target code #+little-endian-target (%swap-u16 code))
     
    37213721   utf-16-memory-decode
    37223722   (lambda (pointer noctets idx string)
    3723      (declare (fixnum nunits idx))
     3723     (declare (fixnum noctets idx))
    37243724     (let* ((swap (when (> noctets 1)
    37253725                    (case (%get-unsigned-word pointer idx)
     
    37373737             (index idx ))
    37383738            ((>= index end) index)
    3739          (declare (fixnum i index p))
     3739         (declare (fixnum i index end))
    37403740         (let* ((1st-unit (%get-unsigned-word pointer index)))
    37413741           (declare (type (unsigned-byte 16) 1st-unit))
     
    38953895           (index idx (+ 2 index)))
    38963896          ((>= index end) index)
    3897        (declare (fixnum i len index))
     3897       (declare (fixnum i end index))
    38983898       (setf (schar string i)
    38993899             (or (code-char (%native-u8-ref-u16 vector index))
     
    39943994           (index idx (+ 2 index)))
    39953995          ((>= index end) index)
    3996        (declare (fixnum i len index))
     3996       (declare (fixnum i end index))
    39973997       (setf (schar string i)
    39983998             (or (code-char (%reversed-u8-ref-u16 vector index))
     
    40944094             (index idx (1+ index)))
    40954095            ((>= index end) index)
    4096          (declare (fixnum i len index))
     4096         (declare (fixnum i end index))
    40974097         (let* ((1st-unit (if swap
    40984098                            (%reversed-u8-ref-u16 vector index)
     
    42994299           (index idx (+ 4 index)))
    43004300          ((>= index end) index)
    4301        (declare (fixnum i len index))
     4301       (declare (fixnum i end index))
    43024302       (let* ((code (%native-u8-ref-u32 vector index)))
    43034303         (declare (type (unsigned-byte 32) code))
     
    43964396           (index idx (+ 4 index)))
    43974397          ((>= index end) index)
    4398        (declare (fixnum i len index))
     4398       (declare (fixnum i end index))
    43994399       (let* ((code (%reversed-u8-ref-u32 vector index)))
    44004400         (declare (type (unsigned-byte 32) code))
     
    44944494             (index idx (1+ index)))
    44954495            ((>= index end) index)
    4496          (declare (fixnum i len index))
     4496         (declare (fixnum i end index))
    44974497         (let* ((1st-unit (if swap
    44984498                            (%reversed-u8-ref-u32 vector index)
  • branches/working-0711/ccl/lib/dumplisp.lisp

    r8931 r9620  
    6464                         )
    6565  (declare (ignore toplevel-function error-handler application-class
    66                    resources clear-clos-caches init-file impurify
     66                   clear-clos-caches init-file impurify
    6767                   mode prepend-kernel))
    6868  (unless (probe-file (make-pathname :defaults nil
  • branches/working-0711/ccl/lib/macros.lisp

    r9578 r9620  
    23362336  (setq mname (require-type mname 'symbol))
    23372337  (let ((state (make-symbol "WITH-PACKAGE-ITERATOR_STATE")))
    2338     (declare (fixnum types))
    23392338    (dolist (type (push first-type other-types))
    23402339      (ecase type
  • branches/working-0711/ccl/lib/number-case-macro.lisp

    r2325 r9620  
    7070                       (append compound selectors-so-far))
    7171                 compound))))
    72       (declare (dynamic-extent maybe-compound))
     72      (declare (dynamic-extent #'maybe-compound))
    7373      `(block ,block
    7474         (tagbody
  • branches/working-0711/ccl/lib/sequences.lisp

    r9578 r9620  
    718718         (maxcnt (seq-dispatch result-sequence (length result-sequence) (array-total-size result-sequence)))
    719719         (rseq result-sequence))
    720     (declare (fixnum cnt nargs maxcnt))
     720    (declare (fixnum nargs maxcnt))
    721721    (declare (dynamic-extent temp))
    722722    ; this declaration is maybe bogus
     
    17121712        (count 0))
    17131713       ((= index end) count)
    1714     (declare (fixnum index count limit))
     1714    (declare (fixnum index count))
    17151715    (when (funcall test item  (funcall key (aref sequence index)))
    17161716      (incf count))))
     
    17311731        (count 0))
    17321732       ((= index end) count)
    1733     (declare (fixnum index count limit))
     1733    (declare (fixnum index count))
    17341734    (unless (funcall test-not item (funcall key (aref sequence index)))
    17351735      (incf count))))
  • branches/working-0711/ccl/lib/x86-backtrace.lisp

    r8037 r9620  
    219219             (p (- (%fixnum-ref fp target::xcf.backptr)
    220220                   (* target::node-size numinh))))
    221         (declare (fixnum numing nargs p))
     221        (declare (fixnum numinh nargs p))
    222222        (collect ((args))
    223223          (dotimes (i nargs (args))
     
    374374                       (ash 1 x8664::save2)
    375375                       (ash 1 x8664::save3))))
    376     (declare (fixnum have need)
     376    (declare (fixnum need)
    377377             (dynamic-extent locations))
    378378    (do* ((parent frame child)
  • branches/working-0711/ccl/xdump/xfasload.lisp

    r9578 r9620  
    494494    (setq subtag (type-keyword-code subtag)))
    495495  (locally
    496       (declare (fixnum subtype len))
     496      (declare (fixnum subtag len))
    497497      (multiple-value-bind (cell-addr data offset)
    498498          (target-word-size-case
     
    504504
    505505(defun xload-make-word-ivector (subtag len space)
    506   (declare (fixnum subtype len))
     506  (declare (fixnum subtag len))
    507507    (multiple-value-bind (cell-addr data offset) (xload-alloc-fullwords space  *xload-target-fulltag-misc* len)
    508508      (declare (fixnum offset))
     
    619619    (setq subtag (type-keyword-code subtag)))
    620620  (locally
    621       (declare (fixnum subtype nelements))
     621      (declare (fixnum subtag nelements))
    622622    (multiple-value-bind (addr v o) (xload-alloc space *xload-target-fulltag-misc* (xload-dnode-align (xload-subtag-bytes subtag nelements)))
    623623      (declare (fixnum o))
     
    843843(defun %xload-fasl-vreadstr (s)
    844844  (multiple-value-bind (str n new-p) (%fasl-vreadstr s)
    845     (declare (fixnum n subtype))
     845    (declare (fixnum n))
    846846    (values (xload-save-string str n) str n new-p)))
    847847
     
    850850(defun %xload-fasl-nvreadstr (s)
    851851  (multiple-value-bind (str n new-p) (%fasl-nvreadstr s)
    852     (declare (fixnum n subtype))
     852    (declare (fixnum n))
    853853    (values (xload-save-string str n) str n new-p)))
    854854
Note: See TracChangeset for help on using the changeset viewer.