Skip to content
Snippets Groups Projects
Commit f7cd0fd6 authored by ram's avatar ram
Browse files

When substituting for the result continuation in let conversion, intersect

the combination's derived type with the derived types of the dummy's
uses.  This serves to propagate TRULY-THE through lets.
parent 58219964
No related branches found
No related tags found
No related merge requests found
......@@ -617,6 +617,10 @@
;;; for the actual continuation; in all other cases assertions on the dummy
;;; continuation are lost.
;;;
;;; We also intersect the derived type of the call with the derived type of
;;; all the dummy continuation's uses. This serves mainly to propagate
;;; TRULY-THE through lets.
;;;
(defun move-return-uses (fun call)
(declare (type clambda fun) (type basic-combination call))
(let ((return (lambda-return fun)))
......@@ -625,9 +629,14 @@
(delete-return return)
(let ((result (return-result return))
(cont (node-cont call)))
(cont (node-cont call))
(call-type (node-derived-type call)))
(when (eq (continuation-use cont) call)
(assert-continuation-type cont (continuation-asserted-type result)))
(unless (eq call-type *wild-type*)
(do-uses (use result)
(derive-node-type use call-type)))
(delete-continuation-use call)
(add-continuation-use call (node-prev (lambda-bind fun)))
(substitute-continuation-uses cont result))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment