projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45cbf5e
)
check for unreachable code only with -DDEBUG
author
Norman Ramsey
<nr@eecs.harvard.edu>
Tue, 11 Sep 2007 14:24:10 +0000
(14:24 +0000)
committer
Norman Ramsey
<nr@eecs.harvard.edu>
Tue, 11 Sep 2007 14:24:10 +0000
(14:24 +0000)
compiler/cmm/MkZipCfg.hs
patch
|
blob
|
history
diff --git
a/compiler/cmm/MkZipCfg.hs
b/compiler/cmm/MkZipCfg.hs
index
385b41d
..
3d6f344
100644
(file)
--- a/
compiler/cmm/MkZipCfg.hs
+++ b/
compiler/cmm/MkZipCfg.hs
@@
-321,11
+321,16
@@
mkWhileDo cbranch body =
note_this_code_becomes_unreachable ::
(Monad m, LastNode l, Outputable middle, Outputable l) => ZTail middle l -> m ()
note_this_code_becomes_unreachable ::
(Monad m, LastNode l, Outputable middle, Outputable l) => ZTail middle l -> m ()
+#ifdef DEBUG
note_this_code_becomes_unreachable = u
where u (ZLast LastExit) = return ()
u (ZLast (LastOther l)) | isBranchNode l = return ()
-- Note [Branch follows branch]
u tail = fail ("unreachable code: " ++ showSDoc (ppr tail))
note_this_code_becomes_unreachable = u
where u (ZLast LastExit) = return ()
u (ZLast (LastOther l)) | isBranchNode l = return ()
-- Note [Branch follows branch]
u tail = fail ("unreachable code: " ++ showSDoc (ppr tail))
+#else
+note_this_code_becomes_unreachable = return ()
+#endif
+
{-
Note [Branch follows branch]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{-
Note [Branch follows branch]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~