comparison src/monoize.sml @ 2084:0d48cfb59b29

More aggressive inlining of 'let' with record literals, plus some changes to Monoization of queries, to make inlining more common
author Adam Chlipala <adam@chlipala.net>
date Thu, 04 Dec 2014 02:47:24 -0500
parents f05fcb206571
children 9a1547596712 5709482a2afd
comparison
equal deleted inserted replaced
2083:9f65e2188d3c 2084:0d48cfb59b29
1990 (L'.TRecord [("Rows", s), ("OrderBy", s), ("Limit", s), ("Offset", s)], loc), 1990 (L'.TRecord [("Rows", s), ("OrderBy", s), ("Limit", s), ("Offset", s)], loc),
1991 s, 1991 s,
1992 strcat [gf "Rows", 1992 strcat [gf "Rows",
1993 (L'.ECase (gf "OrderBy", 1993 (L'.ECase (gf "OrderBy",
1994 [((L'.PPrim (Prim.String (Prim.Normal, "")), loc), str ""), 1994 [((L'.PPrim (Prim.String (Prim.Normal, "")), loc), str ""),
1995 ((L'.PWild, loc), 1995 ((L'.PVar ("orderby", s), loc),
1996 strcat [str " ORDER BY ", 1996 strcat [str " ORDER BY ",
1997 gf "OrderBy"])], 1997 (L'.ERel 0, loc)])],
1998 {disc = s, result = s}), loc), 1998 {disc = s, result = s}), loc),
1999 gf "Limit", 1999 gf "Limit",
2000 gf "Offset"]), loc), fm) 2000 gf "Offset"]), loc), fm)
2001 end 2001 end
2002 2002
2101 result = s}), loc), 2101 result = s}), loc),
2102 (L'.ECase (gf "Where", 2102 (L'.ECase (gf "Where",
2103 [((L'.PPrim (Prim.String (Prim.Normal, #trueString (Settings.currentDbms ()))), 2103 [((L'.PPrim (Prim.String (Prim.Normal, #trueString (Settings.currentDbms ()))),
2104 loc), 2104 loc),
2105 str ""), 2105 str ""),
2106 ((L'.PWild, loc), 2106 ((L'.PVar ("where", s), loc),
2107 strcat [str " WHERE ", gf "Where"])], 2107 strcat [str " WHERE ", (L'.ERel 0, loc)])],
2108 {disc = s, 2108 {disc = s,
2109 result = s}), loc), 2109 result = s}), loc),
2110 2110
2111 if List.all (fn (x, xts) => 2111 if List.all (fn (x, xts) =>
2112 case List.find (fn (x', _) => x' = x) grouped of 2112 case List.find (fn (x', _) => x' = x) grouped of
2130 2130
2131 (L'.ECase (gf "Having", 2131 (L'.ECase (gf "Having",
2132 [((L'.PPrim (Prim.String 2132 [((L'.PPrim (Prim.String
2133 (Prim.Normal, #trueString (Settings.currentDbms ()))), loc), 2133 (Prim.Normal, #trueString (Settings.currentDbms ()))), loc),
2134 str ""), 2134 str ""),
2135 ((L'.PWild, loc), 2135 ((L'.PVar ("having", s), loc),
2136 strcat [str " HAVING ", gf "Having"])], 2136 strcat [str " HAVING ", (L'.ERel 0, loc)])],
2137 {disc = s, 2137 {disc = s,
2138 result = s}), loc) 2138 result = s}), loc)
2139 ]), loc), 2139 ]), loc),
2140 fm) 2140 fm)
2141 end 2141 end