summaryrefslogtreecommitdiff
path: root/compiler/GHC/CoreToStg
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-07 18:03:36 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-13 02:13:02 -0400
commit72d086106d49bc18277f3a066e671e87e9b37a1b (patch)
treeff20c2926d4234c2cecc5d230859fc9fce09bb85 /compiler/GHC/CoreToStg
parent7a02599afe836ac32c2e732671415d0afdfbf7fb (diff)
downloadhaskell-72d086106d49bc18277f3a066e671e87e9b37a1b.tar.gz
Refactor homeUnit
* rename thisPackage into homeUnit * document and refactor several Backpack things
Diffstat (limited to 'compiler/GHC/CoreToStg')
-rw-r--r--compiler/GHC/CoreToStg/Prep.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs
index 7420475813..cc408ca46f 100644
--- a/compiler/GHC/CoreToStg/Prep.hs
+++ b/compiler/GHC/CoreToStg/Prep.hs
@@ -1556,9 +1556,9 @@ lookupNaturalSDataConName dflags hsc_env = case integerLibrary dflags of
-- | Helper for 'lookupMkIntegerName', 'lookupIntegerSDataConName'
guardIntegerUse :: DynFlags -> IO a -> IO a
guardIntegerUse dflags act
- | thisPackage dflags == primUnitId
+ | homeUnit dflags == primUnitId
= return $ panic "Can't use Integer in ghc-prim"
- | thisPackage dflags == integerUnitId
+ | homeUnit dflags == integerUnitId
= return $ panic "Can't use Integer in integer-*"
| otherwise = act
@@ -1568,11 +1568,11 @@ guardIntegerUse dflags act
-- literals in `base`. If we do, we get interface loading error for GHC.Natural.
guardNaturalUse :: DynFlags -> IO a -> IO a
guardNaturalUse dflags act
- | thisPackage dflags == primUnitId
+ | homeUnit dflags == primUnitId
= return $ panic "Can't use Natural in ghc-prim"
- | thisPackage dflags == integerUnitId
+ | homeUnit dflags == integerUnitId
= return $ panic "Can't use Natural in integer-*"
- | thisPackage dflags == baseUnitId
+ | homeUnit dflags == baseUnitId
= return $ panic "Can't use Natural in base"
| otherwise = act