aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-02-09 19:29:36 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2014-02-09 19:29:36 -0500
commita9e2b0c2efbddf0ec9e7199c486b7f0ed736d6e8 (patch)
tree6f8ada3a60592e24810778e8b2e788c35c20e11a /src
parent4063d1c5696438d73c0b15d7552e7717327e8ba1 (diff)
neverInline
Diffstat (limited to 'src')
-rw-r--r--src/compiler.sml1
-rw-r--r--src/mono_reduce.sml9
-rw-r--r--src/settings.sig3
-rw-r--r--src/settings.sml4
4 files changed, 13 insertions, 4 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 21ae903f..cc4e33c5 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -869,6 +869,7 @@ fun parseUrp' accLibs fname =
NONE => ErrorMsg.error ("invalid mono inline level '" ^ arg ^ "'")
| SOME n => Settings.setMonoInline n)
| "alwaysInline" => Settings.addAlwaysInline arg
+ | "neverInline" => Settings.addNeverInline arg
| "noXsrfProtection" => Settings.addNoXsrfProtection arg
| "timeFormat" => Settings.setTimeFormat arg
| "noMangleSql" => Settings.setMangleSql false
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml
index 846a878b..c92ce5aa 100644
--- a/src/mono_reduce.sml
+++ b/src/mono_reduce.sml
@@ -395,10 +395,11 @@ fun reduce (file : file) =
fun mayInline (n, e, t, s) =
case IM.find (uses, n) of
NONE => false
- | SOME count => count <= 1
- orelse size e <= Settings.getMonoInline ()
- orelse functionInside t
- orelse Settings.checkAlwaysInline s
+ | SOME count => not (Settings.checkNeverInline s)
+ andalso (count <= 1
+ orelse size e <= Settings.getMonoInline ()
+ orelse functionInside t
+ orelse Settings.checkAlwaysInline s)
fun summarize d (e, _) =
let
diff --git a/src/settings.sig b/src/settings.sig
index a7a41447..20dd00c2 100644
--- a/src/settings.sig
+++ b/src/settings.sig
@@ -252,6 +252,9 @@ signature SETTINGS = sig
val addAlwaysInline : string -> unit
val checkAlwaysInline : string -> bool
+ val addNeverInline : string -> unit
+ val checkNeverInline : string -> bool
+
val addNoXsrfProtection : string -> unit
val checkNoXsrfProtection : string -> bool
diff --git a/src/settings.sml b/src/settings.sml
index 93f54427..020ca5a4 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -688,6 +688,10 @@ val alwaysInline = ref SS.empty
fun addAlwaysInline s = alwaysInline := SS.add (!alwaysInline, s)
fun checkAlwaysInline s = SS.member (!alwaysInline, s)
+val neverInline = ref SS.empty
+fun addNeverInline s = neverInline := SS.add (!neverInline, s)
+fun checkNeverInline s = SS.member (!neverInline, s)
+
val noXsrfProtection = ref SS.empty
fun addNoXsrfProtection s = noXsrfProtection := SS.add (!noXsrfProtection, s)
fun checkNoXsrfProtection s = SS.member (!noXsrfProtection, s)