diff options
-rw-r--r-- | compiler/main/HscTypes.hs | 2 | ||||
m--------- | libraries/Cabal | 0 | ||||
-rw-r--r-- | testsuite/tests/driver/recomp007/recomp007.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/perf/haddock/all.T | 5 | ||||
-rw-r--r-- | utils/ghc-cabal/Main.hs | 13 | ||||
-rw-r--r-- | utils/ghc-pkg/Main.hs | 18 | ||||
-rw-r--r-- | utils/ghctags/Main.hs | 12 |
7 files changed, 29 insertions, 22 deletions
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index d297a83898..87ef5a2ef0 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -139,9 +139,9 @@ import ByteCodeTypes import InteractiveEvalTypes ( Resume ) import GHCi.Message ( Pipe ) import GHCi.RemoteTypes -import UniqFM #endif +import UniqFM import HsSyn import RdrName import Avail diff --git a/libraries/Cabal b/libraries/Cabal -Subproject 40d6f0afd5b86d698abb876d4f5ed0bb452b0c4 +Subproject f8d6f17a09d14e3f1851190f18fefa23be2ae02 diff --git a/testsuite/tests/driver/recomp007/recomp007.stdout b/testsuite/tests/driver/recomp007/recomp007.stdout index 61095aa38b..6230acfb02 100644 --- a/testsuite/tests/driver/recomp007/recomp007.stdout +++ b/testsuite/tests/driver/recomp007/recomp007.stdout @@ -1,4 +1,3 @@ -Building b-1.0... Preprocessing executable 'test' for b-1.0... [1 of 2] Compiling B ( B.hs, dist/build/test/test-tmp/B.o ) [A changed] [2 of 2] Compiling Main ( Main.hs, dist/build/test/test-tmp/Main.o ) [B changed] diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T index b9a3ab39d9..89d6ecdb3d 100644 --- a/testsuite/tests/perf/haddock/all.T +++ b/testsuite/tests/perf/haddock/all.T @@ -83,6 +83,11 @@ test('haddock.Cabal', # 2016-05-22: 11805238152 (amd64/Linux) - Make Generic1 poly-kinded # 2016-06-05: 10997887320 (amd64/Linux) - Refactor derived Generic instances to reduce allocations # 2016-06-21: 10070330520 (amd64/Linux) - D2350: Make checkFamInstConsistency less expensive + # 2016-08-07: 16001233464 (amd64/Linux) - Cabal update + # It's worth noting that allocations scale up with the number + # of modules in Cabal. This Cabal update added a large number + # of new modules; if you exclude them from the haddock run + # the stats are comparable. ,(platform('i386-unknown-mingw32'), 3293415576, 5) # 2012-10-30: 1733638168 (x86/Windows) diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 8cc1d1a34a..b833b640f8 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} module Main (main) where @@ -150,16 +151,14 @@ doCopy directory distDir noGhcPrimHook f pd lbi us flags = let pd' | packageName pd == PackageName "ghc-prim" = - case libraries pd of - [lib] -> + case library pd of + Just lib -> let ghcPrim = fromJust (simpleParse "GHC.Prim") ems = filter (ghcPrim /=) (exposedModules lib) lib' = lib { exposedModules = ems } - in pd { libraries = [lib'] } - [] -> + in pd { library = Just lib' } + Nothing -> error "Expected a library, but none found" - _ -> - error "Expected a single library, but multiple found" | otherwise = pd in f pd' lbi us flags modHook relocatableBuild f pd lbi us flags @@ -326,7 +325,7 @@ generate directory distdir dll0Modules config_args comp = compiler lbi libBiModules lib = (libBuildInfo lib, libModules lib) exeBiModules exe = (buildInfo exe, ModuleName.main : exeModules exe) - biModuless = (map libBiModules $ libraries pd) + biModuless = (map libBiModules . maybeToList $ library pd) ++ (map exeBiModules $ executables pd) buildableBiModuless = filter isBuildable biModuless where isBuildable (bi', _) = buildable bi' diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index e0625fec80..399522ad1c 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1079,7 +1079,7 @@ type PackageCacheFormat = GhcPkg.InstalledPackageInfo PackageName UnitId ModuleName - OriginalModule + Module convertPackageInfoToCacheFormat :: InstalledPackageInfo -> PackageCacheFormat convertPackageInfoToCacheFormat pkg = @@ -1132,9 +1132,9 @@ instance GhcPkg.BinaryStringRep String where fromStringRep = fromUTF8 . BS.unpack toStringRep = BS.pack . toUTF8 -instance GhcPkg.DbModuleRep UnitId ModuleName OriginalModule where - fromDbModule (GhcPkg.DbModule uid mod_name) = OriginalModule uid mod_name - toDbModule (OriginalModule uid mod_name) = GhcPkg.DbModule uid mod_name +instance GhcPkg.DbModuleRep UnitId ModuleName Module where + fromDbModule (GhcPkg.DbModule uid mod_name) = Module uid mod_name + toDbModule (Module uid mod_name) = GhcPkg.DbModule uid mod_name -- ----------------------------------------------------------------------------- -- Exposing, Hiding, Trusting, Distrusting, Unregistering are all similar @@ -1741,7 +1741,7 @@ checkExposedModules db_stack pkg = where checkExposedModule (ExposedModule modl reexport) = do let checkOriginal = checkModuleFile pkg modl - checkReexport = checkOriginalModule "module reexport" db_stack pkg + checkReexport = checkModule "module reexport" db_stack pkg maybe checkOriginal checkReexport reexport -- | Validates the existence of an appropriate @hi@ file associated with @@ -1779,13 +1779,13 @@ checkDuplicateModules pkg -- implementation, then we should also check that the original module in -- question is NOT a signature (however, if it is a reexport, then it's fine -- for the original module to be a signature.) -checkOriginalModule :: String +checkModule :: String -> PackageDBStack -> InstalledPackageInfo - -> OriginalModule + -> Module -> Validate () -checkOriginalModule field_name db_stack pkg - (OriginalModule definingPkgId definingModule) = +checkModule field_name db_stack pkg + (Module definingPkgId definingModule) = let mpkg = if definingPkgId == installedUnitId pkg then Just pkg else PackageIndex.lookupUnitId ipix definingPkgId diff --git a/utils/ghctags/Main.hs b/utils/ghctags/Main.hs index 9a2ab2cccf..138687e5fa 100644 --- a/utils/ghctags/Main.hs +++ b/utils/ghctags/Main.hs @@ -23,6 +23,8 @@ import Distribution.Simple.Configure ( getPersistBuildConfig ) import Distribution.Simple.Program.GHC ( renderGhcOptions ) import Distribution.PackageDescription ( libBuildInfo ) import Distribution.Simple.LocalBuildInfo +import Distribution.Types.LocalBuildInfo ( componentNameTargets' ) +import Distribution.Types.TargetInfo import qualified Distribution.Verbosity as V import Control.Monad hiding (mapM) @@ -179,14 +181,16 @@ flagsFromCabal :: FilePath -> IO [String] flagsFromCabal distPref = do lbi <- getPersistBuildConfig distPref let pd = localPkgDescr lbi - case maybeGetDefaultLibraryLocalBuildInfo lbi of - Just clbi -> - let CLib lib = getComponent pd (componentLocalName clbi) + case componentNameTargets' pd lbi CLibName of + [target] -> + let clbi = targetCLBI target + CLib lib = getComponent pd (componentLocalName clbi) bi = libBuildInfo lib odir = buildDir lbi opts = componentGhcOptions V.normal lbi bi clbi odir in return $ renderGhcOptions (compiler lbi) (hostPlatform lbi) opts - _ -> error "no library" + [] -> error "no library" + _ -> error "more libraries than we know how to handle" ---------------------------------------------------------------- --- LOADING HASKELL SOURCE |