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

SCM Repository

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

Diff of /branches/lamont_dev/src/compiler/IL/ssa-fn.sml

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

revision 411, Sat Oct 16 15:03:18 2010 UTC revision 412, Sat Oct 16 15:19:19 2010 UTC
# Line 223  Line 223 
223          structure Tbl : MONO_HASH_TABLE where type Key.hash_key = var          structure Tbl : MONO_HASH_TABLE where type Key.hash_key = var
224        end        end
225    
226      (* return a string representation of a PHI node *)
227        val phiToString : (var * var list) -> string
228    
229      (* return a string representation of an assignment *)
230        val assignToString : assign -> string
231    
232    (* DFS sorting of the graph rooted at the entry to a statement; the resulting list will    (* DFS sorting of the graph rooted at the entry to a statement; the resulting list will
233     * be in preorder with parents before children.     * be in preorder with parents before children.
234     *)     *)
# Line 577  Line 583 
583            end)            end)
584        end        end
585    
586      (* return a string representation of a PHI node *)
587        fun phiToString (y, xs) = String.concat [
588                Ty.toString(Var.ty y), " ", Var.toString y, " = PHI(",
589                String.concatWith "," (List.map Var.toString xs), ")"
590              ]
591    
592      (* return a string representation of an assignment *)
593        fun assignToString (y, rhs) = let
594              val rhs = (case rhs
595                     of VAR x => Var.toString x
596                      | LIT lit => Literal.toString lit
597                      | OP(rator, xs) => String.concat [
598                            Op.toString rator,
599                            "(", String.concatWith "," (List.map Var.toString xs), ")"
600                          ]
601                      | CONS xs => String.concat [
602                            "[", String.concatWith "," (List.map Var.toString xs), "]"
603                          ]
604                    (* end case *))
605              in
606                String.concat [Ty.toString(Var.ty y), " ", Var.toString y, " = ", rhs]
607              end
608    
609    (* DFS sorting of the graph rooted at the entry to a statement; the resulting list will    (* DFS sorting of the graph rooted at the entry to a statement; the resulting list will
610     * be in preorder with parents before children.     * be in preorder with parents before children.
611     *)     *)

Legend:
Removed from v.411  
changed lines
  Added in v.412

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