diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-12-18 10:56:31 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-12-18 10:56:31 -0500 |
commit | 496433cdd2f108b483e4762776dfe1305c466eee (patch) | |
tree | 294baafc0fd3480fdce266c71f27090164d2114c /src/corify.sml | |
parent | 8f2b2ce3da639c8a140d21a22b0ae67dbbdc649d (diff) |
postBody type
Diffstat (limited to 'src/corify.sml')
-rw-r--r-- | src/corify.sml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corify.sml b/src/corify.sml index c3a53094..075047a2 100644 --- a/src/corify.sml +++ b/src/corify.sml @@ -1011,11 +1011,19 @@ fun corifyDecl mods (all as (d, loc : EM.span), st) = t, tf, e), loc), (L.TFun (t, tf), loc))) ((L.EApp (ef, ea), loc), ranT) args + + val expKind = if List.exists (fn t => + case corifyCon st t of + (L'.CFfi ("Basis", "postBody"), _) => true + | _ => false) args then + L'.Extern L'.ReadCookieWrite + else + L'.Link in ((L.DVal ("wrap_" ^ s, 0, tf, e), loc) :: wds, (fn st => case #1 (corifyExp st (L.EModProj (en, [], "wrap_" ^ s), loc)) of - L'.ENamed n => (L'.DExport (L'.Link, n, false), loc) + L'.ENamed n => (L'.DExport (expKind, n, false), loc) | _ => raise Fail "Corify: Value to export didn't corify properly") :: eds) end |