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

SCM Repository

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

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

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

revision 486, Wed Jan 5 17:00:05 2011 UTC revision 487, Wed Jan 5 19:14:02 2011 UTC
# Line 143  Line 143 
143        (* dummy node *)        (* dummy node *)
144          val dummy : node          val dummy : node
145        (* CFG edges *)        (* CFG edges *)
146            val hasPred : node -> bool
147          val preds : node -> node list          val preds : node -> node list
148          val setPred : node * node -> unit          val setPred : node * node -> unit
149          val hasSucc : node -> bool          val hasSucc : node -> bool
# Line 368  Line 369 
369          fun mkSTABILIZE () = new (STABILIZE{pred = ref dummy})          fun mkSTABILIZE () = new (STABILIZE{pred = ref dummy})
370          fun mkEXIT () = new (EXIT{pred = ref dummy})          fun mkEXIT () = new (EXIT{pred = ref dummy})
371        (* editing node edges *)        (* editing node edges *)
372            fun hasPred (ND{kind, ...}) = (case kind
373                   of NULL => false
374                    | ENTRY _ => false
375                    | _ => true
376                  (* end case *))
377          fun setPred (nd0 as ND{kind, ...}, nd) = (case kind          fun setPred (nd0 as ND{kind, ...}, nd) = (case kind
378                 of NULL => raise Fail("setPred on NULL node "^toString nd0)                 of NULL => raise Fail("setPred on NULL node "^toString nd0)
379                  | ENTRY _ => raise Fail("setPred on ENTRY node "^toString nd0)                  | ENTRY _ => raise Fail("setPred on ENTRY node "^toString nd0)
# Line 542  Line 548 
548                end                end
549    
550        (* replace a simple node in a cfg with a subgraph *)        (* replace a simple node in a cfg with a subgraph *)
551          fun splice (nd, CFG{entry, exit}) = ??          fun splice (nd as ND{kind, ...}, CFG{entry, exit}) = (case kind
552                   of ASSIGN{pred, succ, ...} => (
553                        Node.addEdge (!pred, !entry);
554                        Node.addEdge (!exit, !succ))
555                    | _ => raise Fail "unsupported splice"
556                  (* end case *))
557    
558        end        end
559    

Legend:
Removed from v.486  
changed lines
  Added in v.487

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