cmp: use cmutil extensions by invoking them with prefix ext

This commit is contained in:
Daniel Kochmański 2023-02-13 18:14:48 +01:00
parent acd1dd3c07
commit ee9e72e5aa
9 changed files with 11 additions and 11 deletions

View file

@ -168,7 +168,7 @@ special variable declarations, as these have been extracted before."
env)))))
(defun symbol-macro-declaration-p (name type)
(when-let ((record (cmp-env-search-symbol-macro name)))
(ext:when-let ((record (cmp-env-search-symbol-macro name)))
(let* ((expression (funcall record name nil)))
(cmp-env-register-symbol-macro name `(the ,type ,expression)))
t))

View file

@ -86,7 +86,7 @@
*permanent-data*))
&aux load-form-p)
;; FIXME add-static-constant is tied to the C target.
(when-let ((vv (add-static-constant object)))
(ext:when-let ((vv (add-static-constant object)))
(when used-p
(setf (vv-used-p vv) t))
(return-from add-object vv))
@ -147,7 +147,7 @@
;; can reuse keywords lists from other functions when they coincide with ours.
;; We search for keyword lists that are similar. However, the list *OBJECTS*
;; contains elements in decreasing order!!!
(if-let ((x (search keywords *permanent-objects*
(ext:if-let ((x (search keywords *permanent-objects*
:test #'(lambda (k record) (eq k (vv-value record))))))
(elt *permanent-objects* x)
(prog1 (add-object (pop keywords) :duplicate t :permanent t)

View file

@ -120,7 +120,7 @@
(defun c1constant-value (val &key always only-small-values)
(cond
;; FIXME includes in c1 pass.
((when-let ((x (assoc val *optimizable-constants*)))
((ext:when-let ((x (assoc val *optimizable-constants*)))
(pushnew "#include <float.h>" *clines-string-list*)
(pushnew "#include <complex.h>" *clines-string-list*)
(setf x (cdr x))

View file

@ -134,7 +134,7 @@
(:void . "ECL_FFI_VOID")))
(defun foreign-elt-type-code (type)
(if-let ((x (assoc type +foreign-elt-type-codes+)))
(ext:if-let ((x (assoc type +foreign-elt-type-codes+)))
(cdr x)
(cmperr "DEFCALLBACK: ~a is not a valid elementary FFI type." type)))

View file

@ -224,9 +224,9 @@
#+sse2
(not (typep object 'ext:sse-pack)))
(not (listp *static-constants*)))
(if-let ((record (find object *static-constants* :key #'first :test #'equal)))
(ext:if-let ((record (find object *static-constants* :key #'first :test #'equal)))
(second record)
(when-let ((builder (static-constant-expression object)))
(ext:when-let ((builder (static-constant-expression object)))
(let ((c-name (format nil "_ecl_static_~D" (length *static-constants*))))
(push (list object c-name builder) *static-constants*)
(make-vv :location c-name :value object))))))

View file

@ -23,7 +23,7 @@
(gethash rep-type (machine-rep-type-hash *machine*)))
(defun rep-type-record (rep-type)
(if-let ((record (gethash rep-type (machine-rep-type-hash *machine*))))
(ext:if-let ((record (gethash rep-type (machine-rep-type-hash *machine*))))
record
(cmperr "Not a valid C type name ~A" rep-type)))

View file

@ -5,7 +5,7 @@
(defun t2expr (form)
(when form
(if-let ((def (gethash (c1form-name form) *t2-dispatch-table*)))
(ext:if-let ((def (gethash (c1form-name form) *t2-dispatch-table*)))
(let ((*compile-file-truename* (c1form-file form))
(*compile-file-position* (c1form-file-position form))
(*current-toplevel-form* (c1form-form form))

View file

@ -37,7 +37,7 @@
(*current-form* (c1form-form form))
(*current-toplevel-form* (c1form-toplevel-form form))
(name (c1form-name form)))
(when-let ((propagator (gethash name *p1-dispatch-table*)))
(ext:when-let ((propagator (gethash name *p1-dispatch-table*)))
(prop-message "~&;;; Entering type propagation for ~A" name)
(multiple-value-bind (new-type assumptions)
(apply propagator form assumptions (c1form-args form))

View file

@ -511,7 +511,7 @@ keyword argument, the compiler-macro declines to provide an expansion.
(when (eq (first lambda-list) '&whole)
(push `(,(second lambda-list) ,whole) bindings-for-body)
(setf lambda-list (cddr lambda-list)))
(when-let ((env (member '&environment lambda-list)))
(ext:when-let ((env (member '&environment lambda-list)))
(push '&environment new-lambda-list)
(push (second env) new-lambda-list)
(setq lambda-list (nconc (ldiff lambda-list env) (cddr env))))