X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FTidyPgm.lhs;h=6a9f0ddfceff4d28cc73b33394d00f1d25624d39;hb=65277a1c9ff86c28c656849d6f6cbb392f1eb3e7;hp=ffe0eca832dfa041db08a1a3fcea838fe02eff3f;hpb=6a944ae7fe1e8e2e456c68717188463263f8978f;p=ghc-hetmet.git diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs index ffe0eca..6a9f0dd 100644 --- a/compiler/main/TidyPgm.lhs +++ b/compiler/main/TidyPgm.lhs @@ -26,7 +26,7 @@ import Var import Id import IdInfo import InstEnv -import NewDemand +import Demand import BasicTypes import Name hiding (varName) import NameSet @@ -686,7 +686,7 @@ addExternal expose_all id = (new_needed_ids, show_unfold) idinfo = idInfo id dont_inline = isNeverActive (inlinePragmaActivation (inlinePragInfo idinfo)) loop_breaker = isNonRuleLoopBreaker (occInfo idinfo) - bottoming_fn = isBottomingSig (newStrictnessInfo idinfo `orElse` topSig) + bottoming_fn = isBottomingSig (strictnessInfo idinfo `orElse` topSig) spec_ids = specInfoFreeVars (specInfo idinfo) -- Stuff to do with the Id's unfolding @@ -983,7 +983,7 @@ tidyTopPair show_unfold rhs_tidy_env caf_info name' (bndr, rhs) Nothing -> True Just (arity, _) -> appIsBottom str arity where - str = newStrictnessInfo idinfo `orElse` topSig + str = strictnessInfo idinfo `orElse` topSig bndr1 = mkGlobalId details name' ty' idinfo' details = idDetails bndr -- Preserve the IdDetails @@ -1043,14 +1043,14 @@ tidyTopIdInfo is_external idinfo unfold_info arity caf_info occ_info `setOccInfo` robust_occ_info `setCafInfo` caf_info `setArityInfo` arity - `setAllStrictnessInfo` newStrictnessInfo idinfo + `setStrictnessInfo` strictnessInfo idinfo | otherwise -- Externally-visible Ids get the whole lot = vanillaIdInfo `setOccInfo` robust_occ_info `setCafInfo` caf_info `setArityInfo` arity - `setAllStrictnessInfo` newStrictnessInfo idinfo + `setStrictnessInfo` strictnessInfo idinfo `setInlinePragInfo` inlinePragInfo idinfo `setUnfoldingInfo` unfold_info -- NB: we throw away the Rules @@ -1064,19 +1064,19 @@ tidyTopIdInfo is_external idinfo unfold_info arity caf_info occ_info ------------ Unfolding -------------- tidyUnfolding :: TidyEnv -> CoreExpr -> Unfolding -> Unfolding -tidyUnfolding tidy_env _ unf@(CoreUnfolding { uf_tmpl = rhs - , uf_guidance = guide@(InlineRule {}) }) - = unf { uf_tmpl = tidyExpr tidy_env rhs, -- Preserves OccInfo - uf_guidance = guide { ir_info = tidyInl tidy_env (ir_info guide) } } tidyUnfolding tidy_env _ (DFunUnfolding con ids) = DFunUnfolding con (map (tidyExpr tidy_env) ids) -tidyUnfolding _ tidy_rhs (CoreUnfolding {}) +tidyUnfolding tidy_env tidy_rhs unf@(CoreUnfolding { uf_tmpl = unf_rhs, uf_src = src }) + | isInlineRuleSource src + = unf { uf_tmpl = tidyExpr tidy_env unf_rhs, -- Preserves OccInfo + uf_src = tidyInl tidy_env src } + | otherwise = mkTopUnfolding tidy_rhs tidyUnfolding _ _ unf = unf -tidyInl :: TidyEnv -> InlineRuleInfo -> InlineRuleInfo -tidyInl tidy_env (InlWrapper w) = InlWrapper (tidyVarOcc tidy_env w) -tidyInl _ inl_info = inl_info +tidyInl :: TidyEnv -> UnfoldingSource -> UnfoldingSource +tidyInl tidy_env (InlineWrapper w) = InlineWrapper (tidyVarOcc tidy_env w) +tidyInl _ inl_info = inl_info \end{code} %************************************************************************