Include source information in some IR nodes
This commit is contained in:
parent
5306188869
commit
04df970b3a
1 changed files with 14 additions and 5 deletions
|
@ -41,7 +41,8 @@
|
||||||
(build-insert (make-instance 'ir-call
|
(build-insert (make-instance 'ir-call
|
||||||
:callee (callee node)
|
:callee (callee node)
|
||||||
:inputs inputs
|
:inputs inputs
|
||||||
:output output)
|
:output output
|
||||||
|
:source (source node))
|
||||||
builder)
|
builder)
|
||||||
output))
|
output))
|
||||||
|
|
||||||
|
@ -50,7 +51,8 @@
|
||||||
(output (make-instance 'ir-result)))
|
(output (make-instance 'ir-result)))
|
||||||
(build-insert (make-instance (get-ir-expr-inst-type node)
|
(build-insert (make-instance (get-ir-expr-inst-type node)
|
||||||
:inputs inputs
|
:inputs inputs
|
||||||
:output output)
|
:output output
|
||||||
|
:source (source node))
|
||||||
builder)
|
builder)
|
||||||
output))
|
output))
|
||||||
|
|
||||||
|
@ -61,11 +63,17 @@
|
||||||
(let ((input (compile-node (value node) builder))
|
(let ((input (compile-node (value node) builder))
|
||||||
(output-var (find-variable (dst-variable node) builder))
|
(output-var (find-variable (dst-variable node) builder))
|
||||||
(output (make-instance 'ir-result)))
|
(output (make-instance 'ir-result)))
|
||||||
(build-insert (make-instance 'ir-assign :input input :output output-var) builder)
|
(build-insert (make-instance 'ir-assign :input input
|
||||||
|
:output output-var
|
||||||
|
:source (source node))
|
||||||
|
builder)
|
||||||
;; This second instruction is so that we can let an assignment return
|
;; This second instruction is so that we can let an assignment return
|
||||||
;; the value that was assigned, as in b = a = 1. If the assignment is not
|
;; the value that was assigned, as in b = a = 1. If the assignment is not
|
||||||
;; used in this way, dead code elimination will remove this fetch.
|
;; used in this way, dead code elimination will remove this fetch.
|
||||||
(build-insert (make-instance 'ir-fetchvar :input output-var :output output) builder)
|
(build-insert (make-instance 'ir-fetchvar :input output-var
|
||||||
|
:output output
|
||||||
|
:source (source node))
|
||||||
|
builder)
|
||||||
output))
|
output))
|
||||||
|
|
||||||
(defmethod compile-node ((node node-conditional) builder)
|
(defmethod compile-node ((node node-conditional) builder)
|
||||||
|
@ -79,7 +87,8 @@
|
||||||
(build-insert-end (make-instance
|
(build-insert-end (make-instance
|
||||||
'ir-if
|
'ir-if
|
||||||
:input test-ir
|
:input test-ir
|
||||||
:destinations (list then-iblock else-iblock))
|
:destinations (list then-iblock else-iblock)
|
||||||
|
:source (source node))
|
||||||
builder)
|
builder)
|
||||||
(build-begin builder then-iblock)
|
(build-begin builder then-iblock)
|
||||||
(compile-node (then-node node) builder)
|
(compile-node (then-node node) builder)
|
||||||
|
|
Loading…
Add table
Reference in a new issue