Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/pure-cfg/src/compiler/gen/il/mid-il.in
ViewVC logotype

View of /branches/pure-cfg/src/compiler/gen/il/mid-il.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1624 - (download) (annotate)
Sat Nov 12 16:50:10 2011 UTC (7 years, 11 months ago) by jhr
File size: 1307 byte(s)
  Working on printing support
(* mid-il.sml
 *
 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * Middle-level version of the Diderot IL.
 *
 * Note: this file is generated from gen/mid-il.spec and gen/mid-il.in.
 *)

structure MidOps =
  struct

  (* required helper functions for types *)
    type ty = MidILTypes.ty
    val samety = MidILTypes.same
    val hashty = MidILTypes.hash
    val tyToString = MidILTypes.toString

  (* required helper functions for type lists *)
    type tys = ty list
    fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
    fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
    fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]

  (* required helper functions for the int type *)
    fun sameint (i1 : int, i2) = (i1 = i2)
    fun hashint i = Word.fromInt i
    fun intToString i = Int.toString i

  (* required helper functions for the string type *)
    fun samestring (s1 : string, s2) = (s1 = s2)
    val hashstring = HashString.hashString
    fun stringToString s = String.concat["\"", s, "\""]

@BODY@

  end

structure MidIL = SSAFn(
  val ilName = "mid-il"
  structure Ty = MidILTypes
  structure Op = MidOps)

structure MidILCensus = CensusFn(MidIL)


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