summaryrefslogtreecommitdiff
path: root/compiler/GHC/CoreToIface.hs
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2020-02-28 09:52:04 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-29 05:12:06 -0500
commit04d30137771a6cf8a18fda1ced25f78d0b2eb204 (patch)
treea69c36e0827b1374d3cb66bafd518a2c54df0876 /compiler/GHC/CoreToIface.hs
parent34c7d23074f47c720b5722ca14d78a34213eabb6 (diff)
downloadhaskell-04d30137771a6cf8a18fda1ced25f78d0b2eb204.tar.gz
Simplify IfaceIdInfo type
IfaceIdInfo type is confusing: there's practically no difference between `NoInfo` and `HasInfo []`. The comments say NoInfo is used when -fomit-interface-pragmas is enabled, but we don't need to distinguish `NoInfo` from `HasInfo []` in when reading the interface so the distinction is not important. This patch simplifies the type by removing NoInfo. When we have no info we use an empty list. With this change we no longer read the info list lazily when reading an IfaceInfoItem, but when reading an IfaceId the ifIdInfo field is read lazily, so I doubt this is going to be a problem.
Diffstat (limited to 'compiler/GHC/CoreToIface.hs')
-rw-r--r--compiler/GHC/CoreToIface.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/CoreToIface.hs b/compiler/GHC/CoreToIface.hs
index 370a569d98..3aad60b025 100644
--- a/compiler/GHC/CoreToIface.hs
+++ b/compiler/GHC/CoreToIface.hs
@@ -442,10 +442,8 @@ toIfaceIdDetails other = pprTrace "toIfaceIdDetails" (ppr other)
toIfaceIdInfo :: IdInfo -> IfaceIdInfo
toIfaceIdInfo id_info
- = case catMaybes [arity_hsinfo, caf_hsinfo, strict_hsinfo, cpr_hsinfo,
- inline_hsinfo, unfold_hsinfo, levity_hsinfo] of
- [] -> NoInfo
- infos -> HasInfo infos
+ = catMaybes [arity_hsinfo, caf_hsinfo, strict_hsinfo, cpr_hsinfo,
+ inline_hsinfo, unfold_hsinfo, levity_hsinfo]
-- NB: strictness and arity must appear in the list before unfolding
-- See GHC.IfaceToCore.tcUnfolding
where