Put debugIsOn in Util, rather than rely on it being CPPed in
authorIan Lynagh <igloo@earth.li>
Sat, 29 Mar 2008 13:57:55 +0000 (13:57 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 29 Mar 2008 13:57:55 +0000 (13:57 +0000)
compiler/HsVersions.h
compiler/cmm/MkZipCfg.hs
compiler/cmm/ZipCfgCmmRep.hs
compiler/utils/Util.lhs

index c8c09e6..034a9bc 100644 (file)
@@ -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
index 6019549..484068a 100644 (file)
@@ -15,6 +15,7 @@ import Outputable
 import Unique
 import UniqFM
 import UniqSupply
+import Util
 
 import Prelude hiding (zip, unzip, last)
 
index 8c1b461..9193a95 100644 (file)
@@ -28,6 +28,7 @@ import MachOp
 import qualified ZipDataflow0 as DF
 import ZipCfg 
 import MkZipCfg
+import Util
 
 import Maybes
 import Outputable
index 59f3b47..9537ae1 100644 (file)
@@ -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}
 %*                                                                      *
 %************************************************************************