summaryrefslogtreecommitdiff
path: root/compiler/iface/TcIface.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2016-05-12 12:47:16 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2016-08-21 00:53:21 -0700
commit1f1bd920047fa083de29eba7cedafbe37d350b73 (patch)
treee774ab9ecba610ab537265bc622d93e2df3145ec /compiler/iface/TcIface.hs
parent704913cf79c7dbf9bf622fb3cfe476edd478b5a2 (diff)
downloadhaskell-1f1bd920047fa083de29eba7cedafbe37d350b73.tar.gz
Introduce BootUnfolding, set when unfolding is absent due to hs-boot file.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2246
Diffstat (limited to 'compiler/iface/TcIface.hs')
-rw-r--r--compiler/iface/TcIface.hs20
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs
index 527fe71ce1..fa8e26ae5e 100644
--- a/compiler/iface/TcIface.hs
+++ b/compiler/iface/TcIface.hs
@@ -146,7 +146,7 @@ knots are tied through the EPS. No problem!
typecheckIface :: ModIface -- Get the decls from here
-> IfG ModDetails
typecheckIface iface
- = initIfaceLcl (mi_module iface) (text "typecheckIface") $ do
+ = initIfaceLcl (mi_module iface) (text "typecheckIface") (mi_boot iface) $ do
{ -- Get the right set of decls and rules. If we are compiling without -O
-- we discard pragmas before typechecking, so that we don't "see"
-- information that we shouldn't. From a versioning point of view
@@ -1241,16 +1241,18 @@ tcIdDetails _ (IfRecSelId tc naughty)
tyThingPatSyn _ = panic "tcIdDetails: expecting patsyn"
tcIdInfo :: Bool -> Name -> Type -> IfaceIdInfo -> IfL IdInfo
-tcIdInfo ignore_prags name ty info
- | ignore_prags = return vanillaIdInfo
- | otherwise = case info of
- NoInfo -> return vanillaIdInfo
- HasInfo info -> foldlM tcPrag init_info info
- where
+tcIdInfo ignore_prags name ty info = do
+ lcl_env <- getLclEnv
-- Set the CgInfo to something sensible but uninformative before
-- we start; default assumption is that it has CAFs
- init_info = vanillaIdInfo
-
+ let init_info | if_boot lcl_env = vanillaIdInfo `setUnfoldingInfo` BootUnfolding
+ | otherwise = vanillaIdInfo
+ if ignore_prags
+ then return init_info
+ else case info of
+ NoInfo -> return init_info
+ HasInfo info -> foldlM tcPrag init_info info
+ where
tcPrag :: IdInfo -> IfaceInfoItem -> IfL IdInfo
tcPrag info HsNoCafRefs = return (info `setCafInfo` NoCafRefs)
tcPrag info (HsArity arity) = return (info `setArityInfo` arity)