[jhc] Occurance collection.

John Meacham john at repetae.net
Mon Feb 25 23:43:20 EST 2008

On Sat, Feb 23, 2008 at 08:46:51PM +0100, Lemmih wrote:
> In E.SSimplify.collectOccurance the 'arg' function is used quite often
> and I can't tell why. The function clears usage information for free
> variables and is primarily used for types.
> It would be a great help if you'd add a short description to
> collectOccurance and collectDs. Any information about invariants
> and/or what they're trying to do would be appreciated.

Basically, occurance collection figured out how many times and in what
way variables are used. it figures out things like whether a variable
has been used at most once and whether it is in a lambda.

If a variable ever appears as an argument to another function, you can't
know anything (at least not in this analysis) about how it is used, so
the function 'arg' tells it that all the variables in its argument
should be considered used an unknown number of times.

likewise, types get passed around a lot, and better usage information
for them doesn't usually help because a lot of them  (but not all) are
erased by run time, so we just take the conservative approach and treat
them like they were used as an argument to a function, used an unknown
number of times.


John Meacham - ⑆repetae.net⑆john⑈

More information about the jhc mailing list