summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/Config/StgToJS.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Driver/Config/StgToJS.hs')
-rw-r--r--compiler/GHC/Driver/Config/StgToJS.hs32
1 files changed, 32 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Config/StgToJS.hs b/compiler/GHC/Driver/Config/StgToJS.hs
new file mode 100644
index 0000000000..087767d39b
--- /dev/null
+++ b/compiler/GHC/Driver/Config/StgToJS.hs
@@ -0,0 +1,32 @@
+module GHC.Driver.Config.StgToJS
+ ( initStgToJSConfig
+ )
+where
+
+import GHC.StgToJS.Types
+
+import GHC.Driver.Session
+import GHC.Platform.Ways
+import GHC.Utils.Outputable
+
+import GHC.Prelude
+
+-- | Initialize StgToJS settings from DynFlags
+initStgToJSConfig :: DynFlags -> StgToJSConfig
+initStgToJSConfig dflags = StgToJSConfig
+ -- flags
+ { csInlinePush = False
+ , csInlineBlackhole = False
+ , csInlineLoadRegs = False
+ , csInlineEnter = False
+ , csInlineAlloc = False
+ , csTraceRts = False
+ , csAssertRts = False
+ , csBoundsCheck = gopt Opt_DoBoundsChecking dflags
+ , csDebugAlloc = False
+ , csTraceForeign = False
+ , csProf = ways dflags `hasWay` WayProf
+ , csRuntimeAssert = False
+ -- settings
+ , csContext = initSDocContext dflags defaultDumpStyle
+ }