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 256, Mon Aug 9 17:28:57 2010 UTC revision 257, Mon Aug 9 18:28:37 2010 UTC
# Line 162  Line 162 
162          structure Tbl : MONO_HASH_TABLE where type Key.hash_key = var          structure Tbl : MONO_HASH_TABLE where type Key.hash_key = var
163        end        end
164    
165      (* DFS sorting of the graph rooted at the entry to a statement *)
166        val sortNodes : stmt -> node list
167    
168    end    end
169    
170  functor SSAFn (Op : OPERATORS) : SSA =  functor SSAFn (Op : OPERATORS) : SSA =
# Line 473  Line 476 
476            end)            end)
477        end        end
478    
479      (* DFS sorting of the graph rooted at the entry to a statement *)
480        fun sortNodes stmt = let
481              val {getFn, setFn} = PropList.newFlag (fn (ND{props, ...}) => props)
482              fun dfs (nd, l) =
483                    if getFn nd
484                      then l
485                      else (
486                        setFn (nd, true);
487                        nd :: List.foldl dfs l (Node.succs nd))
488              in
489                dfs (Stmt.entry stmt, [])
490              end
491    
492    end    end

Legend:
Removed from v.256  
changed lines
  Added in v.257

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