local refs

Matthew Fluet fluet@CS.Cornell.EDU
Fri, 7 Dec 2001 18:22:54 -0500 (EST)


> > We still need to compute multi-threaded and multi-used.
> 
> Don't we just need multi-used (for localization)?  Of course, it has
> to take Thread_copyCurrent into account.

Sounds right.

> If I'm right, then we just need
> 
>  val once: Program.t -> {funcIsMultiUsed: Func.t -> bool,
>                          labelIsMultiUsed: Label.t -> bool}

How about

val once: Program.t -> {funcIsUsedOnce: Func.t -> bool,
                        labelIsUsedOnce: Label.t -> bool}

so that that pass's name and semantics are a little more closely related.
;)

> > Any thoughts about whether or not we should make Thread_copyCurrent a
> > transfer? 
> 
> Yes, we should so that labelIsMultiUsed makes sense.

I see two options for making Thread_copyCurrent a transfer:

1. Change the existing Transfer.Prim to
	     | Prim of {prim: Prim.t,
			args: Var.t vector,
			failure: Label.t option, (* Must be nullary. *)
			success: Label.t (* Must be nullary or unary. *)
			}

2. Introduce a new Transfer.t variant
	     | Runtime of {prim: Prim.t,
		   	   args: Var.t vector,
                           return: Label.t (* Must be nullary *)
                          }

The second is probably more accurate, though if we go with option 2, we
should probably introduce a more descriptive name for what is currently
Transfer.Prim.