From c269b44f411cc19042cc5087d3e7404057195b27 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Sep 2022 19:02:38 +0300 Subject: feat(tvix/eval): track source spans for upvalues With this change, the upvalue data instructions used by finalisers for thunks and closures track the source span of the first identifier that created the upvalue (if the same value is closed over multiple times the upvalue will be reused, hence only the first one). To do this the upvalue struct used by the compiler's scope now carries an identifier node, which had to be threaded through quite a few places. Change-Id: I15a5fcb4c8abbd48544a2325f297a5ad14ec06ae Reviewed-on: https://cl.tvl.fyi/c/depot/+/6400 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/compiler/scope.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'tvix/eval/src/compiler/scope.rs') diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs index 01e0801e65c6..7614fc2b2b11 100644 --- a/tvix/eval/src/compiler/scope.rs +++ b/tvix/eval/src/compiler/scope.rs @@ -94,6 +94,7 @@ pub enum UpvalueKind { #[derive(Clone, Debug)] pub struct Upvalue { pub kind: UpvalueKind, + pub node: rnix::ast::Ident, } /// Represents the index of a local in the scope's local array, which -- cgit 1.4.1