From ad04953b0d28610c516ca897a0a9ee14577c3206 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Wed, 23 Feb 2022 17:29:09 +0100 Subject: 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. --- compiler/GHC/Driver/Main.hs | 4 ++-- compiler/GHC/Driver/Pipeline/Execute.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/GHC/Driver') 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 -- cgit v1.2.1