summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-04-05 13:23:21 +0200
committerdoyougnu <jeffrey.young@iohk.io>2022-06-13 13:42:37 -0400
commit14fb7ba21d47c53c52f2d66c072dd18b228216d5 (patch)
tree3fd9e0f07b68666ebc7e76904a375f99f3c3bdce
parenta6089ff57338b7fc0f790d1473f09c05dae5e3a8 (diff)
downloadhaskell-14fb7ba21d47c53c52f2d66c072dd18b228216d5.tar.gz
Driver: enable JS backend by default for JS arch
-rw-r--r--compiler/GHC/Driver/Backend.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Backend.hs b/compiler/GHC/Driver/Backend.hs
index c804840c90..14a9cb5739 100644
--- a/compiler/GHC/Driver/Backend.hs
+++ b/compiler/GHC/Driver/Backend.hs
@@ -45,6 +45,7 @@ module GHC.Driver.Backend
-- * Available back ends
, ncgBackend
, llvmBackend
+ , jsBackend
, viaCBackend
, interpreterBackend
, noBackend
@@ -197,6 +198,7 @@ platformDefaultBackend :: Platform -> Backend
platformDefaultBackend platform = if
| platformUnregisterised platform -> viaCBackend
| platformNcgSupported platform -> ncgBackend
+ | platformJSSupported platform -> jsBackend
| otherwise -> llvmBackend
-- | Is the platform supported by the Native Code Generator?
@@ -214,6 +216,12 @@ platformNcgSupported platform = if
ArchAArch64 -> True
_ -> False
+-- | Is the platform supported by the Native Code Generator?
+platformJSSupported :: Platform -> Bool
+platformJSSupported platform
+ | platformArch platform == ArchJavaScript = True
+ | otherwise = False
+
-- | Will this backend produce an object file on the disk?
backendProducesObject :: Backend -> Bool
backendProducesObject ViaC = True