diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-11-27 12:43:28 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-11-27 12:43:28 -0500 |
commit | 960a42fc1844d5f0f6033b3caada6349d588a2a9 (patch) | |
tree | ee3ca9390d833115cec329bfd2c1c7bc7b13e5b6 /src/especialize.sml | |
parent | 82dca6c875cca25d05dfbd5c6a2fb2185b965692 (diff) |
Avoid Especializing polymorphic code
Diffstat (limited to 'src/especialize.sml')
-rw-r--r-- | src/especialize.sml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/especialize.sml b/src/especialize.sml index 335401fe..7abc0582 100644 --- a/src/especialize.sml +++ b/src/especialize.sml @@ -59,6 +59,12 @@ val freeVars = U.Exp.foldB {kind = fn (_, xs) => xs, | _ => bound} 0 IS.empty +val isPoly = U.Decl.exists {kind = fn _ => false, + con = fn _ => false, + exp = fn ECAbs _ => true + | _ => false, + decl = fn _ => false} + fun positionOf (v : int, ls) = let fun pof (pos, ls) = @@ -302,7 +308,11 @@ fun specialize' file = (*val () = Print.prefaces "decl" [("d", CorePrint.p_decl CoreEnv.empty d)]*) - val (d', st) = specDecl [] st d + val (d', st) = + if isPoly d then + (d, st) + else + specDecl [] st d (*val () = print "/decl\n"*) |