diff options
author | simonpj@microsoft.com <unknown> | 2008-01-16 15:18:18 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2008-01-16 15:18:18 +0000 |
commit | 6c51a993efa623be3f92ae997c3cb321e4b0badb (patch) | |
tree | b1328d1edd4e68f9326496297158efd9122c0abc | |
parent | d3d2b45d5b07064f73d76b33ce571e3f10cc3f42 (diff) | |
download | haskell-6c51a993efa623be3f92ae997c3cb321e4b0badb.tar.gz |
Fix broken debug warning
-rw-r--r-- | compiler/specialise/Rules.lhs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs index bbb678deec..090f0f0b80 100644 --- a/compiler/specialise/Rules.lhs +++ b/compiler/specialise/Rules.lhs @@ -35,8 +35,7 @@ import Type ( Type, TvSubstEnv ) import Coercion ( coercionKind ) import TcType ( tcSplitTyConApp_maybe ) import CoreTidy ( tidyRules ) -import Id ( Id, idUnfolding, isLocalId, isGlobalId, idName, idType, - idSpecialisation, idCoreRules, setIdSpecialisation ) +import Id import IdInfo ( SpecInfo( SpecInfo ) ) import Var ( Var ) import VarEnv @@ -233,9 +232,11 @@ getRules :: RuleBase -> Id -> [CoreRule] -- (b) rules added in subsequent modules (extra_rules) -- PrimOps, for example, are born with a bunch of rules under (a) getRules rule_base fn - | isLocalId fn = idCoreRules fn - | otherwise = WARN( null (idCoreRules fn), ppr fn <+> ppr (idCoreRules fn) ) - lookupNameEnv rule_base (idName fn) `orElse` [] + | isLocalId fn = idCoreRules fn + | otherwise = WARN( not (isPrimOpId fn) && notNull (idCoreRules fn), + ppr fn <+> ppr (idCoreRules fn) ) + idCoreRules fn ++ (lookupNameEnv rule_base (idName fn) `orElse` []) + -- Only PrimOpIds have rules inside themselves, and perhaps more besides matchRules :: (Activation -> Bool) -> InScopeSet -> Id -> [CoreExpr] |