diff options
author | Fendor <power.walross@gmail.com> | 2021-02-03 19:12:02 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-28 17:26:37 -0400 |
commit | 29d758631c0d9124485aafc89cddc4ec5a668653 (patch) | |
tree | 72efc6ad23ddc052cecd01b493384b8fbc74daab /compiler/GHC/Driver | |
parent | b02c8ef768df33ef4845da2f15583cf143a4d0e2 (diff) | |
download | haskell-29d758631c0d9124485aafc89cddc4ec5a668653.tar.gz |
Add UnitId to Target record
In the future, we want `HscEnv` to support multiple home units
at the same time. This means, that there will be 'Target's that do
not belong to the current 'HomeUnit'.
This is an API change without changing behaviour.
Update haddock submodule to incorporate API changes.
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r-- | compiler/GHC/Driver/Make.hs | 10 | ||||
-rw-r--r-- | compiler/GHC/Driver/MakeFile.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Driver/Pipeline.hs | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index 734608b471..720df3e2c8 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -2287,14 +2287,20 @@ downsweep hsc_env old_summaries excl_mods allow_dup_roots old_summary_map = mkNodeMap old_summaries getRootSummary :: Target -> IO (Either ErrorMessages ExtendedModSummary) - getRootSummary (Target (TargetFile file mb_phase) obj_allowed maybe_buf) + getRootSummary Target { targetId = TargetFile file mb_phase + , targetAllowObjCode = obj_allowed + , targetContents = maybe_buf + } = do exists <- liftIO $ doesFileExist file if exists || isJust maybe_buf then summariseFile hsc_env old_summaries file mb_phase obj_allowed maybe_buf else return $ Left $ unitBag $ mkPlainMsgEnvelope noSrcSpan $ text "can't find file:" <+> text file - getRootSummary (Target (TargetModule modl) obj_allowed maybe_buf) + getRootSummary Target { targetId = TargetModule modl + , targetAllowObjCode = obj_allowed + , targetContents = maybe_buf + } = do maybe_summary <- summariseModule hsc_env old_summary_map NotBoot (L rootLoc modl) obj_allowed maybe_buf excl_mods diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs index b6572bcb5b..d018c26ecf 100644 --- a/compiler/GHC/Driver/MakeFile.hs +++ b/compiler/GHC/Driver/MakeFile.hs @@ -86,7 +86,7 @@ doMkDependHS srcs = do files <- liftIO $ beginMkDependHS logger tmpfs dflags -- Do the downsweep to find all the modules - targets <- mapM (\s -> GHC.guessTarget s Nothing) srcs + targets <- mapM (\s -> GHC.guessTarget s Nothing Nothing) srcs GHC.setTargets targets let excl_mods = depExcludeMods dflags module_graph <- GHC.depanal excl_mods True {- Allow dup roots -} diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 6d945f6ff1..67fd78d7fa 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -343,7 +343,7 @@ compileOne' m_tc_result mHscMessage current_dir = takeDirectory basename old_paths = includePaths dflags2 loadAsByteCode - | Just (Target _ obj _) <- findTarget summary (hsc_targets hsc_env0) + | Just Target { targetAllowObjCode = obj } <- findTarget summary (hsc_targets hsc_env0) , not obj = True | otherwise = False |