Always define rtsOptsEnabled in the "extra object" when linking
authorIan Lynagh <igloo@earth.li>
Tue, 11 Oct 2011 20:49:35 +0000 (21:49 +0100)
committerIan Lynagh <igloo@earth.li>
Tue, 11 Oct 2011 21:33:38 +0000 (22:33 +0100)
Now that we always link in an extra object, we may as well always
define rtsOptsEnabled in it, rather than having a default value in
rts/hooks/RtsOptsEnabled.c.

compiler/main/DriverPipeline.hs
rts/hooks/RtsOptsEnabled.c [deleted file]

index 220fac0..b655425 100644 (file)
@@ -1442,16 +1442,11 @@ mkExtraObjToLinkIntoBinary dflags dep_packages = do
                                                   -- keep gcc happy
 
   where
-    mk_rts_opts_enabled val
+    rts_opts_enabled
          = vcat [text "#include \"Rts.h\"",
                  text "#include \"RtsOpts.h\"",
                  text "const RtsOptsEnabledEnum rtsOptsEnabled = " <>
-                       text val <> semi ]
-
-    rts_opts_enabled = case rtsOptsEnabled dflags of
-          RtsOptsNone     -> mk_rts_opts_enabled "RtsOptsNone"
-          RtsOptsSafeOnly -> empty -- The default
-          RtsOptsAll      -> mk_rts_opts_enabled "RtsOptsAll"
+                       text (show (rtsOptsEnabled dflags)) <> semi ]
 
     extra_rts_opts = case rtsOpts dflags of
           Nothing   -> empty
diff --git a/rts/hooks/RtsOptsEnabled.c b/rts/hooks/RtsOptsEnabled.c
deleted file mode 100644 (file)
index f20c325..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -----------------------------------------------------------------------------
- *
- * (c) The GHC Team 2010
- *
- * En/disable RTS options
- *
- * ---------------------------------------------------------------------------*/
-
-#include "Rts.h"
-#include "RtsOpts.h"
-
-const RtsOptsEnabledEnum rtsOptsEnabled = RtsOptsSafeOnly;
-