diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2022-02-23 17:29:09 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-25 21:15:23 -0500 |
commit | ad04953b0d28610c516ca897a0a9ee14577c3206 (patch) | |
tree | 6471f8d099ea809ab4420854a1a7de47a7dcd429 /compiler/GHC/Driver | |
parent | 677c6c913a993a5298dcf19020641f24cede0239 (diff) | |
download | haskell-ad04953b0d28610c516ca897a0a9ee14577c3206.tar.gz |
Allow hscGenHardCode to not return CgInfos
This is a minor change in preparation for the JS backend: CgInfos aren't
mandatory and the JS backend won't return them.
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r-- | compiler/GHC/Driver/Main.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Driver/Pipeline/Execute.hs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index 2ec37e3b10..da8ef86d1f 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -1602,7 +1602,7 @@ hscSimpleIface' tc_result summary = do -- | Compile to hard-code. hscGenHardCode :: HscEnv -> CgGuts -> ModLocation -> FilePath - -> IO (FilePath, Maybe FilePath, [(ForeignSrcLang, FilePath)], CgInfos) + -> IO (FilePath, Maybe FilePath, [(ForeignSrcLang, FilePath)], Maybe CgInfos) -- ^ @Just f@ <=> _stub.c is f hscGenHardCode hsc_env cgguts location output_filename = do let CgGuts{ -- This is the last use of the ModGuts in a compilation. @@ -1679,7 +1679,7 @@ hscGenHardCode hsc_env cgguts location output_filename = do <- {-# SCC "codeOutput" #-} codeOutput logger tmpfs dflags (hsc_units hsc_env) this_mod output_filename location foreign_stubs foreign_files dependencies rawcmms1 - return (output_filename, stub_c_exists, foreign_fps, cg_infos) + return (output_filename, stub_c_exists, foreign_fps, Just cg_infos) hscInteractive :: HscEnv diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs index c0c7b5d338..97eeb58260 100644 --- a/compiler/GHC/Driver/Pipeline/Execute.hs +++ b/compiler/GHC/Driver/Pipeline/Execute.hs @@ -521,9 +521,9 @@ runHscBackendPhase pipe_env hsc_env mod_name src_flavour location result = do return ([], final_iface, Just linkable, panic "interpreter") _ -> do output_fn <- phaseOutputFilenameNew next_phase pipe_env hsc_env (Just location) - (outputFilename, mStub, foreign_files, cg_infos) <- + (outputFilename, mStub, foreign_files, mb_cg_infos) <- hscGenHardCode hsc_env cgguts mod_location output_fn - final_iface <- mkFullIface hsc_env partial_iface (Just cg_infos) + final_iface <- mkFullIface hsc_env partial_iface mb_cg_infos -- See Note [Writing interface files] hscMaybeWriteIface logger dflags False final_iface mb_old_iface_hash mod_location |