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 318, Wed Aug 18 04:11:57 2010 UTC revision 319, Wed Aug 18 04:13:08 2010 UTC
# Line 196  Line 196 
196          structure Tbl : MONO_HASH_TABLE where type Key.hash_key = var          structure Tbl : MONO_HASH_TABLE where type Key.hash_key = var
197        end        end
198    
199    (* DFS sorting of the graph rooted at the entry to a statement *)    (* DFS sorting of the graph rooted at the entry to a statement; the resulting list will
200       * be in preorder with parents before children.
201       *)
202      val sortNodes : stmt -> node list      val sortNodes : stmt -> node list
203    
204    end    end
# Line 525  Line 527 
527            end)            end)
528        end        end
529    
530    (* DFS sorting of the graph rooted at the entry to a statement *)    (* DFS sorting of the graph rooted at the entry to a statement; the resulting list will
531       * be in preorder with parents before children.
532       *)
533      fun sortNodes stmt = let      fun sortNodes stmt = let
534            val {getFn, setFn} = PropList.newFlag (fn (ND{props, ...}) => props)            val {getFn, setFn} = PropList.newFlag (fn (ND{props, ...}) => props)
535            fun dfs (nd, l) =            fun dfs (nd, l) =
# Line 534  Line 538 
538                    else (                    else (
539                      setFn (nd, true);                      setFn (nd, true);
540                      nd :: List.foldl dfs l (Node.succs nd))                      nd :: List.foldl dfs l (Node.succs nd))
541              val nodes = dfs (Stmt.entry stmt, [])
542            in            in
543              dfs (Stmt.entry stmt, [])              List.app (fn nd => setFn(nd, false)) nodes;
544                nodes
545            end            end
546    
547    end    end

Legend:
Removed from v.318  
changed lines
  Added in v.319

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