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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/translate/translate.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/translate/translate.sml

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

revision 1339, Mon Jun 13 19:56:59 2011 UTC revision 1340, Mon Jun 13 19:57:19 2011 UTC
# Line 236  Line 236 
236                                    IL.Node.addEdge (IL.CFG.exit cfg1, joinNd));                                    IL.Node.addEdge (IL.CFG.exit cfg1, joinNd));
237                                cvt (                                cvt (
238                                  env,                                  env,
239                                  IL.CFG{entry = IL.CFG.entry cfg, exit = joinNd},                                  IL.CFG.concat (
240                                      cfg,
241                                      IL.CFG{entry = cond, exit = joinNd}),
242                                  stms))                                  stms))
243                          (* the join node has only zero predecessors, so                          (* the join node has only zero predecessors, so
244                           * it was killed.                           * it was killed.
# Line 265  Line 267 
267            in            in
268              cvt (env, IL.CFG.empty, stms)              cvt (env, IL.CFG.empty, stms)
269            end            end
270    (*DEBUG*)handle ex => raise ex
271    
272      fun cvtTopLevelBlock (env, blk, mkExit) = let      fun cvtTopLevelBlock (env, blk, mkExit) = let
273            val (cfg, env) = cvtBlock ([], env, [], blk)            val (cfg, env) = cvtBlock ([], env, [], blk)
# Line 281  Line 284 
284                  IL.Node.addEdge (IL.CFG.exit cfg, exit) handle _ => ());                  IL.Node.addEdge (IL.CFG.exit cfg, exit) handle _ => ());
285              (IL.CFG{entry = entry, exit = exit}, env)              (IL.CFG{entry = entry, exit = exit}, env)
286            end            end
287    (*DEBUG*)handle ex => raise ex
288    
289  (* FIXME: the following function could be refactored with cvtTopLevelBlock to share code *)  (* FIXME: the following function could be refactored with cvtTopLevelBlock to share code *)
290      fun cvtFragmentBlock (env0, blk) = let      fun cvtFragmentBlock (env0, blk) = let
# Line 299  Line 303 
303                  IL.Node.addEdge (IL.CFG.exit cfg, exit));                  IL.Node.addEdge (IL.CFG.exit cfg, exit));
304              (IL.CFG{entry = entry, exit = exit}, env)              (IL.CFG{entry = entry, exit = exit}, env)
305            end            end
306    (*DEBUG*)handle ex => raise ex
307    
308      fun cvtMethod (env, name, state, blk) = let      fun cvtMethod (env, name, state, blk) = let
309          (* allocate fresh variables for the state variables *)          (* allocate fresh variables for the state variables *)
# Line 324  Line 329 
329                  body = IL.CFG{entry = entry, exit = exit}                  body = IL.CFG{entry = entry, exit = exit}
330                }                }
331            end            end
332    (*DEBUG*)handle ex => (print(concat["error in cvtMethod(", Atom.toString name, ", ...)\n"]); raise ex)
333    
334    (* convert the initially code *)    (* convert the initially code *)
335      fun cvtInitially (env, S.Initially{isArray, rangeInit, create, iters}) = let      fun cvtInitially (env, S.Initially{isArray, rangeInit, create, iters}) = let

Legend:
Removed from v.1339  
changed lines
  Added in v.1340

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