summaryrefslogtreecommitdiff
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-04-15 10:00:30 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-04-15 10:00:30 -0400
commitbe44e5e224dbcc3f8cd9b4d3428f7e6bb229b477 (patch)
tree1c801afa0b5552f7e73697de20c0b35160590932 /src/reduce.sml
parent19f990b4515554027feacfc2b52c1f89f0521759 (diff)
'also' policies and policy reduction; calendar in good shape
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index cefe1955..b2911a5f 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -668,14 +668,23 @@ fun reduce file =
exp = fn (_, n) => n + 1} 0
fun mayInline (polyC, n, t, e) =
- case IM.find (uses, n) of
- NONE => false
- | SOME count => count <= 1
- orelse (case #1 e of
- ERecord _ => true
- | _ => false)
- orelse isPoly polyC t
- orelse size e <= Settings.getCoreInline ()
+ let
+ fun isPolicy t =
+ case #1 t of
+ CFfi ("Basis", "sql_policy") => true
+ | TFun (_, t) => isPolicy t
+ | _ => false
+ in
+ case IM.find (uses, n) of
+ NONE => false
+ | SOME count => count <= 1
+ orelse (case #1 e of
+ ERecord _ => true
+ | _ => false)
+ orelse isPolicy t
+ orelse isPoly polyC t
+ orelse size e <= Settings.getCoreInline ()
+ end
fun doDecl (d as (_, loc), st as (polyC, namedC, namedE)) =
case #1 d of