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

SCM Repository

[diderot] Diff of /trunk/src/compiler/mid-il/check-mid-il.sml
ViewVC logotype

Diff of /trunk/src/compiler/mid-il/check-mid-il.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2635, Mon May 26 14:06:39 2014 UTC revision 2636, Tue May 27 16:18:36 2014 UTC
# Line 100  Line 100 
100                  end                  end
101              | Op.TensorToWorldSpace(info, ty) => (ty, [Ty.ImageTy info, ty])              | Op.TensorToWorldSpace(info, ty) => (ty, [Ty.ImageTy info, ty])
102              | Op.EvalKernel(d, _, _) => (Ty.vecTy d, [Ty.vecTy d])              | Op.EvalKernel(d, _, _) => (Ty.vecTy d, [Ty.vecTy d])
             | Op.LoadImage info => (Ty.ImageTy info, [Ty.StringTy])  
103              | Op.Inside(info, _) => (Ty.BoolTy, [Ty.vecTy(ImageInfo.dim info), Ty.ImageTy info])              | Op.Inside(info, _) => (Ty.BoolTy, [Ty.vecTy(ImageInfo.dim info), Ty.ImageTy info])
104              | Op.Input(ty, _, _) => (ty, [])              | Op.LoadImage(ty, _, _) => (ty, [])
105              | Op.InputWithDefault(ty, _, _) => (ty, [ty])              | Op.Input(Inputs.INP{ty, ...}) => (ty, [])
106              | Op.Print tys => (Ty.TupleTy[], tys)              | Op.Print tys => (Ty.TupleTy[], tys)
107              | _ => raise Fail("sigOf: invalid operator " ^ Op.toString rator)              | _ => raise Fail("sigOf: invalid operator " ^ Op.toString rator)
108            (* end case *))            (* end case *))
109    
110      fun typeOfCons (_, []) = false      fun typeOfCons (_, []) = false
111          | typeOfCons (Ty.SeqTy(ty, n), tys) =
112              List.all (fn ty' => Ty.same(ty, ty')) tys andalso (List.length tys = n)
113        | typeOfCons (expectedTy, tys as ty1::_) =        | typeOfCons (expectedTy, tys as ty1::_) =
114            if List.all (fn ty => Ty.same(ty1, ty)) tys            if List.all (fn ty => Ty.same(ty1, ty)) tys
115              then (case (expectedTy, ty1)              then (case (expectedTy, ty1)

Legend:
Removed from v.2635  
changed lines
  Added in v.2636

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