X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ftn.lisp;h=38d1209fadde0dd0d8cd12616c90b4930943372f;hb=5745b5a5b2e3b967bf3876b4306f31b3c78495fa;hp=e109e49b5e95de4a40391a2c7924b84efcd95857;hpb=21cc22ee56f70684b2a90734c1ad243f323af4b8;p=sbcl.git diff --git a/src/compiler/tn.lisp b/src/compiler/tn.lisp index e109e49..38d1209 100644 --- a/src/compiler/tn.lisp +++ b/src/compiler/tn.lisp @@ -445,6 +445,16 @@ (aver (eq (tn-kind tn) :constant)) (constant-value (tn-leaf tn))) +(defun immediate-tn-p (tn) + (declare (type tn tn)) + (let ((leaf (tn-leaf tn))) + ;; Leaves with KIND :CONSTANT can have NIL as the leaf if they + ;; represent load time values. + (and leaf + (eq (tn-kind tn) :constant) + (eq (immediate-constant-sc (constant-value leaf)) + (sc-number-or-lose 'sb!vm::immediate))))) + ;;; Force TN to be allocated in a SC that doesn't need to be saved: an ;;; unbounded non-save-p SC. We don't actually make it a real "restricted" TN, ;;; but since we change the SC to an unbounded one, we should always succeed in