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

Added NODE-SOURCE-FORM, CONTINUATION-SOURCE-FORM.

parent 8d084de8
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1util.lisp,v 1.50 1992/01/21 15:54:30 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1util.lisp,v 1.51 1992/01/24 07:49:00 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -342,6 +342,31 @@ ...@@ -342,6 +342,31 @@
(defun source-path-forms (path) (defun source-path-forms (path)
(subseq path 0 (position 'original-source-start path))) (subseq path 0 (position 'original-source-start path)))
;;; NODE-SOURCE-FORM -- Interface
;;;
;;; Return the innermost source form for Node.
;;;
(defun node-source-form (node)
(declare (type node node))
(let* ((path (node-source-path node))
(forms (source-path-forms path)))
(if forms
(first forms)
(values (find-original-source path)))))
;;; CONTINUATION-SOURCE-FORM -- Interface
;;;
;;; Return NODE-SOURCE-FORM, T if continuation has a single use, otherwise
;;; NIL, NIL.
;;;
(defun continuation-source (cont)
(let ((use (continuation-use cont)))
(if use
(values (node-source-form use) t)
(values nil nil))))
;;; MAKE-LEXENV -- Interface ;;; MAKE-LEXENV -- Interface
;;; ;;;
......
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