[MLton] refs in ssa

Lukasz S Ziarek lziarek@cs.purdue.edu
Sat, 6 Mar 2004 13:56:24 -0500 (EST)


I had a question about the number of arguments the primitive ref_ref
takes. Looking at local-ref.fun it is pretty obvious that ref_dref takes
one argument, mainly the variable we are trying to dref. Assign takes two
variables, the ref we are assigning to and the value. So I assumed that
ref_ref would just take a variable. This is not always the case. For
instance, when I try to snag the first variable of the args field for a
ref_ref prim op sometimes it is not there, IE we have a length zero arg
vector. This occurs when we reference a variable which is null. In my
continuing effort on flattening, I am trying to create an association
between ref cells and any tuples that lie within them. I though I would be
able to simply get the first arg of a ref_ref primitive and look up that
variable in a tuple env I have created. Is there some processing of refs
that I am not aware of? In general is the first argument to ref_ref going
to be the ssa variable that was referenced?

Luke