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

SCM Repository

[diderot] View of /trunk/src/compiler/gen/il/low-il.in
ViewVC logotype

View of /trunk/src/compiler/gen/il/low-il.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2636 - (download) (annotate)
Tue May 27 16:18:36 2014 UTC (5 years, 1 month ago) by jhr
File size: 1435 byte(s)
  Merging changes from vis12 branch (via staging).  The main change is the new
  syntax for inputs (especially image inputs).
(* low-il.in
 *
 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * Lower-level version of the Diderot IL input file.
 *
 *)

structure LowOps =
  struct

  (* required helper functions for types *)
    type ty = LowILTypes.ty
    val samety = LowILTypes.same
    val hashty = LowILTypes.hash
    val tyToString = LowILTypes.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, "\""]

  (* required helper functions for the input type *)
    type input = ty Inputs.input
    val sameinput = Inputs.same
    val hashinput = Inputs.hash
    val inputToString = Inputs.toString

@BODY@

  end

structure LowIL = SSAFn(
  val ilName = "low-il"
  structure Ty = LowILTypes
  structure Op = LowOps)

structure LowILCensus = CensusFn(LowIL)


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