summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/HsVersions.h2
-rw-r--r--compiler/cmm/MkZipCfg.hs1
-rw-r--r--compiler/cmm/ZipCfgCmmRep.hs1
-rw-r--r--compiler/utils/Util.lhs16
4 files changed, 18 insertions, 2 deletions
diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h
index c8c09e6294..034a9bc07c 100644
--- a/compiler/HsVersions.h
+++ b/compiler/HsVersions.h
@@ -40,7 +40,6 @@ name = Util.global (value);
#define COMMA ,
#ifdef DEBUG
-#define debugIsOn True
#define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
#define ASSERT2(e,msg) if (not (e)) then (assertPprPanic __FILE__ __LINE__ (msg)) else
#define MASSERT(e) ASSERT(e) return ()
@@ -49,7 +48,6 @@ name = Util.global (value);
#define ASSERTM(mbool) do { bool <- mbool; ASSERT(bool) return () }
#define ASSERTM2(mbool,msg) do { bool <- mbool; ASSERT2(bool,msg) return () }
#else
-#define debugIsOn False
-- We have to actually use all the variables we are given or we may get
-- unused variable warnings when DEBUG is off.
#define ASSERT(e) if False && (not (e)) then panic "ASSERT" else
diff --git a/compiler/cmm/MkZipCfg.hs b/compiler/cmm/MkZipCfg.hs
index 6019549dde..484068ab73 100644
--- a/compiler/cmm/MkZipCfg.hs
+++ b/compiler/cmm/MkZipCfg.hs
@@ -15,6 +15,7 @@ import Outputable
import Unique
import UniqFM
import UniqSupply
+import Util
import Prelude hiding (zip, unzip, last)
diff --git a/compiler/cmm/ZipCfgCmmRep.hs b/compiler/cmm/ZipCfgCmmRep.hs
index 8c1b46156e..9193a9523d 100644
--- a/compiler/cmm/ZipCfgCmmRep.hs
+++ b/compiler/cmm/ZipCfgCmmRep.hs
@@ -28,6 +28,7 @@ import MachOp
import qualified ZipDataflow0 as DF
import ZipCfg
import MkZipCfg
+import Util
import Maybes
import Outputable
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index 59f3b4740d..9537ae1f37 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -6,6 +6,7 @@
\begin{code}
module Util (
+ debugIsOn,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
@@ -107,6 +108,21 @@ infixr 9 `thenCmp`
%************************************************************************
%* *
+\subsection{-DDEBUG}
+%* *
+%************************************************************************
+
+\begin{code}
+debugIsOn :: Bool
+#ifdef DEBUG
+debugIsOn = True
+#else
+debugIsOn = False
+#endif
+\end{code}
+
+%************************************************************************
+%* *
\subsection{A for loop}
%* *
%************************************************************************