[Git][ghc/ghc][wip/ticky-dump-remove] hadrian: Add dump_stg flavour transformer

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Thu Jul 4 14:15:53 UTC 2024



Matthew Pickering pushed to branch wip/ticky-dump-remove at Glasgow Haskell Compiler / GHC


Commits:
6e601e15 by Matthew Pickering at 2024-07-04T15:15:41+01:00
hadrian: Add dump_stg flavour transformer

This allows you to write `--flavour=default+ticky_ghc+dump_stg` if you
really want STG for all modules.

- - - - -


2 changed files:

- hadrian/doc/flavours.md
- hadrian/src/Flavour.hs


Changes:

=====================================
hadrian/doc/flavours.md
=====================================
@@ -320,6 +320,10 @@ The supported transformers are listed below:
         <td><code>late_ccs</code></td>
         <td>Enable <code>-fprof-late</code> in profiled libraries.</td>
     </tr>
+    <tr>
+        <td><code>dump_stg</code></td>
+        <td>Dump STG of all modules compiled by a stage1 compiler to a file</td>
+    </tr>
 </table>
 
 ### Static


=====================================
hadrian/src/Flavour.hs
=====================================
@@ -68,6 +68,7 @@ flavourTransformers = M.fromList
     , "hi_core"          =: enableHiCore
     , "late_ccs"         =: enableLateCCS
     , "boot_nonmoving_gc" =: enableBootNonmovingGc
+    , "dump_stg"         =: enableDumpStg
     ]
   where (=:) = (,)
 
@@ -178,6 +179,11 @@ tickyArgs = mconcat
   , arg "-ticky-dyn-thunk"
   ]
 
+enableDumpStg :: Flavour -> Flavour
+enableDumpStg =
+  addArgs $ stage1 ?
+    builder (Ghc CompileHs) ? mconcat [ arg "-ddump-to-file", arg "-ddump-stg-final" ]
+
 -- | Enable Core, STG, and (not C--) linting in all compilations with the stage1 compiler.
 enableLinting :: Flavour -> Flavour
 enableLinting =



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6e601e15e5b97ee10808b0441f6b65f018988052

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6e601e15e5b97ee10808b0441f6b65f018988052
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240704/62eff9c2/attachment-0001.html>


More information about the ghc-commits mailing list