tame/tamer/src/asg
Mike Gerwitz 3587d032c3 tamer: asg::graph::object::rel::DynObjectRel: Store source data
This is generic over the source, just as the target, defaulting just the
same to `ObjectIndex`.

This allows us to use only the edge information provided rather than having
to perform another lookup on the graph and then assert that we found the
correct edge.  In this case, we're dealing with an `Ident->Expr` edge, of
which there is only one, but in other cases, there may be many such edges,
and it wouldn't be possible to know _which_ was referred to without also
keeping context of the previous edge in the walk.

So, in addition to avoiding more indirection and being more immune to logic
bugs, this also allows us to avoid states in `AsgTreeToXirf` for the purpose
of tracking previous edges in the current path.  And it means that the tree
walk can seed further traversals in conjunction with it, if that is so
needed for deriving sources.

More cleanup will be needed, but this does well to set us up for moving
forward; I was too uncomfortable with having to do the separate
lookup.  This is also a more intuitive API.

But it does have the awkward effect that now I don't need the pair---I just
need the `Object`---but I'm not going to remove it because I suspect I may
need it in the future.  We'll see.

The TODO references the fact that I'm using a convenient `resolve_oi_pairs`
instead of resolving only the target first and then the source only in the
code path that needs it.  I'll want to verify that Rust will properly
optimize to avoid the source resolution in branches that do not need it.

DEV-13708
2023-03-10 14:27:58 -05:00
..
air tamer: asg::air: Merge Pkg closing span 2023-03-10 14:27:57 -05:00
graph tamer: asg::graph::object::rel::DynObjectRel: Store source data 2023-03-10 14:27:58 -05:00
air.rs tamer: asg::air: Merge Pkg closing span 2023-03-10 14:27:57 -05:00
error.rs tamer: nir, asg: Introduce package to ASG 2023-02-01 10:34:16 -05:00
graph.rs tamer: asg::graph::object::rel::DynObjectRel: Store source data 2023-03-10 14:27:58 -05:00
mod.rs tamer: asg::graph::{object::xir=>xmli}: Rename module 2023-03-10 14:27:58 -05:00