X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FMkZipCfg.hs;h=2ce28ac42e58ee88042022d76d6d45bbeb25d743;hb=4ddba4629c5396bec766b598fe32d874a378d7bb;hp=8b0284c411c43ee2f3d0e9d5372b6b0af9d74bed;hpb=9173913b7bb53e0ed3d64d1e28324007c77646cc;p=ghc-hetmet.git diff --git a/compiler/cmm/MkZipCfg.hs b/compiler/cmm/MkZipCfg.hs index 8b0284c..2ce28ac 100644 --- a/compiler/cmm/MkZipCfg.hs +++ b/compiler/cmm/MkZipCfg.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -Wall -fno-warn-name-shadowing #-} +{-# LANGUAGE ScopedTypeVariables #-} module MkZipCfg ( AGraph, (<*>), emptyAGraph, withFreshLabel, withUnique , mkMiddle, mkMiddles, mkLast, mkZTail, mkBranch, mkLabel, mkIfThenElse, mkWhileDo @@ -197,6 +197,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