mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 22:01:36 -08:00
Added some IGNORE declarations and fixed some references to undefined variables.
This commit is contained in:
parent
d1b82f3e8d
commit
d5fd199116
17 changed files with 43 additions and 5 deletions
|
|
@ -45,6 +45,7 @@
|
|||
body))))
|
||||
|
||||
(defun c2block (c1form blk body)
|
||||
(declare (ignore c1form))
|
||||
(if (plusp (var-ref (blk-var blk)))
|
||||
(let* ((blk-var (blk-var blk))
|
||||
(*env-lvl* *env-lvl*))
|
||||
|
|
@ -104,7 +105,7 @@
|
|||
output)))))
|
||||
|
||||
(defun c2return-from (c1form blk type val var)
|
||||
(declare (ignore var))
|
||||
(declare (ignore var c1form))
|
||||
(case type
|
||||
(CCB
|
||||
(let ((*destination* 'VALUES)) (c2expr* val))
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
(cmperr "Malformed function name: ~A" fun)))))
|
||||
|
||||
(defun c2funcall (c1form form args)
|
||||
(declare (ignore c1form))
|
||||
(let* ((*inline-blocks* 0)
|
||||
(*temp* *temp*)
|
||||
(form-type (c1form-primary-type form))
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
(c1progn (rest args))))
|
||||
|
||||
(defun c2catch (c1form tag body)
|
||||
(declare (ignore c1form))
|
||||
(let* ((new-destination (tmp-destination *destination*)))
|
||||
(let* ((*destination* 'VALUE0))
|
||||
(c2expr* tag))
|
||||
|
|
@ -55,6 +56,7 @@
|
|||
:args form (c1progn (rest args)))))
|
||||
|
||||
(defun c2unwind-protect (c1form form body)
|
||||
(declare (ignore c1form))
|
||||
(let* ((sp (make-lcl-var :rep-type :cl-index))
|
||||
(nargs (make-lcl-var :rep-type :cl-index))
|
||||
(*unwind-exit* `((STACK ,sp) ,@*unwind-exit*)))
|
||||
|
|
@ -91,6 +93,7 @@
|
|||
(make-c1form* 'THROW :args (c1expr (first args)) (c1expr (second args))))
|
||||
|
||||
(defun c2throw (c1form tag val &aux loc)
|
||||
(declare (ignore c1form))
|
||||
(case (c1form-name tag)
|
||||
((VAR LOCATION) (setq loc (c1form-arg 0 tag)))
|
||||
(t (setq loc (make-temp-var))
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@
|
|||
(make-c1form* 'PROGN :type output-type :args fl)))))
|
||||
|
||||
(defun c2progn (c1form forms)
|
||||
(declare (ignore c1form))
|
||||
;; c1progn ensures that the length of forms is not less than 1.
|
||||
(do ((l forms (cdr l))
|
||||
(lex *lex*))
|
||||
|
|
|
|||
|
|
@ -586,6 +586,7 @@
|
|||
'VALUES))))))
|
||||
|
||||
(defun c2c-inline (c1form arguments &rest rest)
|
||||
(declare (ignore c1form))
|
||||
(let ((*inline-blocks* 0)
|
||||
(*temp* *temp*))
|
||||
(unwind-exit (apply #'produce-inline-loc (inline-args arguments) rest))
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@
|
|||
&aux block-p
|
||||
(*env* *env*)
|
||||
(*env-lvl* *env-lvl*) env-grows)
|
||||
(declare (ignore c1form))
|
||||
;; create location for each function which is returned,
|
||||
;; either in lexical:
|
||||
(dolist (fun funs)
|
||||
|
|
@ -257,7 +258,8 @@
|
|||
fun))
|
||||
|
||||
(defun c2call-local (c1form fun args)
|
||||
(declare (type fun fun))
|
||||
(declare (type fun fun)
|
||||
(ignore c1form))
|
||||
(unless (c2try-tail-recursive-call fun args)
|
||||
(let ((*inline-blocks* 0)
|
||||
(*temp* *temp*))
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@
|
|||
(wt-label ,label))))
|
||||
|
||||
(defun c2if (c1form fmla form1 form2)
|
||||
(declare (ignore c1form))
|
||||
;; FIXME! Optimize when FORM1 or FORM2 are constants
|
||||
(with-exit-label (normal-exit)
|
||||
(with-exit-label (false-label)
|
||||
|
|
@ -106,6 +107,7 @@
|
|||
(otherwise (return-from negate-argument nil)))))))
|
||||
|
||||
(defun c2fmla-not (c1form arg)
|
||||
(declare (ignore c1form))
|
||||
(let ((dest *destination*))
|
||||
(cond ((and (consp dest) (eq (car dest) 'JUMP-TRUE))
|
||||
(let ((*destination* `(JUMP-FALSE ,@(cdr dest))))
|
||||
|
|
@ -130,6 +132,7 @@
|
|||
(and (consp dest) (eq (car dest) 'JUMP-FALSE))))
|
||||
|
||||
(defun c2fmla-and (c1form butlast last)
|
||||
(declare (ignore c1form))
|
||||
(if (jump-false-destination?)
|
||||
(progn
|
||||
(mapc #'c2expr* butlast)
|
||||
|
|
@ -142,6 +145,7 @@
|
|||
(unwind-exit nil))))
|
||||
|
||||
(defun c2fmla-or (c1form butlast last)
|
||||
(declare (ignore c1form))
|
||||
(cond ((jump-true-destination?)
|
||||
(mapc #'c2expr* butlast)
|
||||
(c2expr last))
|
||||
|
|
|
|||
|
|
@ -139,6 +139,9 @@
|
|||
(and-form-type (var-type var) form (var-name var) :unsafe "In LET body")
|
||||
(let ((form-type (c1form-primary-type form)))
|
||||
(setf (var-type var) form-type)
|
||||
(unless (var-type var)
|
||||
(setf c::*compiler-break-enable* t)
|
||||
(break))
|
||||
(update-variable-type var form-type)))
|
||||
|
||||
(defun c1let-unused-variable-p (var form)
|
||||
|
|
|
|||
|
|
@ -182,7 +182,9 @@
|
|||
|
||||
(defun wt-keyvars (i) (wt "keyvars[" i "]"))
|
||||
|
||||
(defun wt-the (type loc) (wt-loc loc))
|
||||
(defun wt-the (type loc)
|
||||
(declare (ignore type))
|
||||
(wt-loc loc))
|
||||
|
||||
(defun loc-refers-to-special (loc)
|
||||
(cond ((var-p loc)
|
||||
|
|
@ -230,6 +232,7 @@
|
|||
(wt ";"))))))))
|
||||
|
||||
(defun set-the-loc (loc type orig-loc)
|
||||
(declare (ignore type))
|
||||
(let ((*destination* orig-loc))
|
||||
(set-loc loc)))
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@
|
|||
(make-c1form* 'VALUES :args (c1args* args)))
|
||||
|
||||
(defun c2values (c1form forms)
|
||||
(declare (ignore c1form))
|
||||
(when (and (eq *destination* 'RETURN-OBJECT)
|
||||
(rest forms)
|
||||
(consp *current-form*)
|
||||
|
|
@ -225,6 +226,7 @@
|
|||
output))
|
||||
|
||||
(defun c2multiple-value-setq (c1form vars form)
|
||||
(declare (ignore c1form))
|
||||
(multiple-value-bind (min-values max-values)
|
||||
(c1form-values-number form)
|
||||
(unwind-exit
|
||||
|
|
@ -258,6 +260,7 @@
|
|||
:args vars init-form body)))))
|
||||
|
||||
(defun c2multiple-value-bind (c1form vars init-form body)
|
||||
(declare (ignore c1form))
|
||||
;; 0) Compile the form which is going to give us the values
|
||||
(let ((*destination* 'VALUES)) (c2expr* init-form))
|
||||
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ of the occurrences in those lists."
|
|||
|
||||
(defun p1psetq (c1form assumptions vars c1forms)
|
||||
(loop for form in c1forms
|
||||
do (multiple-value-setq (new-type assumptions)
|
||||
do (multiple-value-bind (new-type assumptions)
|
||||
(p1propagate form assumptions)))
|
||||
(values 'null assumptions))
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
(make-c1form 'COMPILER-LET args symbols values args))
|
||||
|
||||
(defun c2compiler-let (c1form symbols values body)
|
||||
(declare (ignore c1form))
|
||||
(progv symbols values (c2expr body)))
|
||||
|
||||
(defun c1function (args &aux fd)
|
||||
|
|
@ -83,6 +84,7 @@
|
|||
(t (cmperr "The function ~s is illegal." fun)))))
|
||||
|
||||
(defun c2function (c1form kind funob fun)
|
||||
(declare (ignore c1form))
|
||||
(case kind
|
||||
(GLOBAL
|
||||
(unwind-exit (list 'FDEFINITION fun)))
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
:args body)))
|
||||
|
||||
(defun c2with-stack (c1form body)
|
||||
(declare (ignore c1form))
|
||||
(let* ((new-destination (tmp-destination *destination*))
|
||||
(*temp* *temp*))
|
||||
(wt-nl "{ struct ecl_stack_frame _ecl_inner_frame_aux;")
|
||||
|
|
@ -66,6 +67,7 @@
|
|||
:one-liner t :side-effects t)))))
|
||||
|
||||
(defun c2stack-push-values (c1form form push-statement)
|
||||
(declare (ignore c1form))
|
||||
(let ((*destination* 'VALUES))
|
||||
(c2expr* form))
|
||||
(c2expr push-statement))
|
||||
|
|
|
|||
|
|
@ -124,7 +124,8 @@
|
|||
:args tag-var body))
|
||||
|
||||
(defun c2tagbody (c1form tag-loc body)
|
||||
(declare (type var tag-loc))
|
||||
(declare (type var tag-loc)
|
||||
(ignore c1form))
|
||||
(if (null (var-kind tag-loc))
|
||||
;; only local goto's
|
||||
(let ((label (next-label)))
|
||||
|
|
@ -210,6 +211,7 @@
|
|||
(add-to-read-nodes var (make-c1form* 'GO :args tag (or ccb clb unw)))))))
|
||||
|
||||
(defun c2go (c1form tag nonlocal)
|
||||
(declare (ignore c1form))
|
||||
(if nonlocal
|
||||
(let ((var (tag-var tag)))
|
||||
(wt-nl "cl_go(" var ",MAKE_FIXNUM(" (tag-index tag) "));"))
|
||||
|
|
|
|||
|
|
@ -299,9 +299,11 @@ return f2;
|
|||
(c1progn 'NIL)))))
|
||||
|
||||
(defun t2compiler-let (c1form symbols values body)
|
||||
(declare (ignore c1form))
|
||||
(progv symbols values (c2expr body)))
|
||||
|
||||
(defun t2progn (c1form args)
|
||||
(declare (ignore c1form))
|
||||
(mapc #'t2expr args))
|
||||
|
||||
(defun exported-fname (name)
|
||||
|
|
@ -510,6 +512,7 @@ return f2;
|
|||
(p1propagate form assumptions))
|
||||
|
||||
(defun t2ordinary (c1form form)
|
||||
(declare (ignore c1form))
|
||||
(let* ((*exit* (next-label))
|
||||
(*unwind-exit* (list *exit*))
|
||||
(*destination* 'TRASH))
|
||||
|
|
@ -554,18 +557,21 @@ return f2;
|
|||
(make-c1form* 'LOCATION :type t :args loc)))
|
||||
|
||||
(defun t2load-time-value (c1form vv-loc form)
|
||||
(declare (ignore c1form))
|
||||
(let* ((*exit* (next-label)) (*unwind-exit* (list *exit*))
|
||||
(*destination* vv-loc))
|
||||
(c2expr form)
|
||||
(wt-label *exit*)))
|
||||
|
||||
(defun t2make-form (c1form vv-loc form)
|
||||
(declare (ignore c1form))
|
||||
(let* ((*exit* (next-label)) (*unwind-exit* (list *exit*))
|
||||
(*destination* vv-loc))
|
||||
(c2expr form)
|
||||
(wt-label *exit*)))
|
||||
|
||||
(defun t2init-form (c1form vv-loc form)
|
||||
(declare (ignore c1form))
|
||||
(let* ((*exit* (next-label)) (*unwind-exit* (list *exit*))
|
||||
(*destination* 'TRASH))
|
||||
(c2expr form)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
:args var expressions)))))
|
||||
|
||||
(defun c2compiler-typecase (c1form var expressions)
|
||||
(declare (ignore c1form))
|
||||
(loop with var-type = (var-type var)
|
||||
for (type form) in expressions
|
||||
when (or (member type '(t otherwise))
|
||||
|
|
|
|||
|
|
@ -372,6 +372,7 @@
|
|||
`(setf name ,form)))
|
||||
|
||||
(defun c2setq (c1form vref form)
|
||||
(declare (ignore c1form))
|
||||
;; First comes the assignement
|
||||
(let ((*destination* vref))
|
||||
(c2expr* form))
|
||||
|
|
@ -389,6 +390,7 @@
|
|||
:args symbols values forms)))
|
||||
|
||||
(defun c2progv (c1form symbols values body)
|
||||
(declare (ignore c1form))
|
||||
(let* ((*lcl* *lcl*)
|
||||
(lcl (next-lcl))
|
||||
(sym-loc (make-lcl-var))
|
||||
|
|
@ -439,6 +441,7 @@
|
|||
forms))))
|
||||
|
||||
(defun c2psetq (c1form vrefs forms &aux (*lcl* *lcl*) (saves nil) (blocks 0))
|
||||
(declare (ignore c1form))
|
||||
;; similar to inline-args
|
||||
(do ((vrefs vrefs (cdr vrefs))
|
||||
(forms forms (cdr forms))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue