Is this the correct way to get Stg for a module?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Is this the correct way to get Stg for a module?

Christopher Done-2
Hi all,

I'm attempting to get the Stg for a module with the intention of
interpreting it myself.

Here is a self-contained GHC-8.4.3-specific test-case to get STG:

https://gist.github.com/chrisdone/08ef9e8447b71c9dadc5bba949cda638#file-printstgghc8_4_3-hs-L47-L76

I'm using the handy helpers GHC.parseModule, GHC.typecheckModule,
GHC.desugarModule to get the Core. For getting the STG I copied what
is done in HscMain.hs in GHC, right before it generates Cmm:

https://github.com/ghc/ghc/blob/ghc-8.4/compiler/main/HscMain.hs#L1312-L1318

Can anyone confirm that the part I've highlighted in my Gist is the correct way
to get Stg? I can't really tell whether I missed anything or did
something wrong.

Cheers!
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs