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

SCM Repository

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

Diff of /branches/vis15/src/compiler/high-to-mid/high-to-mid.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 27  Line 27 
27    
28      fun useCount (SrcIR.V{useCnt, ...}) = !useCnt      fun useCount (SrcIR.V{useCnt, ...}) = !useCnt
29    
30      fun getRHS x = (case SrcIR.Var.binding x      fun getRHS x = (case SrcIR.Var.getDef x
31             of SrcIR.VB_RHS(SrcIR.VAR x') => getRHS x'             of SrcIR.GLOBAL gv => raise Fail(concat[
             | SrcIR.VB_RHS(SrcIR.GLOBAL x') => (case SrcIR.GlobalVar.bindingOf x'  
                  of SOME x'' => getRHS x''  
                   | NONE => raise Fail(concat[  
                         "mutable global ", SrcIR.GlobalVar.toString x',  
                         " encountered"  
                       ])  
                 (* end case *))  
             | SrcIR.VB_RHS rhs => rhs  
             | vb => raise Fail(concat[  
32                    "expected rhs binding for ", SrcIR.Var.toString x,                    "expected rhs binding for ", SrcIR.Var.toString x,
33                    " but found ", SrcIR.vbToString vb                    " but found mutable global ", SrcIR.GlobalVar.toString gv
34                  ])                  ])
35                | rhs => rhs
36            (* end case *))            (* end case *))
37    
38      fun getRHSOp x = (case getRHS x      fun getRHSOp x = (case SrcIR.Var.getDef x
39             of SrcIR.OP(rator, args) => (rator, args)             of SrcIR.OP(rator, args) => (rator, args)
40              | rhs => raise Fail(concat[              | rhs => raise Fail(concat[
41                    "expected rhs operator for ", SrcIR.Var.toString x,                    "expected rhs operator for ", SrcIR.Var.toString x,

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