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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/mid-opt/mid-contract.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/mid-opt/mid-contract.sml

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

revision 3585, Thu Jan 14 14:08:46 2016 UTC revision 3586, Thu Jan 14 14:49:31 2016 UTC
# Line 42  Line 42 
42      fun decUse (IR.V{useCnt, ...}) = (useCnt := !useCnt - 1)      fun decUse (IR.V{useCnt, ...}) = (useCnt := !useCnt - 1)
43      fun use x = (incUse x; x)      fun use x = (incUse x; x)
44    
45      fun getRHS x = (case V.binding x      fun getRHSOpt x = (case V.getDef x
46             of IR.VB_RHS(IR.VAR x') => getRHS x'             of IR.OP arg => SOME arg
             | IR.VB_RHS(IR.GLOBAL x') => (case IR.GlobalVar.bindingOf x'  
                  of NONE => NONE  
                   | SOME x => getRHS x  
                 (* end case *))  
             | IR.VB_RHS rhs => SOME rhs  
             | _ => NONE  
           (* end case *))  
   
     fun getRHSOpt x = (case getRHS x  
            of SOME(IR.OP arg) => SOME arg  
47              | _ => NONE              | _ => NONE
48            (* end case *))            (* end case *))
49    
# Line 87  Line 77 
77                        SOME[(lhs, IR.VAR(use b))])                        SOME[(lhs, IR.VAR(use b))])
78                    | _ => NONE                    | _ => NONE
79                  (* end case *))                  (* end case *))
80              | (Op.IntToReal, [a]) => (case getRHS a              | (Op.IntToReal, [a]) => (case V.getDef a
81                   of SOME(IR.LIT(Literal.Int n)) => (                   of IR.LIT(Literal.Int n) => (
82                        (* rerite to a real literal *)                        (* rerite to a real literal *)
83                          ST.tick cntIntToReal;                          ST.tick cntIntToReal;
84                          decUse a;                          decUse a;

Legend:
Removed from v.3585  
changed lines
  Added in v.3586

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