X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FTidyPgm.lhs;h=976c32e1669ddccba547c6846db0fb9b988aca65;hb=a35f75aa20bf0a329be0b782986c3e12155b4d49;hp=4e01fd31975b2a71e58cf3d532236f88715ba526;hpb=a835e9faf19400aa6b7999b6f64e60cb1c7737dd;p=ghc-hetmet.git diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index 4e01fd3..976c32e 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -26,7 +26,7 @@ import Id ( idType, idInfo, idName, idCoreRules, isGlobalId, import IdInfo {- loads of stuff -} import InstEnv ( Instance, DFunId, instanceDFunId, setInstanceDFunId ) import NewDemand ( isBottomingSig, topSig ) -import BasicTypes ( Arity, isNeverActive ) +import BasicTypes ( Arity, isNeverActive, isNonRuleLoopBreaker ) import Name ( Name, getOccName, nameOccName, mkInternalName, localiseName, isExternalName, nameSrcLoc, nameParent_maybe, isWiredInName, getName @@ -451,9 +451,10 @@ addExternal (id,rhs) needed = extendVarEnv (foldVarSet add_occ needed new_needed_ids) id show_unfold where - add_occ id needed = extendVarEnv needed id False + add_occ id needed | id `elemVarEnv` needed = needed + | otherwise = extendVarEnv needed id False -- "False" because we don't know we need the Id's unfolding - -- We'll override it later when we find the binding site + -- Don't override existing bindings; we might have already set it to True new_needed_ids = worker_ids `unionVarSet` unfold_ids `unionVarSet` @@ -461,7 +462,7 @@ addExternal (id,rhs) needed idinfo = idInfo id dont_inline = isNeverActive (inlinePragInfo idinfo) - loop_breaker = isLoopBreaker (occInfo idinfo) + loop_breaker = isNonRuleLoopBreaker (occInfo idinfo) bottoming_fn = isBottomingSig (newStrictnessInfo idinfo `orElse` topSig) spec_ids = specInfoFreeVars (specInfo idinfo) worker_info = workerInfo idinfo