multiple top level Main.main binders in STG

Csaba Hruska csaba.hruska at gmail.com
Fri Nov 2 22:35:15 UTC 2018


Unfortunately it is dumped by my custom added code. (source code
<https://github.com/grin-tech/ghc-grin/blob/master/ghc-dump-core/GhcDump_StgConvert.hs#L82-L88>
)
I rerun my custom stg dump and it seems the unique values (in {--}
comments) are different.
How can I tell which is the real *Main.main* function?

Cheers,
Csaba

*Main.main {-r1550-}* =
  closure (F:) (B:
  void.040 {-040-}) {
  Main.main1 {-r16514-}
    GHC.Prim.void# {-021-}}

Main.main3 {-r16518-} =
  closure (F:) (B:
  void.040 {-040-}) {
  GHC.TopHandler.runMainIO1 {-r9161-}
    Main.main1 {-r16514-}
    GHC.Prim.void# {-021-}}

*Main.main {-0101-}* =
  closure (F:) (B:
  void.040 {-040-}) {
  Main.main3 {-r16518-}
    GHC.Prim.void# {-021-}}



On Fri, Nov 2, 2018 at 11:18 PM Ben Gamari <ben at well-typed.com> wrote:

> Csaba Hruska <csaba.hruska at gmail.com> writes:
>
> > Hello,
> >
> > I added an STG exporter to my modified GHC to do experiments with the STG
> > representation of the program.
> > I noticed that there are multiple top-level binders for *Main.main*
> > function.
> > Is this a convention or a bug?
> >
> What GHC command line did you use to produce this output? Is it possible
> that you passed -dsuppress-uniques? If so the multiple `main`s probably
> differ in unique.
>
> Cheers,
>
> - Ben
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181102/8b7d7294/attachment.html>


More information about the ghc-devs mailing list