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

SCM Repository

[diderot] Diff of /trunk/src/compiler/simplify/inliner.sml
ViewVC logotype

Diff of /trunk/src/compiler/simplify/inliner.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 68  Line 68 
68                    | S.E_Prim(f, tys, xs, ty) =>                    | S.E_Prim(f, tys, xs, ty) =>
69                        S.E_Prim(f, tys, List.map (rename env) xs, ty)                        S.E_Prim(f, tys, List.map (rename env) xs, ty)
70                    | S.E_Cons xs => S.E_Cons(List.map (rename env) xs)                    | S.E_Cons xs => S.E_Cons(List.map (rename env) xs)
71                      | S.E_Seq xs => S.E_Seq(List.map (rename env) xs)
72                    | S.E_Slice(x, xs, ty) =>                    | S.E_Slice(x, xs, ty) =>
73                        S.E_Slice(rename env x, List.map (Option.map (rename env)) xs, ty)                        S.E_Slice(rename env x, List.map (Option.map (rename env)) xs, ty)
74                    | S.E_Coerce{srcTy, dstTy, x} =>                    | S.E_Coerce{srcTy, dstTy, x} =>
75                        S.E_Coerce{srcTy=srcTy, dstTy=dstTy, x=rename env x}                        S.E_Coerce{srcTy=srcTy, dstTy=dstTy, x=rename env x}
                   | S.E_Input(_, _, _, NONE) => exp  
                   | S.E_Input(ty, name, desc, SOME x) =>  
                       S.E_Input(ty, name, desc, SOME(rename env x))  
76                    | S.E_LoadImage _ => exp                    | S.E_LoadImage _ => exp
77                  (* end case *))                  (* end case *))
78          (* build the initial environment by mapping parameters to arguments *)          (* build the initial environment by mapping parameters to arguments *)
# Line 147  Line 145 
145            end            end
146    
147      fun transform (prog as S.Program{funcs=[], ...}) = prog      fun transform (prog as S.Program{funcs=[], ...}) = prog
148        | transform (S.Program{globals, globalInit, funcs, strands, init}) = let        | transform (S.Program{props, inputs, globals, globalInit, funcs, strands, init}) = let
149          (* a table that maps function names to their definitions *)          (* a table that maps function names to their definitions *)
150            val funcTbl = V.Tbl.mkTable (List.length funcs, Fail "funcTbl")            val funcTbl = V.Tbl.mkTable (List.length funcs, Fail "funcTbl")
151          (* first we inline expand the function bodies in definition order *)          (* first we inline expand the function bodies in definition order *)
# Line 155  Line 153 
153            val expandBlock = expandBlock funcTbl            val expandBlock = expandBlock funcTbl
154            in            in
155              S.Program{              S.Program{
156                    props = props,
157                    inputs = inputs,
158                  globals = globals,                  globals = globals,
159                  globalInit = expandBlock globalInit,                  globalInit = expandBlock globalInit,
160                  funcs = [],                  funcs = [],

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