Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/IR/mlrisc-idefs.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/IR/mlrisc-idefs.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 545 - (view) (download)

1 : monnier 411 (*
2 :     * Tarjan et als. idef/iuse sets.
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 : george 545 functor IDefs
8 : monnier 245 (structure Dom : DOMINATOR_TREE
9 :     structure CFG : CONTROL_FLOW_GRAPH
10 :     ) : MLRISC_IDEFS =
11 :     struct
12 :    
13 :     structure Dom = Dom
14 :     structure CFG = CFG
15 :     structure I = CFG.I
16 :     structure G = Graph
17 :     structure IDefs = IDefs
18 :    
19 :     fun idefs defUse cfg =
20 :     let fun compute_def_use(b,CFG.BLOCK{insns,...}) =
21 :     let fun du([],D,U) = (List.concat D,List.concat U)
22 :     | du(i::is,D,U) =
23 :     let val (d,u) = defUse i
24 :     in du(is,d::D,u::U) end
25 :     in du(!insns,[],[])
26 :     end
27 :     in
28 :     IDefs.compute_idefs {cfg=cfg,def_use=compute_def_use}
29 :     end
30 :    
31 :     end
32 :    

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