Skip to content

Commit 05a4bf8

Browse files
committed
fix: address PR review comments
- Fix JS linker CPP guards: use HAVE_JS_BACKEND instead of HAVE_INTERPRETER for linkJSBinary (lines 456, 474, 603 in Pipeline.hs). Linking JS binaries doesn't require the interpreter. - Revert formatting change in Reg/Target.hs:298 to avoid unnecessary whitespace changes in an already hard-to-rebase patch.
1 parent e76f44b commit 05a4bf8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/GHC/CmmToAsm/Reg/Target.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,4 +295,4 @@ targetClassOfReg platform reg = case reg of
295295

296296
-- | Map a function over registers in a set, preserving formats.
297297
mapRegFormatSet :: HasDebugCallStack => (Reg -> Reg) -> UniqSet RegWithFormat -> UniqSet RegWithFormat
298-
mapRegFormatSet f = mapUniqSet (\(RegWithFormat r fmt) -> RegWithFormat (f r) fmt)
298+
mapRegFormatSet f = mapUniqSet (\ ( RegWithFormat r fmt ) -> RegWithFormat ( f r ) fmt)

compiler/GHC/Driver/Pipeline.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ link' logger tmpfs fc dflags unit_env batch_attempt_linking mHscMessager hpt
453453
-- Don't showPass in Batch mode; doLink will do that for us.
454454
case ghcLink dflags of
455455
LinkExecutable blm
456-
#if defined(HAVE_INTERPRETER)
456+
#if defined(HAVE_JS_BACKEND)
457457
| backendUseJSLinker (backend dflags) -> linkJSBinary logger tmpfs fc dflags unit_env obj_files pkg_deps
458458
#endif
459459
| otherwise -> linkBinary logger tmpfs dflags blm unit_env obj_files pkg_deps
@@ -471,7 +471,7 @@ link' logger tmpfs fc dflags unit_env batch_attempt_linking mHscMessager hpt
471471
text " Main.main not exported; not linking.")
472472
return Succeeded
473473

474-
#if defined(HAVE_INTERPRETER)
474+
#if defined(HAVE_JS_BACKEND)
475475
linkJSBinary :: Logger -> TmpFs -> FinderCache -> DynFlags -> UnitEnv -> [FilePath] -> [UnitId] -> IO ()
476476
linkJSBinary logger tmpfs fc dflags unit_env obj_files pkg_deps = do
477477
-- we use the default configuration for now. In the future we may expose
@@ -600,7 +600,7 @@ doLink hsc_env o_files = do
600600
case ghcLink dflags of
601601
NoLink -> return ()
602602
LinkExecutable blm
603-
#if defined(HAVE_INTERPRETER)
603+
#if defined(HAVE_JS_BACKEND)
604604
| backendUseJSLinker (backend dflags)
605605
-> linkJSBinary logger tmpfs fc dflags unit_env o_files []
606606
#endif

0 commit comments

Comments
 (0)