projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement -fexpose-all-unfoldings, and fix a non-termination bug
[ghc-hetmet.git]
/
compiler
/
coreSyn
/
CoreFVs.lhs
diff --git
a/compiler/coreSyn/CoreFVs.lhs
b/compiler/coreSyn/CoreFVs.lhs
index
f94f61d
..
3ff583e
100644
(file)
--- a/
compiler/coreSyn/CoreFVs.lhs
+++ b/
compiler/coreSyn/CoreFVs.lhs
@@
-416,8
+416,11
@@
idRuleRhsVars id = foldr (unionVarSet . ruleRhsFreeVars)
idUnfoldingVars :: Id -> VarSet
-- Produce free vars for an unfolding, but NOT for an ordinary
-- (non-inline) unfolding, since it is a dup of the rhs
idUnfoldingVars :: Id -> VarSet
-- Produce free vars for an unfolding, but NOT for an ordinary
-- (non-inline) unfolding, since it is a dup of the rhs
+-- and we'll get exponential behaviour if we look at both unf and rhs!
+-- But do look at the *real* unfolding, even for loop breakers, else
+-- we might get out-of-scope variables
idUnfoldingVars id
idUnfoldingVars id
- = case idUnfolding id of
+ = case realIdUnfolding id of
CoreUnfolding { uf_tmpl = rhs, uf_guidance = InlineRule {} }
-> exprFreeVars rhs
DFunUnfolding _ args -> exprsFreeVars args
CoreUnfolding { uf_tmpl = rhs, uf_guidance = InlineRule {} }
-> exprFreeVars rhs
DFunUnfolding _ args -> exprsFreeVars args