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

SCM Repository

[diderot] Diff of /branches/lamont_dev/src/compiler/IL/ssa-fn.sml
ViewVC logotype

Diff of /branches/lamont_dev/src/compiler/IL/ssa-fn.sml

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

revision 412, Sat Oct 16 15:19:19 2010 UTC revision 419, Sun Oct 17 02:23:43 2010 UTC
# Line 396  Line 396 
396          fun mkSTABILIZE () = new (STABILIZE{pred = ref dummy})          fun mkSTABILIZE () = new (STABILIZE{pred = ref dummy})
397          fun mkEXIT () = new (EXIT{pred = ref dummy})          fun mkEXIT () = new (EXIT{pred = ref dummy})
398        (* editing node edges *)        (* editing node edges *)
399          fun setPred (ND{kind, ...}, nd) = (case kind          fun setPred (nd0 as ND{kind, ...}, nd) = (case kind
400                 of NULL => raise Fail "setPred on NULL node"                 of NULL => raise Fail("setPred on NULL node "^toString nd0)
401                  | ENTRY _ => raise Fail "setPred on ENTRY node"                  | ENTRY _ => raise Fail("setPred on ENTRY node "^toString nd0)
402                  | JOIN{preds, ...} => if List.exists (fn nd' => same(nd, nd')) (!preds)                  | JOIN{preds, ...} => if List.exists (fn nd' => same(nd, nd')) (!preds)
403                      then ()                      then ()
404                      else preds := nd :: !preds                      else preds := nd :: !preds
# Line 409  Line 409 
409                  | STABILIZE{pred} => pred := nd                  | STABILIZE{pred} => pred := nd
410                  | EXIT{pred} => pred := nd                  | EXIT{pred} => pred := nd
411                (* end case *))                (* end case *))
412          fun preds (ND{kind, ...}) = (case kind          fun preds (nd as ND{kind, ...}) = (case kind
413                 of NULL => raise Fail "preds on NULL node"                 of NULL => raise Fail("preds on NULL node "^toString nd)
414                  | ENTRY _ => []                  | ENTRY _ => []
415                  | JOIN{preds, ...} => !preds                  | JOIN{preds, ...} => !preds
416                  | COND{pred, ...} => [!pred]                  | COND{pred, ...} => [!pred]
# Line 431  Line 431 
431                  | STABILIZE _ => false                  | STABILIZE _ => false
432                  | EXIT _ => false                  | EXIT _ => false
433                (* end case *))                (* end case *))
434          fun setSucc (ND{kind, ...}, nd) = (case kind          fun setSucc (nd0 as ND{kind, ...}, nd) = (case kind
435                 of NULL => raise Fail "setSucc on NULL node"                 of NULL => raise Fail("setSucc on NULL node "^toString nd0)
436                  | ENTRY{succ} => succ := nd                  | ENTRY{succ} => succ := nd
437                  | JOIN{succ, ...} => succ := nd                  | JOIN{succ, ...} => succ := nd
438                  | COND _ => raise Fail "setSucc on COND node"                  | COND _ => raise Fail("setSucc on COND node "^toString nd0)
439                  | BLOCK{succ, ...} => succ := nd                  | BLOCK{succ, ...} => succ := nd
440                  | NEW{succ, ...} => succ := nd                  | NEW{succ, ...} => succ := nd
441                  | DIE _ => raise Fail "setSucc on DIE node"                  | DIE _ => raise Fail("setSucc on DIE node "^toString nd0)
442                  | STABILIZE _ => raise Fail "setSucc on STABILIZE node"                  | STABILIZE _ => raise Fail("setSucc on STABILIZE node "^toString nd0)
443                  | EXIT _ => raise Fail "setSucc on EXIT node"                  | EXIT _ => raise Fail("setSucc on EXIT node "^toString nd0)
444                (* end case *))                (* end case *))
445          fun succs (ND{kind, ...}) = (case kind          fun succs (nd as ND{kind, ...}) = (case kind
446                 of NULL => raise Fail "succs on NULL node"                 of NULL => raise Fail("succs on NULL node "^toString nd)
447                  | ENTRY{succ} => [!succ]                  | ENTRY{succ} => [!succ]
448                  | JOIN{succ, ...} => [!succ]                  | JOIN{succ, ...} => [!succ]
449                  | COND{trueBranch, falseBranch, ...} => [!trueBranch, !falseBranch]                  | COND{trueBranch, falseBranch, ...} => [!trueBranch, !falseBranch]

Legend:
Removed from v.412  
changed lines
  Added in v.419

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