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 1146, Sat May 7 03:57:41 2011 UTC revision 1147, Sat May 7 03:58:34 2011 UTC
# Line 245  Line 245 
245    (* operations on RHS expressions *)    (* operations on RHS expressions *)
246      structure RHS : sig      structure RHS : sig
247          val toString : rhs -> string          val toString : rhs -> string
248            val vars : rhs -> var list
249          val map : (var -> var) -> rhs -> rhs          val map : (var -> var) -> rhs -> rhs
250          val app : (var -> unit) -> rhs -> unit          val app : (var -> unit) -> rhs -> unit
251        end        end
# Line 570  Line 571 
571  raise ex)  raise ex)
572          fun replaceOutEdge {oldSrc, src, dst} = (          fun replaceOutEdge {oldSrc, src, dst} = (
573              (* first set the successor of src *)              (* first set the successor of src *)
574                setSucc (src, dst);                case kind oldSrc
575                   of COND{trueBranch, falseBranch, ...} =>
576                        if same(!trueBranch, dst)
577                          then setTrueBranch (src, dst)
578                          else setFalseBranch (src, dst)
579                    | _ => setSucc (src, dst)
580                  (* end case *);
581              (* then set the predecessor of dst *)              (* then set the predecessor of dst *)
582                case kind dst                case kind dst
583                 of JOIN{preds, ...} => let                 of JOIN{preds, ...} => let
# Line 721  Line 728 
728    
729      structure RHS =      structure RHS =
730        struct        struct
731            fun vars rhs = (case rhs
732                   of VAR x => [x]
733                    | LIT _ => []
734                    | OP(rator, xs) => xs
735                    | APPLY(g, xs) => xs
736                    | CONS(ty, xs) => xs
737                  (* end case *))
738    
739          fun map f = let          fun map f = let
740                fun mapf rhs = (case rhs                fun mapf rhs = (case rhs
741                       of VAR x => VAR(f x)                       of VAR x => VAR(f x)

Legend:
Removed from v.1146  
changed lines
  Added in v.1147

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