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 /sml/trunk/src/compiler/CodeGen/cpscompile/smlnj-gctype.sml
ViewVC logotype

View of /sml/trunk/src/compiler/CodeGen/cpscompile/smlnj-gctype.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 476 - (download) (annotate)
Wed Nov 10 22:59:58 1999 UTC (19 years, 10 months ago) by monnier
File size: 880 byte(s)
This commit was generated by cvs2svn to compensate for changes in r475,
which included commits to RCS files with non-trunk default branches.
structure SMLGCType : SMLGCTYPE =
struct

   type objtype = CPS.cty 
  
   datatype gctype =
     CONST of int                  (* integer constant *)
   | NONREF of objtype ref         (* non-reference value *)
   | REF of objtype ref            (* a reference, pointer to a gc object *)
   | ADD of int * gctype * gctype  (* address arithmetic + *)
   | SUB of int * gctype * gctype  (* address arithmetic - *)
   | BOT
   | TOP

   fun int i = if i >= 0 then Int.toString i else "-"^Int.toString(~i)

   fun toString BOT = "bot"
     | toString TOP = "top"
     | toString (CONST i) = int i
     | toString (NONREF(ref obj)) = CPS.ctyToString obj
     | toString (REF(ref obj)) =  CPS.ctyToString obj
     | toString (ADD(ty,a,b)) = "("^toString a^"+"^toString b^")"
     | toString (SUB(ty,a,b)) = "("^toString a^"-"^toString b^")"

end

structure SMLGCMap = GCMap(SMLGCType)

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