make it easier to have debugging code typechecked even when debugging is turned off
authorNorman Ramsey <nr@eecs.harvard.edu>
Wed, 12 Sep 2007 15:25:02 +0000 (15:25 +0000)
committerNorman Ramsey <nr@eecs.harvard.edu>
Wed, 12 Sep 2007 15:25:02 +0000 (15:25 +0000)
compiler/HsVersions.h

index a53fb4b..464bf82 100644 (file)
@@ -37,12 +37,14 @@ name = Util.global (value) :: IORef (ty); \
 #define COMMA ,
 
 #ifdef DEBUG
 #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 WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg))
 #define ASSERTM(mbool) do { bool <- mbool; ASSERT(bool) return () }
 #define ASSERTM2(mbool,msg) do { bool <- mbool; ASSERT2(bool,msg) return () }
 #else
 #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 WARN( e, msg ) (warnPprTrace (e) __FILE__ __LINE__ (msg))
 #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
 -- 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