summaryrefslogtreecommitdiff
path: root/src/corify.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2013-10-10 18:01:30 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2013-10-10 18:01:30 -0400
commit08bee251e9471ab1c1e634e85cd2e1c3830cd566 (patch)
tree36da11fa0eda62dae9ec1f9b6b2e759f28039265 /src/corify.sml
parent8b2c97e6fe1a63cb59655d83c1411fe75d9505d4 (diff)
Make transactional FFI functions effectful by default
Diffstat (limited to 'src/corify.sml')
-rw-r--r--src/corify.sml21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/corify.sml b/src/corify.sml
index 5cfd87b3..4ab45983 100644
--- a/src/corify.sml
+++ b/src/corify.sml
@@ -796,7 +796,7 @@ fun corifyDecl mods (all as (d, loc : EM.span), st) =
end
| L.DFfiStr (m, n, (sgn, _)) =>
- (case sgn of
+ (print ("~~~" ^ m ^ "\n"); case sgn of
L.SgnConst sgis =>
let
val (ds, cmap, conmap, st, _) =
@@ -936,7 +936,26 @@ fun corifyDecl mods (all as (d, loc : EM.span), st) =
in
transactify c
end
+
+ fun isTransactional (c, _) =
+ case c of
+ L'.TFun (_, c) => isTransactional c
+ | L'.CApp ((L'.CFfi ("Basis", "transaction"), _), _) => true
+ | _ => false
in
+ Print.epreface (x, CorePrint.p_con CoreEnv.empty c);
+
+ if isTransactional c then
+ let
+ val ffi = (m, x)
+ in
+ if Settings.isBenignEffectful ffi then
+ ()
+ else
+ Settings.addEffectful ffi
+ end
+ else
+ ();
(ds,
SM.insert (cmap, x, c),
conmap,