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

SCM Repository

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

Diff of /trunk/src/compiler/IL/ssa-fn.sml

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

revision 137, Wed Jul 7 21:30:23 2010 UTC revision 168, Wed Jul 21 20:58:37 2010 UTC
# Line 18  Line 18 
18          props : PropList.holder          props : PropList.holder
19        }        }
20    
21      (* a statement is a CFG fragment with a single entrypoint and
22       * a single continuation.
23       *)
24    datatype stmt    datatype stmt
25      = BLOCK of block        = BLOCK of stmt
26      | SEQ of stmt list      | SEQ of stmt list
27      | IF of {      | IF of {
28          pre : block,            pre : stmt,
29          cond : var,          cond : var,
30          trueBranch : stmt          trueBranch : stmt
31          falseBranch : stmt          falseBranch : stmt
# Line 55  Line 58 
58      val newVar : string -> var      val newVar : string -> var
59      val newBlock : unit -> block      val newBlock : unit -> block
60    
61        val entryBlock : stmt -> block
62        val nextBlock : stmt -> block
63    
64    end    end
65    
66  functor SSAFn (Op : OPERATORS) : SSA =  functor SSAFn (Op : OPERATORS) : SSA =
# Line 68  Line 74 
74        }        }
75    
76    datatype stmt    datatype stmt
77      = BLOCK of block      = EXIT
78      | SEQ of stmt list      | SEQ of block * stmt
79      | IF of {      | IF of {
80          pre : block,          pre : stmt,
81          cond : var,          cond : var,
82          trueBranch : stmt          trueBranch : stmt,
83          falseBranch : stmt          falseBranch : stmt,
84            next : stmt             (* ?? *)
85        }        }
86      | WHILE of {      | WHILE of {
87          hdr : block,          hdr : stmt,
88          cond : var,          cond : var,
89          body : stmt          body : stmt,
90            exit : stmt             (* ?? *)
91        }        }
92    
93    and block = BLK of {    and block = BLK of {
# Line 149  Line 157 
157    
158      end (* local *)      end (* local *)
159    
160        fun entryBlock (BLOCK blk) = blk
161          | entryBlock (SEQ(s1::_)) = entryBlock s1
162          | entryBlock (IF{pre, ...}) = entryBlock pre
163          | entryBlock (WHILE{hdr, ...}) = entryBlock hdr
164    
165        fun nextBlock (SEQ(, next)) = nextBlock next
166          | nextBlock (SEQ stms) = nextBlock(List.last stms)
167          | nextBlock (IF{pre, ...}) = entryBlock pre
168          | nextBlock (WHILE{hdr, ...}) = entryBlock hdr
169    
170    end    end

Legend:
Removed from v.137  
changed lines
  Added in v.168

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