Representing collected and deduplicated definitions and usages #
Collecting and deduplicating definitions and usages #
FVarIds of a function parameter in the function's signature and body
differ. However, they have
TermInfo nodes with
binder := true in the exact
same position. Moreover, macros such as do-reassignment
x := e may create
chains of variable definitions where a helper definition overlaps with a use
of a variable.
This function changes every such group to use a single
FVarId (the head of the
chain/DAG) and gets rid of duplicate definitions.