mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-25 05:51:55 -08:00
cosmetic: cmp: declare unused variables as ignored
This commit is contained in:
parent
23428b8af9
commit
d29a26cf8a
9 changed files with 40 additions and 28 deletions
|
|
@ -217,6 +217,7 @@ the environment variable TMPDIR to a different value." template))
|
|||
|
||||
#+dlopen
|
||||
(defun bundle-cc (o-pathname init-name object-files)
|
||||
(declare (ignore init-name))
|
||||
(let ((ld-flags (split-program-options *ld-bundle-flags*))
|
||||
(ld-libs (split-program-options *ld-libs*)))
|
||||
#+msvc
|
||||
|
|
@ -236,7 +237,7 @@ the environment variable TMPDIR to a different value." template))
|
|||
#+mingw32
|
||||
(setf ld-flags (list* "-shared" "-Wl,--export-all-symbols" ld-flags))
|
||||
(linker-cc o-pathname object-files :type :fasl
|
||||
:ld-flags ld-flags :ld-libs ld-libs)))
|
||||
:ld-flags ld-flags :ld-libs ld-libs)))
|
||||
|
||||
(defconstant +lisp-program-header+ "
|
||||
#include <ecl/ecl.h>
|
||||
|
|
@ -637,7 +638,8 @@ output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), ECL_NIL);
|
|||
(ext:*source-location* (cons source-truename 0))
|
||||
(*suppress-compiler-messages* (or *suppress-compiler-messages*
|
||||
(not *compile-verbose*))))
|
||||
(declare (notinline compiler-cc))
|
||||
(declare (ignore output-file)
|
||||
(notinline compiler-cc))
|
||||
"Compiles the file specified by INPUT-PATHNAME and generates a fasl file
|
||||
specified by OUTPUT-FILE. If the filetype is not specified in INPUT-PATHNAME,
|
||||
then \".lsp\" is used as the default file type for the source file. LOAD
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
thereis (pathname-match-p base pattern-path)))
|
||||
|
||||
(defun gather-keywords (strings patterns)
|
||||
(declare (ignore patterns))
|
||||
(let ((strings (reduce #'append (mapcar #'split-words strings))))
|
||||
(mapcar (lambda (s)
|
||||
(intern (string-upcase s) (find-package :keyword)))
|
||||
|
|
|
|||
|
|
@ -128,21 +128,21 @@
|
|||
;; Split forms according to the tag they are preceded by and compile
|
||||
;; them grouped by PROGN. This help us use the optimizations in
|
||||
;; C1PROGN to recognize transfers of control.
|
||||
(loop for form in body
|
||||
with output = '()
|
||||
with tag-body = nil
|
||||
with this-tag = (make-var :name 'tagbody-beginnnig :kind nil)
|
||||
do (cond ((tag-p form)
|
||||
(when tag-body
|
||||
(setf output (cons (c1progn (nreconc tag-body '(nil))) output)
|
||||
tag-body nil))
|
||||
(push form output))
|
||||
(t
|
||||
(push form tag-body)))
|
||||
finally (setf body
|
||||
(if tag-body
|
||||
(cons (c1progn (nreconc tag-body '(nil))) output)
|
||||
output)))
|
||||
(make-var :name 'tagbody-beginnnig :kind nil) ; "this-tag"
|
||||
(loop with output = '()
|
||||
with tag-body = nil
|
||||
for form in body
|
||||
do (cond ((tag-p form)
|
||||
(when tag-body
|
||||
(setf output (cons (c1progn (nreconc tag-body '(nil))) output)
|
||||
tag-body nil))
|
||||
(push form output))
|
||||
(t
|
||||
(push form tag-body)))
|
||||
finally (setf body
|
||||
(if tag-body
|
||||
(cons (c1progn (nreconc tag-body '(nil))) output)
|
||||
output)))
|
||||
|
||||
;;; Reverse the body list, deleting unused tags.
|
||||
(loop for form in body
|
||||
|
|
|
|||
|
|
@ -255,6 +255,7 @@
|
|||
(when fname (wt-comment fname))))
|
||||
|
||||
(defun wt-call-normal (fun args type)
|
||||
(declare (ignore type))
|
||||
(unless (fun-cfun fun)
|
||||
(baboon "Function without a C name: ~A" (fun-name fun)))
|
||||
(let* ((minarg (fun-minarg fun))
|
||||
|
|
|
|||
|
|
@ -326,12 +326,13 @@
|
|||
;;
|
||||
|
||||
(defun c2c-progn (c1form variables statements)
|
||||
(declare (ignore c1form))
|
||||
(loop with *destination* = 'TRASH
|
||||
for form in statements
|
||||
do (cond ((stringp form)
|
||||
(wt-nl)
|
||||
(wt-c-inline-loc :void form variables
|
||||
t ; side effects
|
||||
t ; side effects
|
||||
nil) ; no output variables
|
||||
)
|
||||
(t
|
||||
|
|
@ -445,6 +446,7 @@
|
|||
`(COERCE-LOC ,rep-type ,loc)))))
|
||||
|
||||
(defun wt-c-inline-loc (output-rep-type c-expression coerced-arguments side-effects output-vars)
|
||||
(declare (ignore output-rep-type side-effects))
|
||||
(with-input-from-string (s c-expression)
|
||||
(when (and output-vars (not (eq output-vars 'VALUES)))
|
||||
(wt-nl))
|
||||
|
|
@ -495,6 +497,7 @@
|
|||
|
||||
(defun t3-defcallback (lisp-name c-name c-name-constant return-type return-type-code
|
||||
arg-types arg-type-constants call-type &aux (return-p t))
|
||||
(declare (ignore lisp-name))
|
||||
(when (eql return-type :void)
|
||||
(setf return-p nil))
|
||||
(let ((return-type-name (rep-type->c-name (ffi::%convert-to-arg-type return-type)))
|
||||
|
|
|
|||
|
|
@ -174,8 +174,10 @@
|
|||
(wt "v" lcl))
|
||||
|
||||
(defun wt-lcl-loc (lcl &optional type name)
|
||||
(unless (numberp lcl) (baboon :format-control "wt-lcl-loc: ~s NaN"
|
||||
:format-arguments (list lcl)))
|
||||
(declare (ignore type))
|
||||
(unless (numberp lcl)
|
||||
(baboon :format-control "wt-lcl-loc: ~s NaN"
|
||||
:format-arguments (list lcl)))
|
||||
(wt "v" lcl name))
|
||||
|
||||
(defun wt-temp (temp)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
(progv symbols values (c2expr body)))
|
||||
|
||||
(defun c2function (c1form kind funob fun)
|
||||
(declare (ignore c1form))
|
||||
(declare (ignore c1form funob))
|
||||
(case kind
|
||||
(GLOBAL
|
||||
(unwind-exit (list 'FDEFINITION fun)))
|
||||
|
|
@ -37,12 +37,11 @@
|
|||
(CLOSURE
|
||||
(setf (fun-level fun) 0 (fun-env fun) *env*))
|
||||
(LEXICAL
|
||||
(let ((parent (fun-parent fun)))
|
||||
;; Only increase the lexical level if there have been some
|
||||
;; new variables created. This way, the same lexical environment
|
||||
;; can be propagated through nested FLET/LABELS.
|
||||
(setf (fun-level fun) (if (plusp *lex*) (1+ *level*) *level*)
|
||||
(fun-env fun) 0)))
|
||||
;; Only increase the lexical level if there have been some
|
||||
;; new variables created. This way, the same lexical environment
|
||||
;; can be propagated through nested FLET/LABELS.
|
||||
(setf (fun-level fun) (if (plusp *lex*) (1+ *level*) *level*)
|
||||
(fun-env fun) 0))
|
||||
(otherwise
|
||||
(setf (fun-env fun) 0 (fun-level fun) 0)))
|
||||
(let ((previous
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@
|
|||
(wt-label *exit*)))
|
||||
|
||||
(defun t2init-form (c1form vv-loc form)
|
||||
(declare (ignore c1form))
|
||||
(declare (ignore c1form vv-loc))
|
||||
(let* ((*exit* (next-label)) (*unwind-exit* (list *exit*))
|
||||
(*destination* 'TRASH))
|
||||
(c2expr form)
|
||||
|
|
@ -473,9 +473,11 @@
|
|||
(format stream "~%};")))))
|
||||
|
||||
(defun t2fset (c1form &rest args)
|
||||
(declare (ignore args))
|
||||
(t2ordinary nil c1form))
|
||||
|
||||
(defun c2fset (c1form fun fname macro pprint c1forms)
|
||||
(declare (ignore pprint))
|
||||
(when (fun-no-entry fun)
|
||||
(wt-nl "(void)0; /* No entry created for "
|
||||
(format nil "~A" (fun-name fun))
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@
|
|||
(nr (make-lcl-var :type :int))
|
||||
(*inline-blocks* 0)
|
||||
min-values max-values)
|
||||
(declare (ignore nr))
|
||||
;; 1) Retrieve the number of output values
|
||||
(multiple-value-setq (min-values max-values)
|
||||
(c1form-values-number init-form))
|
||||
|
|
@ -300,6 +301,7 @@
|
|||
;; many they are.
|
||||
(multiple-value-bind (min-values max-values)
|
||||
(c1form-values-number form)
|
||||
(declare (ignore max-values))
|
||||
|
||||
;; We save the values in the value stack + value0
|
||||
(let ((*destination* 'RETURN))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue