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

SCM Repository

[diderot] Diff of /branches/charisee_dev/src/compiler/high-to-mid/handleEin.sml
ViewVC logotype

Diff of /branches/charisee_dev/src/compiler/high-to-mid/handleEin.sml

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

revision 3269, Fri Oct 9 00:54:03 2015 UTC revision 3304, Fri Oct 16 18:51:09 2015 UTC
# Line 27  Line 27 
27          of 0=>testp n          of 0=>testp n
28          | _ => (print(String.concat n);1))          | _ => (print(String.concat n);1))
29      fun toStringBind e= MidToString.toStringBind e      fun toStringBind e= MidToString.toStringBind e
30        fun useCount (HighIL.V{useCnt, ...}) = !useCnt
31      fun expandEinOp bind00=let      fun expandEinOp (srcy,bind00)=let
32    
33          val star="************"          val star="************"
34          val _ =test0[star,"\n Original EinApp",star,"\n\n","start get test",toStringBind bind00]          val _ =test0[star,"\n Original EinApp",star,"\n\n","start get test",toStringBind bind00]
# Line 47  Line 47 
47    
48          (* **************** split phase ************* *)          (* **************** split phase ************* *)
49          val (newbies5)= Split.splitEinApp bind3          val (newbies5)= Split.splitEinApp bind3
50          val _ =testp["\n\n Returning \n\n =>",          val _ =test0["\n\n Returning \n\n =>",
51              String.concatWith",\n\t"(List.map toStringBind newbies5)]              String.concatWith",\n\t"(List.map toStringBind newbies5)]
52    
53    
# Line 56  Line 56 
56    
57          (*gives probeEIN the set. Could split into a sepearate step*)          (*gives probeEIN the set. Could split into a sepearate step*)
58          val fieldset= einSet.EinSet.empty          val fieldset= einSet.EinSet.empty
59            val isField = ref 0
60            val isFieldR = ref 0
61            val isReplaced = ref 0
62          fun iter([],_)=[]          fun iter([],_)=[]
63           | iter(e1::es,fieldset)= let           | iter(e1::es,fieldset)= let
64              val (e2,fieldset) = ProbeEin.expandEinOp(e1,fieldset)              val (e2,fieldset,isFieldt,isReplacedt) = ProbeEin.expandEinOp(e1,fieldset)
65              in [e2]@(iter(es,fieldset))              val rtn=[e2]@(iter(es,fieldset))
66                val isFieldRt=if ((isFieldt+isReplacedt)=2) then 1 else 0
67                in (isField:=(!isField)+isFieldt;isReplaced:=(!isReplaced )+isReplacedt;
68                isFieldR:=(!isFieldR)+isFieldRt;rtn)
69              end              end
70          val code=iter(newbies5, fieldset)          val code=iter(newbies5, fieldset)
71          (*val _ =print(String.concat[  
72              "\n",star,"Number of pieces now: ",Int.toString (List.length(code))])          val n= List.length(code)
73          *)  
74              val _ = if (n>5)
75             then  (String.concat["\n\n",star,":Name:",HighIL.Var.name srcy ,
76                ":VarCount(",Int.toString(useCount srcy),")",
77                    "\n\t",star,"Pieces now: ",Int.toString (n),
78                " Fields:",Int.toString(!isField)," isReplaced:",Int.toString(!isReplaced),
79                " Replaced_Fields:",Int.toString(!isFieldR)
80                   ,toStringBind bind3])
81                else  ""
82    
83          val flatcode= List.foldr op@ [] code          val flatcode= List.foldr op@ [] code
84          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)          (*val _=List.map (fn(_,DstIL.EINAPP(e,_))=>checkEin.checkEIN e | _=> 1) flatcode*)
85    

Legend:
Removed from v.3269  
changed lines
  Added in v.3304

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