X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FMkZipCfg.hs;h=7df775fa90974f6d6d43b55012766048a1e7d226;hb=0f4cdf0261a0dcdade830ea89664ab58efd61ab3;hp=9b9989c465f95d4396f6f463aad8524eed98e4b9;hpb=1241c26f3552a2037263769e5ef7fa68d9f3be36;p=ghc-hetmet.git diff --git a/compiler/cmm/MkZipCfg.hs b/compiler/cmm/MkZipCfg.hs index 9b9989c..7df775f 100644 --- a/compiler/cmm/MkZipCfg.hs +++ b/compiler/cmm/MkZipCfg.hs @@ -17,6 +17,7 @@ import UniqSupply import Prelude hiding (zip, unzip, last) +#include "HsVersions.h" ------------------------------------------------------------------------- -- GENERIC ZIPPER-BASED CONTROL-FLOW GRAPH (CONSTRUCTOR VIEW) -- @@ -197,6 +198,13 @@ mkBranch :: (Outputable m, Outputable l, LastNode l) => BlockId -> AGraph m l -- | For the structured control-flow constructs, a condition is -- represented as a function that takes as arguments the labels to -- goto on truth or falsehood. +-- +-- mkIfThenElse mk_cond then else +-- = (mk_cond L1 L2) <*> L1: then <*> goto J +-- <*> L2: else <*> goto J +-- <*> J: +-- +-- where L1, L2, J are fresh mkIfThenElse :: (Outputable m, Outputable l, LastNode l) => (BlockId -> BlockId -> AGraph m l) -- branch condition @@ -320,15 +328,11 @@ mkWhileDo cbranch body = 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 +note_this_code_becomes_unreachable = if debugIsOn then u else \_ -> return () 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] @@ -340,3 +344,6 @@ giving it a label, and start a new one that branches to that label. Emitting a Branch at this point is fine: goto L1; L2: ...stuff... -} + +_unused :: FS.FastString +_unused = undefined