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

SCM Repository

[smlnj] View of /tests/trunk/bugs/tests.obsolete/bug1608.1.sml
ViewVC logotype

View of /tests/trunk/bugs/tests.obsolete/bug1608.1.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2460 - (download) (annotate)
Sat Apr 28 20:18:10 2007 UTC (12 years, 2 months ago) by gkuan
File size: 2546 byte(s)
(* bug1608.1.sml *)

signature CELLS_BASIS =
sig
   type cellkindInfo
   type cellkindDesc
   datatype cellkind = GP | FP | CC | MEM | CTRL
      | MISC_KIND of cellkindInfo ref
   datatype cell =
      CELL of {id   : int, col  : cellColor ref, desc : cellkindDesc }
   and cellColor =
         MACHINE of int | PSEUDO | ALIASED of cell | SPILLED
   structure HashTable : MONO_HASH_TABLE where type Key.hash_key = cell
   structure ColorTable : MONO_HASH_TABLE where type Key.hash_key = cell

end

structure CellsInternal =
struct

   datatype cellkindInfo = INFO of {name:string, nickname:string}
   datatype cellkind = GP | FP | CC | MEM | CTRL
      | MISC_KIND of cellkindInfo ref (* client defined *)
   datatype cellkindDesc =
        DESC of
        {kind             : cellkind,
         counter          : int ref,
         low              : int,
         high             : int,
         toString         : int -> string,
         toStringWithSize : int * int -> string,
         defaultValues    : (int * int) list,
         physicalRegs     : cell Array.array ref,
         zeroReg          : int option
        }
   and cell = CELL of {id   : int, col  : cellColor ref, desc : cellkindDesc }
   and cellColor = MACHINE of int | PSEUDO | ALIASED of cell | SPILLED
end
                              
structure CellsBasis : CELLS_BASIS =
struct

   structure I = CellsInternal

   datatype cellkind     = datatype I.cellkind
   datatype cellkindInfo = datatype I.cellkindInfo
   datatype cellkindDesc = datatype I.cellkindDesc
   datatype cell         = datatype I.cell
   datatype cellColor    = datatype I.cellColor

   fun error msg = (print msg; raise Match)

    fun hashCell _ = error "hashCell"
    fun hashColor _ = error "hashColor"
    fun sameCell _ = error "sameCell"
    fun sameColor _ = error "sameColor"

    structure HashTable =
      HashTableFn(type hash_key = cell
                  val hashVal = hashCell
                  val sameKey = sameCell)

    structure ColorTable =
      HashTableFn(type hash_key = cell
                  val hashVal = hashColor
                  val sameKey = sameColor)

end

signature CELLS_COMMON =
sig
   include CELLS_BASIS
end
         where type cellkind     = CellsBasis.cellkind
             and type cellkindDesc = CellsBasis.cellkindDesc
             and type cellkindInfo = CellsBasis.cellkindInfo
             and type cell         = CellsBasis.cell
             and HashTable = CellsBasis.HashTable
             and ColorTable = CellsBasis.ColorTable                   

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