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/aliasing/mlriscRegion.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/aliasing/mlriscRegion.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 409 - (view) (download)

1 : monnier 409 (*
2 :     * This module implements the MLRISC annotations for describing
3 :     * memory aliasing and control dependence.
4 :     *
5 :     * -- Allen
6 :     *)
7 :    
8 :     structure MLRiscRegion :> MLRISC_REGION =
9 :     struct
10 :    
11 :     datatype mutability = READONLY | IMMUTABLE | MUTABLE
12 :     datatype region = ROOT
13 :     | REGION of int * mutability * string * region
14 :     | UNION of region list
15 :    
16 :     val counter = ref 0
17 :    
18 :     val memory = ROOT
19 :     fun new(name,mut,parent) =
20 :     let val id = !counter
21 :     in counter := id + 1;
22 :     REGION(!counter,mut,name,parent)
23 :     end
24 :    
25 :     val union = UNION
26 :     val stack = new("stack",MUTABLE,memory)
27 :     val heap = new("heap",MUTABLE,memory)
28 :     val data = new("data",MUTABLE,memory)
29 :     val readonly = new("readonly",READONLY,data)
30 :    
31 :     fun toString ROOT = "root"
32 :     | toString(REGION(_,_,name,ROOT)) = name
33 :     | toString(REGION(_,_,name,parent)) = toString parent^"."^name
34 :     | toString(UNION rs) =
35 :     String.concat(foldr (fn (r,[]) => [toString r]
36 :     | (r,s) => toString r::"+"::s) [] rs)
37 :    
38 :     end

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