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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/IL/backward-dfa-fn.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/IL/backward-dfa-fn.sml

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

revision 477, Sat Nov 13 16:02:07 2010 UTC revision 488, Wed Jan 12 23:21:04 2011 UTC
# Line 13  Line 13 
13    (* given a function for defining out values for exits and the root node, do the    (* given a function for defining out values for exits and the root node, do the
14     * backward DFA on the CFG and return the list of nodes analysed.     * backward DFA on the CFG and return the list of nodes analysed.
15     *)     *)
16      val analyse : (D.IL.node -> D.t) * D.IL.stmt -> D.IL.node list      val analyse : (D.IL.node -> D.t) * D.IL.cfg -> D.IL.node list
17    
18    (* get results for a node *)    (* get results for a node *)
19      val inValue : D.IL.node -> D.t      val inValue : D.IL.node -> D.t
# Line 34  Line 34 
34    
35      fun clear node = (clrIn node; clrOut node)      fun clear node = (clrIn node; clrOut node)
36    
37      fun analyse (exitVal, stm) = let      fun analyse (exitVal, cfg) = let
38          (* use DFS order to get quicker convergence *)          (* use DFS order to get quicker convergence *)
39            val nodes = IL.sortNodes stm            val nodes = IL.CFG.sort cfg
40          (* set initial values for exit nodes *)          (* set initial values for exit nodes *)
41            val _ = List.app (fn nd => if IL.Node.hasSucc nd then () else setIn(nd, exitVal nd)) nodes            val _ = List.app (fn nd => if IL.Node.hasSucc nd then () else setIn(nd, exitVal nd)) nodes
42            fun iterate () = let            fun iterate () = let

Legend:
Removed from v.477  
changed lines
  Added in v.488

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