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

SCM Repository

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

View of /trunk/src/compiler/IL/gen/mid-il.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 282 - (download) (annotate)
Fri Aug 13 19:20:23 2010 UTC (9 years ago) by jhr
File size: 905 byte(s)
  Made the IL generator more general to handle MidIL features
(* mid-il.sml
 *
 * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.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

    datatype ty = BoolTy | StringTy | IntTy | VecTy of int

    fun samety (ty1 : ty, ty2) = (ty1 = ty2)
    fun hashty BoolTy = 0w1
      | hashty StringTy = 0w2
      | hashty IntTy = 0w3
      | hashty (VecTy d) = Word.fromInt d + 0w4
    fun tyToString BoolTy = "bool"
      | tyToString StringTy = "string"
      | tyToString IntTy = "int"
      | tyToString (VecTy 0) = "real"
      | tyToString (VecTy d) = "vec" ^ Int.toString d

    fun samestring (s1 : string, s2) = (s1 = s2)
    val hashstring = HashString.hashString
    fun stringToString s = String.concat["\"", s, "\""]

@BODY@

  end

structure MidIL = SSAFn(MidOps)

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