Commit 71847273 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Put debugIsOn in Util, rather than rely on it being CPPed in

parent f555abff
......@@ -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
......
......@@ -15,6 +15,7 @@ import Outputable
import Unique
import UniqFM
import UniqSupply
import Util
import Prelude hiding (zip, unzip, last)
......
......@@ -28,6 +28,7 @@ import MachOp
import qualified ZipDataflow0 as DF
import ZipCfg
import MkZipCfg
import Util
import Maybes
import Outputable
......
......@@ -6,6 +6,7 @@
\begin{code}
module Util (
debugIsOn,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
......@@ -105,6 +106,21 @@ import System.Time ( ClockTime )
infixr 9 `thenCmp`
\end{code}
%************************************************************************
%* *
\subsection{-DDEBUG}
%* *
%************************************************************************
\begin{code}
debugIsOn :: Bool
#ifdef DEBUG
debugIsOn = True
#else
debugIsOn = False
#endif
\end{code}
%************************************************************************
%* *
\subsection{A for loop}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment