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

SCM Repository

[diderot] Diff of /trunk/src/compiler/IL/ssa-check-fn.sml
ViewVC logotype

Diff of /trunk/src/compiler/IL/ssa-check-fn.sml

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

revision 264, Tue Aug 10 17:36:47 2010 UTC revision 265, Tue Aug 10 21:16:06 2010 UTC
# Line 17  Line 17 
17   *   4) arity of operators   *   4) arity of operators
18   *)   *)
19    
20        fun checkRHS (OP(rator, args)) =
21            (* check operator arity *)
22              if Op.arity rator <> List.length args
23                then (* error *)
24                else ()
25          | checkRHS _ = ()
26    
27        fun checkNode (node as IL.ND{kind, ...}) = let
28              val preds = IL.Node.preds nd
29              val succs = IL.Node.succs nd
30              val inList = List.exists (fn nd => IL.Node.same(node, nd))
31              in
32                if List.all (fn nd => inList(IL.Node.succs nd)) (IL.Node.preds nd)
33                  then ()
34                  else (* error: predecessor/successor mismatch *);
35                if List.all (fn nd => inList(IL.Node.preds nd)) (IL.Node.succs nd)
36                  then ()
37                  else (* error: successor/predecessor mismatch *);
38                case kind
39                 of NULL => (* error: unexpected NULL *)
40                  | JOIN{phis, ...} =>
41                  | BLOCK{body, ...} =>
42                  | _ => ()
43                (* end case *))
44              end
45    
46    end    end

Legend:
Removed from v.264  
changed lines
  Added in v.265

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