Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/FLINT/kernel/ltykernel.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/FLINT/kernel/ltykernel.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 46, Sun Mar 22 20:11:09 1998 UTC revision 53, Mon Mar 23 04:02:58 1998 UTC
# Line 17  Line 17 
17  in  in
18    
19  type enc_tvar = int  type enc_tvar = int
20  fun tvToInt (d, i) = d * MVAL + i  fun tvEncode (d, i) = d * MVAL + i
21  fun tvFromInt x = ((x div MVAL), (x mod MVAL))  fun tvDecode x = ((x div MVAL), (x mod MVAL))
22    
23  fun exitLevel xs =  fun exitLevel xs =
24    let fun h ([], x) = rev x    let fun h ([], x) = rev x
# Line 326  Line 326 
326          | exitAux x = x          | exitAux x = x
327    
328        fun tc_aux tc =        fun tc_aux tc =
329          let fun g (TC_VAR(d, i)) = AX_REG(true, [tvToInt(d, i)])          let fun g (TC_VAR(d, i)) = AX_REG(true, [tvEncode(d, i)])
330                | g (TC_NVAR(v, d, i)) = baseAux (*** THIS IS WRONG ! ***)                | g (TC_NVAR(v, d, i)) = baseAux (*** THIS IS WRONG ! ***)
331                | g (TC_PRIM pt) = baseAux                | g (TC_PRIM pt) = baseAux
332                | g (TC_APP(ref(_, TC_FN _, AX_NO), _)) = AX_NO                | g (TC_APP(ref(_, TC_FN _, AX_NO), _)) = AX_NO
# Line 385  Line 385 
385  fun lt_vs (r as ref(_ : int, _ : ltyI, AX_NO)) = NONE  fun lt_vs (r as ref(_ : int, _ : ltyI, AX_NO)) = NONE
386    | lt_vs (r as ref(_ : int, _ : ltyI, AX_REG (_,x))) = SOME x    | lt_vs (r as ref(_ : int, _ : ltyI, AX_REG (_,x))) = SOME x
387    
388    (* unfortunately, the `temporary hack' is being exported now! *)
389    val tc_freevars = tc_vs
390    
391  (** converting from the hash-consing reps to the standard reps *)  (** converting from the hash-consing reps to the standard reps *)
392  fun tk_outX (r as ref(_ : int, t : tkindI, _ : aux_info)) = t  fun tk_outX (r as ref(_ : int, t : tkindI, _ : aux_info)) = t
# Line 467  Line 469 
469    
470        fun withEff ([], ol, nl, tenv) = false        fun withEff ([], ol, nl, tenv) = false
471          | withEff (a::r, ol, nl, tenv) =          | withEff (a::r, ol, nl, tenv) =
472              let val (i, j) = tvFromInt a              let val (i, j) = tvDecode a
473                  val neweff =                  val neweff =
474                    if i > ol then (ol <> nl)                    if i > ol then (ol <> nl)
475                    else (* case tcLookup(i, tenv)                    else (* case tcLookup(i, tenv)
# Line 1113  Line 1115 
1115     in case tvs     in case tvs
1116         of NONE => bug "unexpected case in tc_depth"         of NONE => bug "unexpected case in tc_depth"
1117          | SOME [] => DI.top          | SOME [] => DI.top
1118          | SOME (a::_) => d + 1 - (#1(tvFromInt a))          | SOME (a::_) => d + 1 - (#1(tvDecode a))
1119    end    end
1120    
1121  fun tcs_depth ([], d) = DI.top  fun tcs_depth ([], d) = DI.top

Legend:
Removed from v.46  
changed lines
  Added in v.53

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0