projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
907c44c
)
Make various assertions work when !DEBUG
author
Ian Lynagh
<igloo@earth.li>
Sat, 8 Sep 2007 00:31:12 +0000
(
00:31
+0000)
committer
Ian Lynagh
<igloo@earth.li>
Sat, 8 Sep 2007 00:31:12 +0000
(
00:31
+0000)
12 files changed:
compiler/HsVersions.h
patch
|
blob
|
history
compiler/basicTypes/Var.lhs
patch
|
blob
|
history
compiler/codeGen/CgCon.lhs
patch
|
blob
|
history
compiler/codeGen/CgUtils.hs
patch
|
blob
|
history
compiler/codeGen/CodeGen.lhs
patch
|
blob
|
history
compiler/coreSyn/CoreLint.lhs
patch
|
blob
|
history
compiler/main/CmdLineParser.hs
patch
|
blob
|
history
compiler/main/GHC.hs
patch
|
blob
|
history
compiler/nativeGen/RegAllocLinear.hs
patch
|
blob
|
history
compiler/specialise/SpecConstr.lhs
patch
|
blob
|
history
compiler/stgSyn/CoreToStg.lhs
patch
|
blob
|
history
compiler/typecheck/TcGadt.lhs
patch
|
blob
|
history
diff --git
a/compiler/HsVersions.h
b/compiler/HsVersions.h
index
fb47f7c
..
a53fb4b
100644
(file)
--- a/
compiler/HsVersions.h
+++ b/
compiler/HsVersions.h
@@
-48,8
+48,9
@@
name = Util.global (value) :: IORef (ty); \
#define ASSERT(e) if False && (not (e)) then panic "ASSERT" else
#define ASSERT2(e,msg) if False && (not (e)) then pprPanic "ASSERT2" (msg) else
#define ASSERTM(e) do { let { _mbool = (e) } }
#define ASSERT(e) if False && (not (e)) then panic "ASSERT" else
#define ASSERT2(e,msg) if False && (not (e)) then pprPanic "ASSERT2" (msg) else
#define ASSERTM(e) do { let { _mbool = (e) } }
-#define ASSERTM2(e,msg) do { let { _mbool = (e) }; when False (panic "ASSERTM2") }
-#define WARN(e,msg) if False && (e) then pprPanic "WARN" msg else
+-- Here we deliberately don't use when as Control.Monad might not be imported
+#define ASSERTM2(e,msg) do { let { _mbool = (e) }; if False then panic "ASSERTM2" else return () }
+#define WARN(e,msg) if False && (e) then pprPanic "WARN" (msg) else
#endif
-- This #ifndef lets us switch off the "import FastString"
#endif
-- This #ifndef lets us switch off the "import FastString"
diff --git
a/compiler/basicTypes/Var.lhs
b/compiler/basicTypes/Var.lhs
index
2f4edd3
..
4b58a32
100644
(file)
--- a/
compiler/basicTypes/Var.lhs
+++ b/
compiler/basicTypes/Var.lhs
@@
-47,9
+47,7
@@
import {-# SOURCE #-} TypeRep( Type, Kind )
import {-# SOURCE #-} TcType( TcTyVarDetails, pprTcTyVarDetails )
import {-# SOURCE #-} IdInfo( GlobalIdDetails, notGlobalId,
IdInfo, seqIdInfo )
import {-# SOURCE #-} TcType( TcTyVarDetails, pprTcTyVarDetails )
import {-# SOURCE #-} IdInfo( GlobalIdDetails, notGlobalId,
IdInfo, seqIdInfo )
-#ifdef DEBUG
import {-# SOURCE #-} TypeRep( isCoercionKind )
import {-# SOURCE #-} TypeRep( isCoercionKind )
-#endif
import Name hiding (varName)
import Unique
import Name hiding (varName)
import Unique
diff --git
a/compiler/codeGen/CgCon.lhs
b/compiler/codeGen/CgCon.lhs
index
bf4cf3d
..
711c633
100644
(file)
--- a/
compiler/codeGen/CgCon.lhs
+++ b/
compiler/codeGen/CgCon.lhs
@@
-51,9
+51,7
@@
import Type
import PrelInfo
import Outputable
import ListSetOps
import PrelInfo
import Outputable
import ListSetOps
-#ifdef DEBUG
-import Util ( lengthIs )
-#endif
+import Util
\end{code}
\end{code}
diff --git
a/compiler/codeGen/CgUtils.hs
b/compiler/codeGen/CgUtils.hs
index
7101a4d
..
260248d
100644
(file)
--- a/
compiler/codeGen/CgUtils.hs
+++ b/
compiler/codeGen/CgUtils.hs
@@
-74,9
+74,7
@@
import Util
import DynFlags
import FastString
import PackageConfig
import DynFlags
import FastString
import PackageConfig
-#ifdef DEBUG
import Outputable
import Outputable
-#endif
import Data.Char
import Data.Bits
import Data.Char
import Data.Bits
diff --git
a/compiler/codeGen/CodeGen.lhs
b/compiler/codeGen/CodeGen.lhs
index
a53ff49
..
4221342
100644
(file)
--- a/
compiler/codeGen/CodeGen.lhs
+++ b/
compiler/codeGen/CodeGen.lhs
@@
-54,10
+54,7
@@
import OccName
import TyCon
import Module
import ErrUtils
import TyCon
import Module
import ErrUtils
-
-#ifdef DEBUG
import Panic
import Panic
-#endif
\end{code}
\begin{code}
\end{code}
\begin{code}
diff --git
a/compiler/coreSyn/CoreLint.lhs
b/compiler/coreSyn/CoreLint.lhs
index
c4c48a7
..
07e1284
100644
(file)
--- a/
compiler/coreSyn/CoreLint.lhs
+++ b/
compiler/coreSyn/CoreLint.lhs
@@
-44,11
+44,7
@@
import BasicTypes
import StaticFlags
import DynFlags
import Outputable
import StaticFlags
import DynFlags
import Outputable
-
-#ifdef DEBUG
-import Util ( notNull )
-#endif
-
+import Util
import Data.Maybe
\end{code}
import Data.Maybe
\end{code}
diff --git
a/compiler/main/CmdLineParser.hs
b/compiler/main/CmdLineParser.hs
index
148dbe8
..
3373143
100644
(file)
--- a/
compiler/main/CmdLineParser.hs
+++ b/
compiler/main/CmdLineParser.hs
@@
-24,9
+24,7
@@
module CmdLineParser (
#include "HsVersions.h"
import Util ( maybePrefixMatch, notNull, removeSpaces )
#include "HsVersions.h"
import Util ( maybePrefixMatch, notNull, removeSpaces )
-#ifdef DEBUG
-import Panic ( assertPanic )
-#endif
+import Panic
data OptKind m -- Suppose the flag is -f
= NoArg (m ()) -- -f all by itself
data OptKind m -- Suppose the flag is -f
= NoArg (m ()) -- -f all by itself
diff --git
a/compiler/main/GHC.hs
b/compiler/main/GHC.hs
index
1656e1c
..
f1c7b88
100644
(file)
--- a/
compiler/main/GHC.hs
+++ b/
compiler/main/GHC.hs
@@
-562,10
+562,8
@@
load2 s@(Session ref) how_much mod_graph = do
-- (see msDeps)
let all_home_mods = [ms_mod_name s
| s <- mod_graph, not (isBootSummary s)]
-- (see msDeps)
let all_home_mods = [ms_mod_name s
| s <- mod_graph, not (isBootSummary s)]
-#ifdef DEBUG
bad_boot_mods = [s | s <- mod_graph, isBootSummary s,
not (ms_mod_name s `elem` all_home_mods)]
bad_boot_mods = [s | s <- mod_graph, isBootSummary s,
not (ms_mod_name s `elem` all_home_mods)]
-#endif
ASSERT( null bad_boot_mods ) return ()
-- mg2_with_srcimps drops the hi-boot nodes, returning a
ASSERT( null bad_boot_mods ) return ()
-- mg2_with_srcimps drops the hi-boot nodes, returning a
diff --git
a/compiler/nativeGen/RegAllocLinear.hs
b/compiler/nativeGen/RegAllocLinear.hs
index
968b399
..
7c7690c
100644
(file)
--- a/
compiler/nativeGen/RegAllocLinear.hs
+++ b/
compiler/nativeGen/RegAllocLinear.hs
@@
-102,11
+102,9
@@
import UniqSupply
import Outputable
import State
import Outputable
import State
-#ifndef DEBUG
-import Data.Maybe ( fromJust )
-#endif
-import Data.List ( nub, partition, foldl')
-import Control.Monad ( when )
+import Data.Maybe
+import Data.List
+import Control.Monad
import Data.Word
import Data.Bits
import Data.Word
import Data.Bits
@@
-293,10
+291,8
@@
save it in a spill location, but mark it as InBoth because the current
instruction might still want to read it.
-}
instruction might still want to read it.
-}
-#ifdef DEBUG
instance Outputable Loc where
ppr l = text (show l)
instance Outputable Loc where
ppr l = text (show l)
-#endif
-- | Do register allocation on some basic blocks.
-- | Do register allocation on some basic blocks.
diff --git
a/compiler/specialise/SpecConstr.lhs
b/compiler/specialise/SpecConstr.lhs
index
21bca94
..
256674b
100644
(file)
--- a/
compiler/specialise/SpecConstr.lhs
+++ b/
compiler/specialise/SpecConstr.lhs
@@
-1249,12
+1249,10
@@
samePat (vs1, as1) (vs2, as2)
same e1 e2 = WARN( bad e1 || bad e2, ppr e1 $$ ppr e2)
False -- Let, lambda, case should not occur
same e1 e2 = WARN( bad e1 || bad e2, ppr e1 $$ ppr e2)
False -- Let, lambda, case should not occur
-#ifdef DEBUG
bad (Case {}) = True
bad (Let {}) = True
bad (Lam {}) = True
bad other = False
bad (Case {}) = True
bad (Let {}) = True
bad (Lam {}) = True
bad other = False
-#endif
\end{code}
Note [Ignore type differences]
\end{code}
Note [Ignore type differences]
diff --git
a/compiler/stgSyn/CoreToStg.lhs
b/compiler/stgSyn/CoreToStg.lhs
index
aca1f86
..
ddbc632
100644
(file)
--- a/
compiler/stgSyn/CoreToStg.lhs
+++ b/
compiler/stgSyn/CoreToStg.lhs
@@
-215,7
+215,6
@@
coreTopBindToStg this_pkg env body_fvs (Rec pairs)
ASSERT2(consistentCafInfo (head binders) bind, ppr binders)
(env', fvs' `unionFVInfo` body_fvs, bind)
ASSERT2(consistentCafInfo (head binders) bind, ppr binders)
(env', fvs' `unionFVInfo` body_fvs, bind)
-#ifdef DEBUG
-- Assertion helper: this checks that the CafInfo on the Id matches
-- what CoreToStg has figured out about the binding's SRT. The
-- CafInfo will be exact in all cases except when CorePrep has
-- Assertion helper: this checks that the CafInfo on the Id matches
-- what CoreToStg has figured out about the binding's SRT. The
-- CafInfo will be exact in all cases except when CorePrep has
@@
-230,7
+229,6
@@
consistentCafInfo id bind
exact = id_marked_caffy == binding_is_caffy
id_marked_caffy = mayHaveCafRefs (idCafInfo id)
binding_is_caffy = stgBindHasCafRefs bind
exact = id_marked_caffy == binding_is_caffy
id_marked_caffy = mayHaveCafRefs (idCafInfo id)
binding_is_caffy = stgBindHasCafRefs bind
-#endif
\end{code}
\begin{code}
\end{code}
\begin{code}
@@
-1074,7
+1072,6
@@
plusFVInfo (id1,hb1,info1) (id2,hb2,info2)
= ASSERT (id1 == id2 && hb1 `check_eq_how_bound` hb2)
(id1, hb1, combineStgBinderInfo info1 info2)
= ASSERT (id1 == id2 && hb1 `check_eq_how_bound` hb2)
(id1, hb1, combineStgBinderInfo info1 info2)
-#ifdef DEBUG
-- The HowBound info for a variable in the FVInfo should be consistent
check_eq_how_bound ImportBound ImportBound = True
check_eq_how_bound LambdaBound LambdaBound = True
-- The HowBound info for a variable in the FVInfo should be consistent
check_eq_how_bound ImportBound ImportBound = True
check_eq_how_bound LambdaBound LambdaBound = True
@@
-1084,7
+1081,6
@@
check_eq_how_bound hb1 hb2 = False
check_eq_li (NestedLet _) (NestedLet _) = True
check_eq_li TopLet TopLet = True
check_eq_li li1 li2 = False
check_eq_li (NestedLet _) (NestedLet _) = True
check_eq_li TopLet TopLet = True
check_eq_li li1 li2 = False
-#endif
\end{code}
Misc.
\end{code}
Misc.
diff --git
a/compiler/typecheck/TcGadt.lhs
b/compiler/typecheck/TcGadt.lhs
index
6650bde
..
b556e89
100644
(file)
--- a/
compiler/typecheck/TcGadt.lhs
+++ b/
compiler/typecheck/TcGadt.lhs
@@
-39,11
+39,8
@@
import Maybes
import Control.Monad
import Outputable
import TcType
import Control.Monad
import Outputable
import TcType
-
-#ifdef DEBUG
import Unique
import UniqFM
import Unique
import UniqFM
-#endif
\end{code}
\end{code}
@@
-261,7
+258,6
@@
tryToBind tv_set tv | tv `elemVarSet` tv_set = BindMe
%************************************************************************
\begin{code}
%************************************************************************
\begin{code}
-#ifdef DEBUG
badReftElts :: InternalReft -> [(Unique, (Coercion,Type))]
-- Return the BAD elements of the refinement
-- Should be empty; used in asserions only
badReftElts :: InternalReft -> [(Unique, (Coercion,Type))]
-- Return the BAD elements of the refinement
-- Should be empty; used in asserions only
@@
-274,7
+270,6
@@
badReftElts env
| otherwise = False
where
(ty1,ty2) = coercionKind co
| otherwise = False
where
(ty1,ty2) = coercionKind co
-#endif
emptyInternalReft :: InternalReft
emptyInternalReft = emptyVarEnv
emptyInternalReft :: InternalReft
emptyInternalReft = emptyVarEnv