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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/simplify/simplify.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/simplify/simplify.sml

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

revision 2272, Thu Mar 7 20:10:07 2013 UTC revision 2328, Fri Mar 22 18:21:07 2013 UTC
# Line 16  Line 16 
16      structure S = Simple      structure S = Simple
17      structure InP = Inputs      structure InP = Inputs
18    
19      (* the SimpleAST and AST currently use the same type representation, but
20       * we prune out meta variables.
21       *)
22        val cvtTy = TypeUtil.prune
23    
24      local      local
25        val tempName = Atom.atom "_t"        val tempName = Atom.atom "_t"
26      in      in
27      fun newTemp ty = Var.new (tempName, AST.LocalVar, ty)      fun newTemp ty = Var.new (tempName, AST.LocalVar, cvtTy ty)
28      end      end
29    
30    (* make a block out of a list of statements that are in reverse order *)    (* make a block out of a list of statements that are in reverse order *)
# Line 335  Line 340 
340              | AST.E_Coerce{srcTy, dstTy, e} => let              | AST.E_Coerce{srcTy, dstTy, e} => let
341                  val (stms, x) = simplifyExpToVar (e, stms)                  val (stms, x) = simplifyExpToVar (e, stms)
342                  val result = newTemp dstTy                  val result = newTemp dstTy
343                    val rhs = S.E_Coerce{srcTy = cvtTy srcTy, dstTy = cvtTy dstTy, x = x}
344                  in                  in
345                    (S.S_Assign(result, S.E_Coerce{srcTy=srcTy, dstTy=dstTy, x=x})::stms, S.E_Var result)                    (S.S_Assign(result, rhs)::stms, S.E_Var result)
346                  end                  end
347            (* end case *))            (* end case *))
348    

Legend:
Removed from v.2272  
changed lines
  Added in v.2328

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