X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FIfaceSyn.lhs;h=55cd6d1963dbcf14676e04268025cc30c294827d;hb=d5934bbb856aa0aa620c9b2e0fa51c90a1a5a048;hp=a8426081a8efa2becde6de3bd54454fa0da47f51;hpb=b00b5bc04ff36a551552470060064f0b7d84ca30;p=ghc-hetmet.git diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index a842608..55cd6d1 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -1,14 +1,7 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 % -%************************************************************************ -%* * -\section[HsCore]{Core-syntax unfoldings in Haskell interface files} -%* * -%************************************************************************ - -We could either use this, or parameterise @GenCoreExpr@ on @Types@ and -@TyVars@ as well. Currently trying the former... MEGA SIGH. \begin{code} module IfaceSyn ( @@ -24,7 +17,7 @@ module IfaceSyn ( -- Equality GenIfaceEq(..), IfaceEq, (&&&), bool, eqListBy, eqMaybeBy, - eqIfDecl, eqIfInst, eqIfRule, checkBootDecl, + eqIfDecl, eqIfInst, eqIfFamInst, eqIfRule, checkBootDecl, -- Pretty printing pprIfaceExpr, pprIfaceDeclHead @@ -35,25 +28,23 @@ module IfaceSyn ( import CoreSyn import IfaceType -import NewDemand ( StrictSig, pprIfaceStrictSig ) -import Class ( FunDep, DefMeth, pprFundeps ) -import OccName -import UniqFM ( UniqFM, emptyUFM, addToUFM, lookupUFM ) -import Unique ( mkBuiltinUnique ) +import NewDemand +import Class +import UniqFM +import Unique import NameSet -import Name ( Name, NamedThing(..), isExternalName, - mkInternalName ) -import CostCentre ( CostCentre, pprCostCentreCore ) -import Literal ( Literal ) -import ForeignCall ( ForeignCall ) -import SrcLoc ( noSrcLoc ) +import Name +import CostCentre +import Literal +import ForeignCall +import SrcLoc import BasicTypes import Outputable import FastString -import Maybes ( catMaybes ) +import Module -import Data.List ( nub ) -import Data.Maybe ( isJust ) +import Data.List +import Data.Maybe infixl 3 &&& infix 4 `eqIfExt`, `eqIfIdInfo`, `eqIfType` @@ -219,6 +210,8 @@ data IfaceExpr data IfaceNote = IfaceSCC CostCentre | IfaceInlineMe | IfaceCoreNote String + | IfaceTickBox Module Int + | IfaceBinaryTickBox Module Int Int type IfaceAlt = (IfaceConAlt, [FastString], IfaceExpr) -- Note: FastString, not IfaceBndr (and same with the case binder) @@ -492,6 +485,13 @@ instance Outputable IfaceNote where ppr (IfaceSCC cc) = pprCostCentreCore cc ppr IfaceInlineMe = ptext SLIT("__inline_me") ppr (IfaceCoreNote s) = ptext SLIT("__core_note") <+> pprHsString (mkFastString s) + ppr (IfaceTickBox m n) = ptext SLIT("__tick_box") <+> pprModule m <+> text (show n) + ppr (IfaceBinaryTickBox m t e) + = ptext SLIT("__binary_tick_box") + <+> pprModule m + <+> text (show t) + <+> text (show e) + instance Outputable IfaceConAlt where ppr IfaceDefault = text "DEFAULT" @@ -659,6 +659,9 @@ eqWith = eq_ifTvBndrs emptyEqEnv eqIfInst d1 d2 = bool (ifDFun d1 == ifDFun d2 && ifOFlag d1 == ifOFlag d2) -- All other changes are handled via the version info on the dfun +eqIfFamInst d1 d2 = bool (ifFamInstTyCon d1 == ifFamInstTyCon d2) +-- All other changes are handled via the version info on the tycon + eqIfRule (IfaceRule n1 a1 bs1 f1 es1 rhs1 o1) (IfaceRule n2 a2 bs2 f2 es2 rhs2 o2) = bool (n1==n2 && a1==a2 && o1 == o2) &&& @@ -756,6 +759,8 @@ eq_ifaceNote :: EqEnv -> IfaceNote -> IfaceNote -> IfaceEq eq_ifaceNote env (IfaceSCC c1) (IfaceSCC c2) = bool (c1==c2) eq_ifaceNote env IfaceInlineMe IfaceInlineMe = Equal eq_ifaceNote env (IfaceCoreNote s1) (IfaceCoreNote s2) = bool (s1==s2) +eq_ifaceNote env (IfaceTickBox m1 n1) (IfaceTickBox m2 n2) = bool (m1==m2 && n1==n2) +eq_ifaceNote env (IfaceBinaryTickBox m1 t1 e1) (IfaceBinaryTickBox m2 t2 e2) = bool (m1==m2 && t1==t2 && e1 == e2) eq_ifaceNote env _ _ = NotEqual \end{code}