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 1862, Sun Apr 22 19:45:47 2012 UTC revision 1870, Fri May 11 17:44:18 2012 UTC
# Line 222  Line 222 
222                  | InitiallyScope => ToCL.trBlock (vMap, blk)                  | InitiallyScope => ToCL.trBlock (vMap, blk)
223                  | _ => ToC.trBlock (vMap, blk)                  | _ => ToC.trBlock (vMap, blk)
224                (* end case *))                (* end case *))
225            fun free (ENV{vMap, ...}, blk) = ToC.trFree (vMap, blk)
226          fun exp (ENV{vMap, ...}, e) = ToCL.trExp(vMap, e)          fun exp (ENV{vMap, ...}, e) = ToCL.trExp(vMap, e)
227        end        end
228    
# Line 390  Line 391 
391                in                in
392                  topDecls := shutdownFn :: initFn :: initHelperFn :: !topDecls                  topDecls := shutdownFn :: initFn :: initHelperFn :: !topDecls
393                end                end
394          (* register the global destruction part of a program *)
395            fun free (Prog{tgt, topDecls, ...}, free) = let
396                  val worldTy = CL.T_Ptr(CL.T_Named(N.worldTy tgt))
397                  val globTy = CL.T_Ptr(CL.T_Named(N.globalTy tgt))
398                  val free = CL.mkBlock(
399                        CL.mkDeclInit(globTy, "glob", CL.mkIndirect(CL.mkVar "wrld", "globals")) ::
400                        CL.unBlock free @ [CL.mkReturn(SOME(CL.mkVar "false"))])
401                  val freeFn = CL.D_Func(
402                        ["static"], CL.boolTy, N.freeGlobals,
403                        [CL.PARAM([], worldTy, "wrld")],
404                        free)
405                  in
406                    topDecls := freeFn :: !topDecls
407                  end
408    
409        (* create and register the initially function for a program *)        (* create and register the initially function for a program *)
410          fun initially {          fun initially {

Legend:
Removed from v.1862  
changed lines
  Added in v.1870

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