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

SCM Repository

[diderot] View of /branches/vis15/src/compiler/codegen/global-struct.sml
ViewVC logotype

View of /branches/vis15/src/compiler/codegen/global-struct.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3812 - (download) (annotate)
Wed May 4 13:16:31 2016 UTC (3 years, 1 month ago) by jhr
File size: 661 byte(s)
  working on merge
(* global-struct.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 *)

structure GlobalStruct : sig

    val genGlobals : {
	    cvtTy : TreeTypes.t -> CLang.ty,	(* convert to target type *)
	    name : string,			(* the struct name *)
	    fields : TreeIR.global_var list	(* the globals that define the fields *)
	  } -> CLang.decl

  end = struct

    fun genGlobals {cvtTy, name, fields} = let
	  fun mkField (TreeIR.GV{name, ty, ...}) = (cvtTy ty, name)
	  in
	    CLang.D_StructDef(SOME name, List.map mkField fields, NONE)
	  end

  end

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