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

SCM Repository

[diderot] Diff of /branches/lamont_dev/src/compiler/translate/translate.sml
ViewVC logotype

Diff of /branches/lamont_dev/src/compiler/translate/translate.sml

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

revision 1868, Fri May 11 03:17:42 2012 UTC revision 2039, Wed Oct 17 16:10:37 2012 UTC
# Line 224  Line 224 
224      fun cvtExp (env : env, lhs, exp) = (case exp      fun cvtExp (env : env, lhs, exp) = (case exp
225             of S.E_Var x => [IL.ASSGN(lhs, IL.VAR(lookup env x))]             of S.E_Var x => [IL.ASSGN(lhs, IL.VAR(lookup env x))]
226              | S.E_Lit lit => [IL.ASSGN(lhs, IL.LIT lit)]              | S.E_Lit lit => [IL.ASSGN(lhs, IL.LIT lit)]
227          | S.E_RadiusQuery (S.E_Lit lit) => [IL.ASSGN(lhs,IL.RQUERY lit)]          | S.E_SphereQuery (args) => let
228                    val args' = List.map (lookup env) args
229                    in
230                       [IL.ASSGN(lhs,IL.OP(HighOps.SphereQuery,args'))]
231                    end
232              | S.E_Tuple xs => raise Fail "E_Tuple not implemeted"              | S.E_Tuple xs => raise Fail "E_Tuple not implemeted"
233              | S.E_Apply(f, tyArgs, args, ty) => let              | S.E_Apply(f, tyArgs, args, ty) => let
234                  val args' = List.map (lookup env) args                  val args' = List.map (lookup env) args
# Line 270  Line 274 
274    
275    
276      fun cvtBlock (state, env : env, joinStk, S.Block stms) = let      fun cvtBlock (state, env : env, joinStk, S.Block stms) = let
277          (* LAMONT COMMENT THIS SECTION!!!! *)
278        fun cvtLoopBlock(forNode as IL.ND{kind=IL.FOREACH{shouldReplace, ...}, ...},state,joinStk,blk) = let        fun cvtLoopBlock(forNode as IL.ND{kind=IL.FOREACH{shouldReplace, ...}, ...},state,joinStk,blk) = let
279                      val (_,JOIN{env,...})::_ = joinStk                      val (_,JOIN{env,...})::_ = joinStk
280                      val(cfg0,e) = cvtBlock (state,!env,joinStk, blk)                      val(cfg0,e) = cvtBlock (state,!env,joinStk, blk)
281                   in                   in
282                      (print(Bool.toString(!shouldReplace));                      (
283                      if(!shouldReplace = true) then                      if(!shouldReplace = true) then
284                          (print("got here\n"); shouldReplace := false;                          (shouldReplace := false;
285                          cvtLoopBlock(forNode,state,joinStk,blk))                          cvtLoopBlock(forNode,state,joinStk,blk))
286                      else                      else
287                          (cfg0,e))                          (cfg0,e))
# Line 345  Line 350 
350                            | (env, NONE) => raise Fail "unimplemented" (* FIXME *)                            | (env, NONE) => raise Fail "unimplemented" (* FIXME *)
351                          (* end case *)                          (* end case *)
352                        end                        end
353             |  S.S_Foreach(x,blk) => let             |  S.S_Foreach(x,blk,strandName) => let
354                val x' = lookup env x                val x' = lookup env x
355                        val forNode = IL.Node.mkFOREACH{                        val forNode = IL.Node.mkFOREACH{
356                     cond = x',                     cond = x',
357                     phis = [],                     phis = [],
358                       sName = strandName,
359                     stmBranch = IL.Node.dummy                     stmBranch = IL.Node.dummy
360                }                }
361                        val join = newJoinWithNode(env, 2,forNode)                        val join = newJoinWithNode(env, 2,forNode)

Legend:
Removed from v.1868  
changed lines
  Added in v.2039

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