From 15312bbb53f247c9ed2c5cf75100a9f44c1c7227 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Sun, 5 Apr 2020 17:39:13 +0200 Subject: Modules (#13009) * SysTools * Parser * GHC.Builtin * GHC.Iface.Recomp * Settings Update Haddock submodule Metric Decrease: Naperian parsing001 --- compiler/GHC/Driver/Backpack.hs | 10 +- compiler/GHC/Driver/CodeOutput.hs | 2 +- compiler/GHC/Driver/Finder.hs | 2 +- compiler/GHC/Driver/Flags.hs | 2 +- compiler/GHC/Driver/Main.hs | 10 +- compiler/GHC/Driver/Make.hs | 4 +- compiler/GHC/Driver/MakeFile.hs | 4 +- compiler/GHC/Driver/Packages.hs | 6 +- compiler/GHC/Driver/Pipeline.hs | 178 +++++++++++++++++----------------- compiler/GHC/Driver/Pipeline/Monad.hs | 2 +- compiler/GHC/Driver/Session.hs | 20 ++-- compiler/GHC/Driver/Types.hs | 10 +- 12 files changed, 123 insertions(+), 127 deletions(-) (limited to 'compiler/GHC/Driver') diff --git a/compiler/GHC/Driver/Backpack.hs b/compiler/GHC/Driver/Backpack.hs index 6ab71b7fec..4f179f4aa1 100644 --- a/compiler/GHC/Driver/Backpack.hs +++ b/compiler/GHC/Driver/Backpack.hs @@ -23,11 +23,11 @@ import GhcPrelude -- In a separate module because it hooks into the parser. import GHC.Driver.Backpack.Syntax -import ApiAnnotation +import GHC.Parser.Annotation import GHC hiding (Failed, Succeeded) import GHC.Driver.Packages -import Parser -import Lexer +import GHC.Parser +import GHC.Parser.Lexer import GHC.Driver.Monad import GHC.Driver.Session import GHC.Tc.Utils.Monad @@ -43,11 +43,11 @@ import GHC.Types.Unique.FM import GHC.Types.Unique.DFM import Outputable import Maybes -import HeaderInfo +import GHC.Parser.Header import GHC.Iface.Recomp import GHC.Driver.Make import GHC.Types.Unique.DSet -import PrelNames +import GHC.Builtin.Names import GHC.Types.Basic hiding (SuccessFlag(..)) import GHC.Driver.Finder import Util diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs index d9078e9ca1..f87661846e 100644 --- a/compiler/GHC/Driver/CodeOutput.hs +++ b/compiler/GHC/Driver/CodeOutput.hs @@ -32,7 +32,7 @@ import GHC.Driver.Types import GHC.Driver.Session import Stream ( Stream ) import qualified Stream -import FileCleanup +import GHC.SysTools.FileCleanup import ErrUtils import Outputable diff --git a/compiler/GHC/Driver/Finder.hs b/compiler/GHC/Driver/Finder.hs index d2538d90e8..0a4b07509f 100644 --- a/compiler/GHC/Driver/Finder.hs +++ b/compiler/GHC/Driver/Finder.hs @@ -40,7 +40,7 @@ import GHC.Driver.Types import GHC.Driver.Packages import FastString import Util -import PrelNames ( gHC_PRIM ) +import GHC.Builtin.Names ( gHC_PRIM ) import GHC.Driver.Session import Outputable import Maybes ( expectJust ) diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs index da19a6aa96..2e867ac85f 100644 --- a/compiler/GHC/Driver/Flags.hs +++ b/compiler/GHC/Driver/Flags.hs @@ -351,7 +351,7 @@ data GeneralFlag -- Check whether a flag should be considered an "optimisation flag" -- for purposes of recompilation avoidance (see --- Note [Ignoring some flag changes] in FlagChecker). Being listed here is +-- Note [Ignoring some flag changes] in GHC.Iface.Recomp.Flags). Being listed here is -- not a guarantee that the flag has no other effect. We could, and -- perhaps should, separate out the flags that have some minor impact on -- program semantics and/or error behavior (e.g., assertions), but diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index 2eda36cd90..2b5dfb2b11 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -100,7 +100,7 @@ import GHC.Types.Var.Env ( emptyTidyEnv ) import Panic import GHC.Core.ConLike -import ApiAnnotation +import GHC.Parser.Annotation import GHC.Types.Module import GHC.Driver.Packages import GHC.Types.Name.Reader @@ -108,15 +108,15 @@ import GHC.Hs import GHC.Hs.Dump import GHC.Core import StringBuffer -import Parser -import Lexer +import GHC.Parser +import GHC.Parser.Lexer as Lexer import GHC.Types.SrcLoc import GHC.Tc.Module import GHC.IfaceToCore ( typecheckIface ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.Zonk ( ZonkFlexi (DefaultFlexi) ) import GHC.Types.Name.Cache ( initNameCache ) -import PrelInfo +import GHC.Builtin.Utils import GHC.Core.Opt.Driver import GHC.HsToCore import GHC.Iface.Load ( ifaceStats, initExternalPackageState, writeIface ) @@ -144,7 +144,7 @@ import GHC.Core.FamInstEnv import Fingerprint ( Fingerprint ) import GHC.Driver.Hooks import GHC.Tc.Utils.Env -import PrelNames +import GHC.Builtin.Names import GHC.Driver.Plugins import GHC.Runtime.Loader ( initializePlugins ) diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index 359e602be8..7df02dd7c8 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -43,7 +43,7 @@ import GHC.Driver.Session import ErrUtils import GHC.Driver.Finder import GHC.Driver.Monad -import HeaderInfo +import GHC.Parser.Header import GHC.Driver.Types import GHC.Types.Module import GHC.IfaceToCore ( typecheckIface ) @@ -70,7 +70,7 @@ import GHC.Types.Unique.Set import Util import qualified GHC.LanguageExtensions as LangExt import GHC.Types.Name.Env -import FileCleanup +import GHC.SysTools.FileCleanup import Data.Either ( rights, partitionEithers ) import qualified Data.Map as Map diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs index 385b1de791..d45b39e3b3 100644 --- a/compiler/GHC/Driver/MakeFile.hs +++ b/compiler/GHC/Driver/MakeFile.hs @@ -23,7 +23,7 @@ import GHC.Driver.Session import GHC.Driver.Ways import Util import GHC.Driver.Types -import qualified SysTools +import qualified GHC.SysTools as SysTools import GHC.Types.Module import Digraph ( SCC(..) ) import GHC.Driver.Finder @@ -32,7 +32,7 @@ import Panic import GHC.Types.SrcLoc import Data.List import FastString -import FileCleanup +import GHC.SysTools.FileCleanup import Exception import ErrUtils diff --git a/compiler/GHC/Driver/Packages.hs b/compiler/GHC/Driver/Packages.hs index d7ecbeb39b..b2299a1403 100644 --- a/compiler/GHC/Driver/Packages.hs +++ b/compiler/GHC/Driver/Packages.hs @@ -924,7 +924,7 @@ sortByPreference prec_map = sortBy (flip (compareByPreference prec_map)) -- package to use in place of @integer-wired-in@ and that two different -- package databases supply a different integer library. For more about -- the fake @integer-wired-in@ package, see Note [The integer library] --- in the @PrelNames@ module. +-- in the @GHC.Builtin.Names@ module. compareByPreference :: PackagePrecedenceIndex -> UnitInfo @@ -1022,7 +1022,7 @@ findWiredInPackages dflags prec_map pkgs vis_map = do let matches :: UnitInfo -> WiredInUnitId -> Bool pc `matches` pid - -- See Note [The integer library] in PrelNames + -- See Note [The integer library] in GHC.Builtin.Names | pid == unitIdString integerUnitId = packageNameString pc `elem` ["integer-gmp", "integer-simple"] pc `matches` pid = packageNameString pc == pid @@ -1126,7 +1126,7 @@ findWiredInPackages dflags prec_map pkgs vis_map = do -- compiler, as described in Note [Wired-in packages] in GHC.Types.Module. -- -- For instance, base-4.9.0.0 will be rewritten to just base, to match --- what appears in PrelNames. +-- what appears in GHC.Builtin.Names. upd_wired_in_mod :: WiredPackagesMap -> Module -> Module upd_wired_in_mod wiredInMap (Module uid m) = Module (upd_wired_in_uid wiredInMap uid) m diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 53d7b5f0ac..f61430b475 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -41,10 +41,10 @@ import GhcPrelude import GHC.Driver.Pipeline.Monad import GHC.Driver.Packages import GHC.Driver.Ways -import HeaderInfo +import GHC.Parser.Header import GHC.Driver.Phases -import SysTools -import SysTools.ExtraObj +import GHC.SysTools +import GHC.SysTools.ExtraObj import GHC.Driver.Main import GHC.Driver.Finder import GHC.Driver.Types hiding ( Hsc ) @@ -62,11 +62,11 @@ import GHC.CmmToLlvm ( llvmFixupAsm, llvmVersionList ) import MonadUtils import GHC.Platform import GHC.Tc.Types -import ToolSettings import GHC.Driver.Hooks import qualified GHC.LanguageExtensions as LangExt -import FileCleanup -import Ar +import GHC.SysTools.FileCleanup +import GHC.SysTools.Ar +import GHC.Settings import Bag ( unitBag ) import FastString ( mkFastString ) import GHC.Iface.Make ( mkFullIface ) @@ -955,14 +955,14 @@ runPhase (RealPhase (Unlit sf)) input_fn dflags let flags = [ -- The -h option passes the file name for unlit to -- put in a #line directive - SysTools.Option "-h" + GHC.SysTools.Option "-h" -- See Note [Don't normalise input filenames]. - , SysTools.Option $ escape input_fn - , SysTools.FileOption "" input_fn - , SysTools.FileOption "" output_fn + , GHC.SysTools.Option $ escape input_fn + , GHC.SysTools.FileOption "" input_fn + , GHC.SysTools.FileOption "" output_fn ] - liftIO $ SysTools.runUnlit dflags flags + liftIO $ GHC.SysTools.runUnlit dflags flags return (RealPhase (Cpp sf), output_fn) where @@ -1030,10 +1030,10 @@ runPhase (RealPhase (HsPp sf)) input_fn dflags PipeEnv{src_basename, src_suffix} <- getPipeEnv let orig_fn = src_basename <.> src_suffix output_fn <- phaseOutputFilename (Hsc sf) - liftIO $ SysTools.runPp dflags - ( [ SysTools.Option orig_fn - , SysTools.Option input_fn - , SysTools.FileOption "" output_fn + liftIO $ GHC.SysTools.runPp dflags + ( [ GHC.SysTools.Option orig_fn + , GHC.SysTools.Option input_fn + , GHC.SysTools.FileOption "" output_fn ] ) @@ -1311,12 +1311,12 @@ runPhase (RealPhase cc_phase) input_fn dflags ghcVersionH <- liftIO $ getGhcVersionPathName dflags - liftIO $ SysTools.runCc (phaseForeignLanguage cc_phase) dflags ( - [ SysTools.FileOption "" input_fn - , SysTools.Option "-o" - , SysTools.FileOption "" output_fn + liftIO $ GHC.SysTools.runCc (phaseForeignLanguage cc_phase) dflags ( + [ GHC.SysTools.FileOption "" input_fn + , GHC.SysTools.Option "-o" + , GHC.SysTools.FileOption "" output_fn ] - ++ map SysTools.Option ( + ++ map GHC.SysTools.Option ( pic_c_flags -- Stub files generated for foreign exports references the runIO_closure @@ -1370,8 +1370,8 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags -- assembler, so we use clang as the assembler instead. (#5636) let as_prog | hscTarget dflags == HscLlvm && platformOS (targetPlatform dflags) == OSDarwin - = SysTools.runClang - | otherwise = SysTools.runAs + = GHC.SysTools.runClang + | otherwise = GHC.SysTools.runAs let cmdline_include_paths = includePaths dflags let pic_c_flags = picCCOpts dflags @@ -1384,9 +1384,9 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags liftIO $ createDirectoryIfMissing True (takeDirectory output_fn) ccInfo <- liftIO $ getCompilerInfo dflags - let global_includes = [ SysTools.Option ("-I" ++ p) + let global_includes = [ GHC.SysTools.Option ("-I" ++ p) | p <- includePathsGlobal cmdline_include_paths ] - let local_includes = [ SysTools.Option ("-iquote" ++ p) + let local_includes = [ GHC.SysTools.Option ("-iquote" ++ p) | p <- includePathsQuote cmdline_include_paths ] let runAssembler inputFilename outputFilename = liftIO $ do @@ -1395,9 +1395,9 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags dflags (local_includes ++ global_includes -- See Note [-fPIC for assembler] - ++ map SysTools.Option pic_c_flags + ++ map GHC.SysTools.Option pic_c_flags -- See Note [Produce big objects on Windows] - ++ [ SysTools.Option "-Wa,-mbig-obj" + ++ [ GHC.SysTools.Option "-Wa,-mbig-obj" | platformOS (targetPlatform dflags) == OSMinGW32 , not $ target32Bit (targetPlatform dflags) ] @@ -1410,19 +1410,19 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags -- -- This is a temporary hack. ++ (if platformArch (targetPlatform dflags) == ArchSPARC - then [SysTools.Option "-mcpu=v9"] + then [GHC.SysTools.Option "-mcpu=v9"] else []) ++ (if any (ccInfo ==) [Clang, AppleClang, AppleClang51] - then [SysTools.Option "-Qunused-arguments"] + then [GHC.SysTools.Option "-Qunused-arguments"] else []) - ++ [ SysTools.Option "-x" + ++ [ GHC.SysTools.Option "-x" , if with_cpp - then SysTools.Option "assembler-with-cpp" - else SysTools.Option "assembler" - , SysTools.Option "-c" - , SysTools.FileOption "" inputFilename - , SysTools.Option "-o" - , SysTools.FileOption "" temp_outputFilename + then GHC.SysTools.Option "assembler-with-cpp" + else GHC.SysTools.Option "assembler" + , GHC.SysTools.Option "-c" + , GHC.SysTools.FileOption "" inputFilename + , GHC.SysTools.Option "-o" + , GHC.SysTools.FileOption "" temp_outputFilename ]) liftIO $ debugTraceMsg dflags 4 (text "Running the assembler") @@ -1437,12 +1437,12 @@ runPhase (RealPhase LlvmOpt) input_fn dflags = do output_fn <- phaseOutputFilename LlvmLlc - liftIO $ SysTools.runLlvmOpt dflags + liftIO $ GHC.SysTools.runLlvmOpt dflags ( optFlag ++ defaultOptions ++ - [ SysTools.FileOption "" input_fn - , SysTools.Option "-o" - , SysTools.FileOption "" output_fn] + [ GHC.SysTools.FileOption "" input_fn + , GHC.SysTools.Option "-o" + , GHC.SysTools.FileOption "" output_fn] ) return (RealPhase LlvmLlc, output_fn) @@ -1461,10 +1461,10 @@ runPhase (RealPhase LlvmOpt) input_fn dflags -- passes only, so if the user is passing us extra options we assume -- they know what they are doing and don't get in the way. optFlag = if null (getOpts dflags opt_lo) - then map SysTools.Option $ words llvmOpts + then map GHC.SysTools.Option $ words llvmOpts else [] - defaultOptions = map SysTools.Option . concat . fmap words . fst + defaultOptions = map GHC.SysTools.Option . concat . fmap words . fst $ unzip (llvmOptions dflags) ----------------------------------------------------------------------------- @@ -1479,12 +1479,12 @@ runPhase (RealPhase LlvmLlc) input_fn dflags output_fn <- phaseOutputFilename next_phase - liftIO $ SysTools.runLlvmLlc dflags + liftIO $ GHC.SysTools.runLlvmLlc dflags ( optFlag ++ defaultOptions - ++ [ SysTools.FileOption "" input_fn - , SysTools.Option "-o" - , SysTools.FileOption "" output_fn + ++ [ GHC.SysTools.FileOption "" input_fn + , GHC.SysTools.Option "-o" + , GHC.SysTools.FileOption "" output_fn ] ) @@ -1535,10 +1535,10 @@ runPhase (RealPhase LlvmLlc) input_fn dflags _ -> "-O2" optFlag = if null (getOpts dflags opt_lc) - then map SysTools.Option $ words llvmOpts + then map GHC.SysTools.Option $ words llvmOpts else [] - defaultOptions = map SysTools.Option . concatMap words . snd + defaultOptions = map GHC.SysTools.Option . concatMap words . snd $ unzip (llvmOptions dflags) @@ -1781,15 +1781,15 @@ linkBinary' staticLink dflags o_files dep_packages = do rc_objs <- maybeCreateManifest dflags output_fn let link = if staticLink - then SysTools.runLibtool - else SysTools.runLink + then GHC.SysTools.runLibtool + else GHC.SysTools.runLink link dflags ( - map SysTools.Option verbFlags - ++ [ SysTools.Option "-o" - , SysTools.FileOption "" output_fn + map GHC.SysTools.Option verbFlags + ++ [ GHC.SysTools.Option "-o" + , GHC.SysTools.FileOption "" output_fn ] ++ libmLinkOpts - ++ map SysTools.Option ( + ++ map GHC.SysTools.Option ( [] -- See Note [No PIE when linking] @@ -1841,7 +1841,7 @@ linkBinary' staticLink dflags o_files dep_packages = do ++ o_files ++ lib_path_opts) ++ extra_ld_inputs - ++ map SysTools.Option ( + ++ map GHC.SysTools.Option ( rc_objs ++ framework_opts ++ pkg_lib_path_opts @@ -1911,7 +1911,7 @@ maybeCreateManifest dflags exe_filename -- show is a bit hackish above, but we need to escape the -- backslashes in the path. - runWindres dflags $ map SysTools.Option $ + runWindres dflags $ map GHC.SysTools.Option $ ["--input="++rc_filename, "--output="++rc_obj_filename, "--output-format=coff"] @@ -1963,7 +1963,7 @@ linkStaticLib dflags o_files dep_packages = do else writeBSDAr output_fn $ afilter (not . isBSDSymdef) ar -- run ranlib over the archive. write*Ar does *not* create the symbol index. - runRanlib dflags [SysTools.FileOption "" output_fn] + runRanlib dflags [GHC.SysTools.FileOption "" output_fn] -- ----------------------------------------------------------------------------- -- Running CPP @@ -1982,8 +1982,8 @@ doCpp dflags raw input_fn output_fn = do let verbFlags = getVerbFlags dflags - let cpp_prog args | raw = SysTools.runCpp dflags args - | otherwise = SysTools.runCc Nothing dflags (SysTools.Option "-E" : args) + let cpp_prog args | raw = GHC.SysTools.runCpp dflags args + | otherwise = GHC.SysTools.runCc Nothing dflags (GHC.SysTools.Option "-E" : args) let targetArch = stringEncodeArch $ platformArch $ targetPlatform dflags targetOS = stringEncodeOS $ platformOS $ targetPlatform dflags @@ -2027,26 +2027,26 @@ doCpp dflags raw input_fn output_fn = do -- size of 1000 packages, it takes cpp an estimated 2 -- milliseconds to process this file. See #10970 -- comment 8. - return [SysTools.FileOption "-include" macro_stub] + return [GHC.SysTools.FileOption "-include" macro_stub] else return [] - cpp_prog ( map SysTools.Option verbFlags - ++ map SysTools.Option include_paths - ++ map SysTools.Option hsSourceCppOpts - ++ map SysTools.Option target_defs - ++ map SysTools.Option backend_defs - ++ map SysTools.Option th_defs - ++ map SysTools.Option hscpp_opts - ++ map SysTools.Option sse_defs - ++ map SysTools.Option avx_defs + cpp_prog ( map GHC.SysTools.Option verbFlags + ++ map GHC.SysTools.Option include_paths + ++ map GHC.SysTools.Option hsSourceCppOpts + ++ map GHC.SysTools.Option target_defs + ++ map GHC.SysTools.Option backend_defs + ++ map GHC.SysTools.Option th_defs + ++ map GHC.SysTools.Option hscpp_opts + ++ map GHC.SysTools.Option sse_defs + ++ map GHC.SysTools.Option avx_defs ++ mb_macro_include -- Set the language mode to assembler-with-cpp when preprocessing. This -- alleviates some of the C99 macro rules relating to whitespace and the hash -- operator, which we tend to abuse. Clang in particular is not very happy -- about this. - ++ [ SysTools.Option "-x" - , SysTools.Option "assembler-with-cpp" - , SysTools.Option input_fn + ++ [ GHC.SysTools.Option "-x" + , GHC.SysTools.Option "assembler-with-cpp" + , GHC.SysTools.Option input_fn -- We hackily use Option instead of FileOption here, so that the file -- name is not back-slashed on Windows. cpp is capable of -- dealing with / in filenames, so it works fine. Furthermore @@ -2055,8 +2055,8 @@ doCpp dflags raw input_fn output_fn = do -- our error messages get double backslashes in them. -- In due course we should arrange that the lexer deals -- with these \\ escapes properly. - , SysTools.Option "-o" - , SysTools.FileOption "" output_fn + , GHC.SysTools.Option "-o" + , GHC.SysTools.FileOption "" output_fn ]) getBackendDefs :: DynFlags -> IO [String] @@ -2137,20 +2137,20 @@ joinObjectFiles dflags o_files output_fn = do let toolSettings' = toolSettings dflags ldIsGnuLd = toolSettings_ldIsGnuLd toolSettings' osInfo = platformOS (targetPlatform dflags) - ld_r args cc = SysTools.runLink dflags ([ - SysTools.Option "-nostdlib", - SysTools.Option "-Wl,-r" + ld_r args cc = GHC.SysTools.runLink dflags ([ + GHC.SysTools.Option "-nostdlib", + GHC.SysTools.Option "-Wl,-r" ] -- See Note [No PIE while linking] in GHC.Driver.Session ++ (if toolSettings_ccSupportsNoPie toolSettings' - then [SysTools.Option "-no-pie"] + then [GHC.SysTools.Option "-no-pie"] else []) ++ (if any (cc ==) [Clang, AppleClang, AppleClang51] then [] - else [SysTools.Option "-nodefaultlibs"]) + else [GHC.SysTools.Option "-nodefaultlibs"]) ++ (if osInfo == OSFreeBSD - then [SysTools.Option "-L/usr/lib"] + then [GHC.SysTools.Option "-L/usr/lib"] else []) -- gcc on sparc sets -Wl,--relax implicitly, but -- -r and --relax are incompatible for ld, so @@ -2158,16 +2158,16 @@ joinObjectFiles dflags o_files output_fn = do ++ (if platformArch (targetPlatform dflags) `elem` [ArchSPARC, ArchSPARC64] && ldIsGnuLd - then [SysTools.Option "-Wl,-no-relax"] + then [GHC.SysTools.Option "-Wl,-no-relax"] else []) -- See Note [Produce big objects on Windows] - ++ [ SysTools.Option "-Wl,--oformat,pe-bigobj-x86-64" + ++ [ GHC.SysTools.Option "-Wl,--oformat,pe-bigobj-x86-64" | OSMinGW32 == osInfo , not $ target32Bit (targetPlatform dflags) ] - ++ map SysTools.Option ld_build_id - ++ [ SysTools.Option "-o", - SysTools.FileOption "" output_fn ] + ++ map GHC.SysTools.Option ld_build_id + ++ [ GHC.SysTools.Option "-o", + GHC.SysTools.FileOption "" output_fn ] ++ args) -- suppress the generation of the .note.gnu.build-id section, @@ -2183,15 +2183,15 @@ joinObjectFiles dflags o_files output_fn = do cwd <- getCurrentDirectory let o_files_abs = map (\x -> "\"" ++ (cwd x) ++ "\"") o_files writeFile script $ "INPUT(" ++ unwords o_files_abs ++ ")" - ld_r [SysTools.FileOption "" script] ccInfo + ld_r [GHC.SysTools.FileOption "" script] ccInfo else if toolSettings_ldSupportsFilelist toolSettings' then do filelist <- newTempName dflags TFL_CurrentModule "filelist" writeFile filelist $ unlines o_files - ld_r [SysTools.Option "-Wl,-filelist", - SysTools.FileOption "-Wl," filelist] ccInfo + ld_r [GHC.SysTools.Option "-Wl,-filelist", + GHC.SysTools.FileOption "-Wl," filelist] ccInfo else do - ld_r (map (SysTools.FileOption "") o_files) ccInfo + ld_r (map (GHC.SysTools.FileOption "") o_files) ccInfo -- ----------------------------------------------------------------------------- -- Misc. @@ -2228,7 +2228,7 @@ hscPostBackendPhase _ hsc_lang = touchObjectFile :: DynFlags -> FilePath -> IO () touchObjectFile dflags path = do createDirectoryIfMissing True $ takeDirectory path - SysTools.touch dflags "Touching object file" path + GHC.SysTools.touch dflags "Touching object file" path -- | Find out path to @ghcversion.h@ file getGhcVersionPathName :: DynFlags -> IO FilePath diff --git a/compiler/GHC/Driver/Pipeline/Monad.hs b/compiler/GHC/Driver/Pipeline/Monad.hs index 6e07924d1e..753f829f3c 100644 --- a/compiler/GHC/Driver/Pipeline/Monad.hs +++ b/compiler/GHC/Driver/Pipeline/Monad.hs @@ -19,7 +19,7 @@ import GHC.Driver.Session import GHC.Driver.Phases import GHC.Driver.Types import GHC.Types.Module -import FileCleanup (TempFileLifetime) +import GHC.SysTools.FileCleanup (TempFileLifetime) import Control.Monad diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 2f8fb99162..5ed6e093d7 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -242,11 +242,10 @@ import GhcPrelude import GHC.Platform import GHC.UniqueSubdir (uniqueSubdir) -import PlatformConstants import GHC.Types.Module import {-# SOURCE #-} GHC.Driver.Plugins import {-# SOURCE #-} GHC.Driver.Hooks -import {-# SOURCE #-} PrelNames ( mAIN ) +import {-# SOURCE #-} GHC.Builtin.Names ( mAIN ) import {-# SOURCE #-} GHC.Driver.Packages (PackageState, emptyPackageState, PackageDatabase, mkComponentId) import GHC.Driver.Phases ( Phase(..), phaseInputExt ) import GHC.Driver.Flags @@ -255,8 +254,7 @@ import Config import CliOption import GHC.Driver.CmdLine hiding (WarnReason(..)) import qualified GHC.Driver.CmdLine as Cmd -import Constants -import GhcNameVersion +import GHC.Settings.Constants import Panic import qualified PprColour as Col import Util @@ -267,17 +265,15 @@ import GHC.Types.SrcLoc import GHC.Types.Basic ( Alignment, alignmentOf, IntWithInf, treatZeroAsInf ) import FastString import Fingerprint -import FileSettings import Outputable -import Settings -import ToolSettings +import GHC.Settings import {-# SOURCE #-} ErrUtils ( Severity(..), MsgDoc, mkLocMessageAnn , getCaretDiagnostic, DumpAction, TraceAction , defaultDumpAction, defaultTraceAction ) import Json -import SysTools.Terminal ( stderrSupportsAnsiColors ) -import SysTools.BaseDir ( expandToolDir, expandTopDir ) +import GHC.SysTools.Terminal ( stderrSupportsAnsiColors ) +import GHC.SysTools.BaseDir ( expandToolDir, expandTopDir ) import System.IO.Unsafe ( unsafePerformIO ) import Data.IORef @@ -457,10 +453,10 @@ data DynFlags = DynFlags { integerLibrary :: IntegerLibrary, -- ^ IntegerGMP or IntegerSimple. Set at configure time, but may be overridden - -- by GHC-API users. See Note [The integer library] in PrelNames + -- by GHC-API users. See Note [The integer library] in GHC.Builtin.Names llvmConfig :: LlvmConfig, -- ^ N.B. It's important that this field is lazy since we load the LLVM - -- configuration lazily. See Note [LLVM Configuration] in SysTools. + -- configuration lazily. See Note [LLVM Configuration] in GHC.SysTools. verbosity :: Int, -- ^ Verbosity level: see Note [Verbosity levels] optLevel :: Int, -- ^ Optimisation level debugLevel :: Int, -- ^ How much debug information to produce @@ -888,7 +884,7 @@ data LlvmTarget = LlvmTarget , lAttributes :: [String] } --- | See Note [LLVM Configuration] in SysTools. +-- | See Note [LLVM Configuration] in GHC.SysTools. data LlvmConfig = LlvmConfig { llvmTargets :: [(String, LlvmTarget)] , llvmPasses :: [(Int, String)] } diff --git a/compiler/GHC/Driver/Types.hs b/compiler/GHC/Driver/Types.hs index d532ef09b0..581a90ea1d 100644 --- a/compiler/GHC/Driver/Types.hs +++ b/compiler/GHC/Driver/Types.hs @@ -182,7 +182,7 @@ import GHC.Types.Id import GHC.Types.Id.Info ( IdDetails(..), RecSelParent(..)) import GHC.Core.Type -import ApiAnnotation ( ApiAnns ) +import GHC.Parser.Annotation ( ApiAnns ) import GHC.Types.Annotations ( Annotation, AnnEnv, mkAnnEnv, plusAnnEnv ) import GHC.Core.Class import GHC.Core.TyCon @@ -190,8 +190,8 @@ import GHC.Core.Coercion.Axiom import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Core.PatSyn -import PrelNames ( gHC_PRIM, ioTyConName, printName, mkInteractiveModule ) -import TysWiredIn +import GHC.Builtin.Names ( gHC_PRIM, ioTyConName, printName, mkInteractiveModule ) +import GHC.Builtin.Types import GHC.Driver.Packages hiding ( Version(..) ) import GHC.Driver.CmdLine import GHC.Driver.Session @@ -1561,7 +1561,7 @@ as if they were defined in modules ...etc... with each bunch of declarations using a new module, all sharing a common package 'interactive' (see Module.interactiveUnitId, and -PrelNames.mkInteractiveModule). +GHC.Builtin.Names.mkInteractiveModule). This scheme deals well with shadowing. For example: @@ -3154,7 +3154,7 @@ data HsParsedModule = HsParsedModule { -- the .hi file, so that we can force recompilation if any of -- them change (#3589) hpm_annotations :: ApiAnns - -- See note [Api annotations] in ApiAnnotation.hs + -- See note [Api annotations] in GHC.Parser.Annotation } {- -- cgit v1.2.1