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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/cl-target/cl-target.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/cl-target/cl-target.sml

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

revision 2810, Sat Nov 8 18:26:25 2014 UTC revision 2811, Sat Nov 8 18:34:41 2014 UTC
# Line 196  Line 196 
196                  | InitiallyScope => ToCL.trBlock (vMap, blk)                  | InitiallyScope => ToCL.trBlock (vMap, blk)
197                  | _ => ToC.trBlock (vMap, blk)                  | _ => ToC.trBlock (vMap, blk)
198                (* end case *))                (* end case *))
         fun free (ENV{vMap, ...}, blk) = ToC.trFree (vMap, blk)  
199          fun exp (ENV{vMap, ...}, e) = ToCL.trExp(vMap, e)          fun exp (ENV{vMap, ...}, e) = ToCL.trExp(vMap, e)
200        end        end
201    
# Line 381  Line 380 
380                  topDecls := shutdownFn :: initFn :: initHelperFn :: !topDecls                  topDecls := shutdownFn :: initFn :: initHelperFn :: !topDecls
381                end                end
382        (* register the global destruction part of a program *)        (* register the global destruction part of a program *)
383          fun free (Prog{props, topDecls, ...}, free) = let          fun free (Prog{props, topDecls, ...}, env, globals) = let
384                val worldTy = CL.T_Ptr(CL.T_Named(N.worldTy props))                val worldTy = CL.T_Ptr(CL.T_Named(N.worldTy props))
385                val globTy = CL.T_Ptr(CL.T_Named(N.globalsTy props))                fun freeGlob (x, stms) = stms (* FIXME *)
386                val free = CL.mkBlock(                val body = CL.mkBlock(List.foldr freeGlob [CL.mkReturn(SOME(CL.mkVar "false"))] globals)
                     CL.mkDeclInit(globTy, "glob", CL.mkIndirect(CL.mkVar "wrld", "globals")) ::  
                     CL.unBlock free @ [CL.mkReturn(SOME(CL.mkVar "false"))])  
387                val freeFn = CL.D_Func(                val freeFn = CL.D_Func(
388                      ["static"], CL.boolTy, N.freeGlobals,                      ["static"], CL.boolTy, N.freeGlobals,
389                      [CL.PARAM([], worldTy, "wrld")],                      [CL.PARAM([], worldTy, "wrld")],
390                      free)                      body)
391                in                in
392                  topDecls := freeFn :: !topDecls                  topDecls := freeFn :: !topDecls
393                end                end

Legend:
Removed from v.2810  
changed lines
  Added in v.2811

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