summaryrefslogtreecommitdiff
path: root/compiler/GHC/IfaceToCore.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/IfaceToCore.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/IfaceToCore.hs')
-rw-r--r--compiler/GHC/IfaceToCore.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs
index a6fa7408b2..700d830c9d 100644
--- a/compiler/GHC/IfaceToCore.hs
+++ b/compiler/GHC/IfaceToCore.hs
@@ -1465,10 +1465,8 @@ tcIdInfo ignore_prags toplvl name ty info = do
let init_info | if_boot lcl_env = vanillaIdInfo `setUnfoldingInfo` BootUnfolding
| otherwise = vanillaIdInfo
- case info of
- NoInfo -> return init_info
- HasInfo info -> let needed = needed_prags info in
- foldlM tcPrag init_info needed
+ let needed = needed_prags info
+ foldlM tcPrag init_info needed
where
needed_prags :: [IfaceInfoItem] -> [IfaceInfoItem]
needed_prags items