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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/translate/analyze-simple.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/translate/analyze-simple.sml

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

revision 4635, Mon Sep 26 22:37:36 2016 UTC revision 4636, Tue Sep 27 02:02:17 2016 UTC
# Line 190  Line 190 
190              | doStm (S.S_Assign(x, e), (live, assigns)) = (              | doStm (S.S_Assign(x, e), (live, assigns)) = (
191                  markUpdate (cxt, x);                  markUpdate (cxt, x);
192                  (addUses(e, VSet.subtract(live, x)), addVar(x, assigns)))                  (addUses(e, VSet.subtract(live, x)), addVar(x, assigns)))
193                | doStm (S.S_IfThenElse(x, b1, b2), (liveIn, assignsIn)) = let
194                    val liveIn = addVar(x, liveIn)
195                    val (live1, assigns1) = doBlock (b1, liveIn)
196                    val (live2, assigns2) = doBlock (b2, liveIn)
197                    val assigns = VSet.union(assignsIn, VSet.union(assigns1, assigns2))
198                    in
199                      (VSet.union(live1, live2), assigns)
200                    end
201              | doStm (S.S_Foreach(x, xs, b), (liveIn, assignsIn)) = let              | doStm (S.S_Foreach(x, xs, b), (liveIn, assignsIn)) = let
202                  val liveIn = addVar(xs, liveIn)                  val liveIn = addVar(xs, liveIn)
203                  val (liveOut, assigns) = doBlock (b, liveIn)                  val (liveOut, assigns) = doBlock (b, liveIn)
# Line 199  Line 207 
207  (* QUESTION: do we want to modify the properties of b? *)  (* QUESTION: do we want to modify the properties of b? *)
208                    (liveOut, assigns)                    (liveOut, assigns)
209                  end                  end
210              | doStm (S.S_IfThenElse(x, b1, b2), (liveIn, assignsIn)) = let              | doStm (S.S_New(_, xs), (live, assigns)) = (addList (xs, live), assigns)
                 val liveIn = addVar(x, liveIn)  
                 val (live1, assigns1) = doBlock (b1, liveIn)  
                 val (live2, assigns2) = doBlock (b2, liveIn)  
                 val assigns = VSet.union(assignsIn, VSet.union(assigns1, assigns2))  
                 in  
                   (VSet.union(live1, live2), assigns)  
                 end  
211              | doStm (S.S_Return x, (live, assigns)) = (addVar (x, live), assigns)              | doStm (S.S_Return x, (live, assigns)) = (addVar (x, live), assigns)
212              | doStm (S.S_Print xs, (live, assigns)) = (addList (xs, live), assigns)              | doStm (S.S_Print xs, (live, assigns)) = (addList (xs, live), assigns)
213              | doStm (S.S_MapReduce mrs, acc) = let              | doStm (S.S_MapReduce mrs, acc) = let
# Line 243  Line 244 
244              Option.app (analyzeBlock InitMeth) startM;              Option.app (analyzeBlock InitMeth) startM;
245              analyzeBlock UpdateMeth updateM;              analyzeBlock UpdateMeth updateM;
246              Option.app (analyzeBlock StabilizeMeth) stabilizeM;              Option.app (analyzeBlock StabilizeMeth) stabilizeM;
             Create.app (analyzeBlock Create) create;  
247              Option.app (analyzeBlock GlobalUpdate) start;              Option.app (analyzeBlock GlobalUpdate) start;
248              Option.app (analyzeBlock GlobalUpdate) update              Option.app (analyzeBlock GlobalUpdate) update;
249                Create.app (analyzeBlock Create) create
250            end            end
251    
252    end    end

Legend:
Removed from v.4635  
changed lines
  Added in v.4636

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