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 4515, Mon Sep 5 14:06:32 2016 UTC revision 4516, Mon Sep 5 16:19:47 2016 UTC
# Line 218  Line 218 
218              setGlobalsOfBlock (blk, !globals)              setGlobalsOfBlock (blk, !globals)
219            end            end
220    
221      fun analyze (S.Program{constInit, funcs, globInit, strand, create, start, update, ...}) = let      fun analyze prog = let
222            val S.Strand{stateInit, startM, updateM, stabilizeM, ...} = strand            val S.Program{
223                      props, constInit, funcs, globInit, strand, create, start, update, ...
224                    } = prog
225              val S.Strand{state, stateInit, startM, updateM, stabilizeM, ...} = strand
226            in            in
227              (* if the program has communication then the "pos" variable is shared *)
228                if Properties.hasProp Properties.StrandCommunication props
229                  then (case List.find (fn x => (SV.nameOf x = "pos")) state
230                     of SOME x => markSharedStateVar x
231                      | NONE => raise Fail "impossible: missing 'pos' state variable"
232                    (* end case *))
233                  else ();
234              analyzeBlock ConstInit constInit;              analyzeBlock ConstInit constInit;
235              List.app (fn (S.Func{f, body, ...}) => analyzeBlock UserFunc body) funcs;              List.app (fn (S.Func{f, body, ...}) => analyzeBlock UserFunc body) funcs;
236              analyzeBlock GlobalInit globInit;              analyzeBlock GlobalInit globInit;

Legend:
Removed from v.4515  
changed lines
  Added in v.4516

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