Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/high-to-mid/high-to-mid.sml
ViewVC logotype

Diff of /trunk/src/compiler/high-to-mid/high-to-mid.sml

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

revision 328, Wed Aug 18 22:19:26 2010 UTC revision 334, Thu Aug 19 20:53:07 2010 UTC
# Line 13  Line 13 
13    end = struct    end = struct
14    
15      structure SrcIL = HighIL      structure SrcIL = HighIL
16      structure SrcOp = SrcIL.Op      structure SrcOp = HighOps
17      structure DstIL = MidIL      structure DstIL = MidIL
18      structure DstOp = DstIL.Op      structure DstOp = MidOps
19      structure VMap = SrcIL.Var.Map      structure VMap = SrcIL.Var.Map
20    
21        fun lookupVar (env, x) = (case VMap.find(env, x)
22               of SOME x' => x'
23                | NONE => raise Fail("unknown variable "^SrcIL.Var.toString x)
24              (* end case *))
25    
26    (* expand the field Inside operator into a image-space test *)    (* expand the field Inside operator into a image-space test *)
27      fun expandInside (env, result, pos, fld) = let      fun expandInside (env, result, pos, fld) = let
28            val pos' = lookupVar (env, pos)            val pos' = lookupVar (env, pos)
# Line 26  Line 31 
31                    | _ => raise Fail "bogus field binding"                    | _ => raise Fail "bogus field binding"
32                  (* end case *))                  (* end case *))
33            fun expand (FieldDef.CONV(_, img, _)) = let            fun expand (FieldDef.CONV(_, img, _)) = let
34                  val imgPos = newVar "x"                  val imgPos = DstIL.Var.new "x"
35                  in [                  in [
36                    (imgPos, DstIL.OP(DstOp.Transform img, [pos'])),                    (imgPos, DstIL.OP(DstOp.Transform img, [pos'])),
37                    (result, DstIL.OP(DstOp.Inside img, [imgPos]))                    (result, DstIL.OP(DstOp.Inside img, [imgPos]))
# Line 37  Line 42 
42              expand fld              expand fld
43            end            end
44    
45        val expandProbe = Probe.expand
46    
47      fun translate prog = raise Fail "FIXME"      fun translate prog = raise Fail "FIXME"
48    
49    end    end

Legend:
Removed from v.328  
changed lines
  Added in v.334

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