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/block-placement/default-block-placement.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/block-placement/default-block-placement.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 906 - (view) (download)

1 : george 906 (* default-block-placement.sml
2 :     *
3 :     * COPYRIGHT (c) 2001 Bell Labs, Lucent Technologies
4 :     *)
5 :    
6 :     (* Just the order in which blocks were generated *)
7 :     functor DefaultBlockPlacement (CFG : CONTROL_FLOW_GRAPH) : BLOCK_PLACEMENT =
8 :     struct
9 :     structure CFG=CFG
10 :     structure G = Graph
11 :    
12 :     fun error msg = MLRiscErrorMsg.error ("NaiveBlockPlacement", msg)
13 :    
14 :     fun blockPlacement (cfg as G.GRAPH graph) = let
15 :     val ENTRY =
16 :     (case #entries graph () of [n] => n | _ => error "ENTRY")
17 :     val EXIT =
18 :     (case #exits graph () of [n] => n | _ => error "EXIT")
19 :    
20 :     in
21 :     List.filter
22 :     (fn (i, CFG.BLOCK{kind, ...}) => i <> ENTRY andalso i <> EXIT)
23 :     (#nodes graph ())
24 :     end
25 :     end

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