master: Have CTU:COMPILER-DERIVED-TYPE return the final dervied type.

apache--- via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  30741cecef0dce972eb55e1d40331394e3db1e82 (commit)
      from  13b5e0a8ed54f8f3ef5a6ce41438f53df6b229f6 (commit)

- Log -----------------------------------------------------------------
commit 30741cecef0dce972eb55e1d40331394e3db1e82
Author: Charles Zhang <[email protected]>
Date:   Tue Aug 11 00:31:05 2026 +0200

    Have CTU:COMPILER-DERIVED-TYPE return the final dervied type.
    
    By making it an IR2 converter, we get the final type, not some
    intermediate type.
---
 tests/compiler-test-util.lisp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/compiler-test-util.lisp b/tests/compiler-test-util.lisp
index 2e925bbcb..40c1a5bfc 100644
--- a/tests/compiler-test-util.lisp
+++ b/tests/compiler-test-util.lisp
@@ -35,11 +35,16 @@
 
 (cl:in-package :ctu)
 
+;;; Report the type the compiler ended up with for X.
 (unless (fboundp 'compiler-derived-type)
   (defknown compiler-derived-type (t) (values t t) (flushable))
-  (deftransform compiler-derived-type ((x) * * :node node)
-    (sb-c::delay-ir1-transform node :ir1-phases)
-    `(values ',(type-specifier (sb-c::lvar-type x)) t))
+  (sb-c::defoptimizer (compiler-derived-type sb-c::ir2-convert) ((x) node block)
+    (let ((lvar (sb-c::node-lvar node)))
+      (sb-c::move-lvar-result
+       node block
+       (list (sb-c::emit-constant (type-specifier (sb-c::lvar-type x)))
+             (sb-c::emit-constant t))
+       lvar)))
   (defun compiler-derived-type (x)
     (declare (ignore x))
     (values t nil)))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.