summaryrefslogtreecommitdiff
path: root/compiler/backpack
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/backpack')
-rw-r--r--compiler/backpack/BkpSyn.hs3
-rw-r--r--compiler/backpack/DriverBkp.hs9
2 files changed, 8 insertions, 4 deletions
diff --git a/compiler/backpack/BkpSyn.hs b/compiler/backpack/BkpSyn.hs
index ae03324b34..e019d03b24 100644
--- a/compiler/backpack/BkpSyn.hs
+++ b/compiler/backpack/BkpSyn.hs
@@ -73,5 +73,6 @@ data IncludeDecl n = IncludeDecl {
-- | Rename a module from one name to another. The identity renaming
-- means that the module should be brought into scope.
-data Renaming = Renaming { renameFrom :: ModuleName, renameTo :: ModuleName }
+data Renaming = Renaming { renameFrom :: Located ModuleName
+ , renameTo :: Maybe (Located ModuleName) }
type LRenaming = Located Renaming
diff --git a/compiler/backpack/DriverBkp.hs b/compiler/backpack/DriverBkp.hs
index ccf74c8c9b..cdbe06d51f 100644
--- a/compiler/backpack/DriverBkp.hs
+++ b/compiler/backpack/DriverBkp.hs
@@ -213,9 +213,12 @@ hsunitDeps :: HsUnit HsComponentId -> [(UnitId, ModRenaming)]
hsunitDeps unit = concatMap get_dep (hsunitBody unit)
where
get_dep (L _ (IncludeD (IncludeDecl (L _ hsuid) mb_lrn))) = [(convertHsUnitId hsuid, go mb_lrn)]
- where go Nothing = ModRenaming True []
- go (Just lrns) = ModRenaming False (map convRn lrns)
- where convRn (L _ (Renaming from to)) = (from, to)
+ where
+ go Nothing = ModRenaming True []
+ go (Just lrns) = ModRenaming False (map convRn lrns)
+ where
+ convRn (L _ (Renaming (L _ from) Nothing)) = (from, from)
+ convRn (L _ (Renaming (L _ from) (Just (L _ to)))) = (from, to)
get_dep _ = []
buildUnit :: SessionType -> ComponentId -> [(ModuleName, Module)] -> LHsUnit HsComponentId -> BkpM ()