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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/tree-ir/tree-pp.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/tree-ir/tree-pp.sml

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

revision 3844, Tue May 10 19:15:03 2016 UTC revision 3857, Sat May 14 14:13:04 2016 UTC
# Line 45  Line 45 
45                  in                  in
46                    lp :: argToS(args, rp :: l)                    lp :: argToS(args, rp :: l)
47                  end                  end
48            and toS (IR.E_Global x, l) = "::" :: GVar.toString x :: l            and toS (IR.E_Global x, l) = GVar.toString x :: l
49              | toS (IR.E_State x, l) = SVar.toString x :: l              | toS (IR.E_State(NONE, x), l) = "self." :: SVar.toString x :: l
50                | toS (IR.E_State(SOME e, fld), l) = toS (e, "." :: SVar.toString fld :: l)
51              | toS (IR.E_Var x, l) = Var.name x :: l              | toS (IR.E_Var x, l) = Var.name x :: l
52              | toS (IR.E_Lit lit, l) = Literal.toString lit :: l              | toS (IR.E_Lit lit, l) = Literal.toString lit :: l
53              | toS (IR.E_Op(rator, args), l) = Op.toString rator :: argsToS ("(", args, ")", l)              | toS (IR.E_Op(rator, args), l) = Op.toString rator :: argsToS ("(", args, ")", l)
54                | toS (IR.E_Vec args, l) = argsToS ("#[", args, "]", l)
55              | toS (IR.E_Cons(args, ty), l) =              | toS (IR.E_Cons(args, ty), l) =
56                  "<" :: Ty.toString ty :: ">" :: argsToS ("[", args, "]", l)                  "<" :: Ty.toString ty :: ">" :: argsToS ("[", args, "]", l)
57              | toS (IR.E_Seq(args, ty), l) =              | toS (IR.E_Seq(args, ty), l) =
58                  "<" :: Ty.toString ty :: ">" :: argsToS ("{", args, "}", l)                  "<" :: Ty.toString ty :: ">" :: argsToS ("{", args, "}", l)
59              | toS (IR.E_Pack es, l) = "PACK" :: argsToS ("(", es, ")", l)              | toS (IR.E_Pack(_, es), l) = "PACK" :: argsToS ("(", es, ")", l)
60              | toS (IR.E_VLoad(layout, e, i), l) =              | toS (IR.E_VLoad(layout, e, i), l) =
61                  "LOAD_"  :: Int.toString i :: "(" :: toS(e, ")" :: l)                  "LOAD_"  :: Int.toString i :: "(" :: toS(e, ")" :: l)
62            in            in
# Line 107  Line 109 
109            val out' = incIndent out            val out' = incIndent out
110            in            in
111              pr (out, "{\n");              pr (out, "{\n");
112              List.app (ppVarDecl out') locals;              List.app (ppVarDecl out') (!locals);
113              List.app (fn stm => ppStm(out', stm)) body;              List.app (fn stm => ppStm(out', stm)) body;
114              indent out; pr (out, "}")              indent out; pr (out, "}")
115            end            end
# Line 118  Line 120 
120                  in                  in
121                    List.app (fn s => prln(out, ["// ", s, "\n"])) text                    List.app (fn s => prln(out, ["// ", s, "\n"])) text
122                  end                  end
123              | IR.S_Unpack([], e) => raise Fail "empty lhs for Unpack"              | IR.S_Assign(true, x, e) =>
124              | IR.S_Unpack(x::xs, e) => (                  prln(out, [Ty.toString(Var.ty x), " ", Var.name x, " = ", expToString e, ";\n"])
125                | IR.S_Assign(false, x, e) => prln(out, [Var.name x, " = ", expToString e, ";\n"])
126                | IR.S_MAssign([], e) => prln(out, [expToString e, ";\n"])
127                | IR.S_MAssign([x], e) => prln(out, [Var.name x, " = ", expToString e, ";\n"])
128                | IR.S_MAssign(x::xs, e) => (
129                  prln(out, ["(", Var.name x]);                  prln(out, ["(", Var.name x]);
130                  List.app (fn x => prl(out, [",", Var.name x])) xs;                  List.app (fn x => prl(out, [",", Var.name x])) xs;
131                  prl (out, [") = UNPACK(", expToString e, ");\n"]))                  prl (out, [") = ", expToString e, ";\n"]))
             | IR.S_Assign(x, e) => prln(out, [Var.name x, " = ", expToString e, ";\n"])  
132              | IR.S_GAssign(x, e) => prln(out, [GVar.name x, " = ", expToString e, ";\n"])              | IR.S_GAssign(x, e) => prln(out, [GVar.name x, " = ", expToString e, ";\n"])
133              | IR.S_IfThen(cond, blk) => (              | IR.S_IfThen(cond, blk) => (
134                  prln (out, ["if (", expToString cond, ") "]);                  prln (out, ["if (", expToString cond, ") "]);

Legend:
Removed from v.3844  
changed lines
  Added in v.3857

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