<div dir="ltr"><div dir="ltr"><div>Unfortunately it is dumped by my custom added code. (<a href="https://github.com/grin-tech/ghc-grin/blob/master/ghc-dump-core/GhcDump_StgConvert.hs#L82-L88">source code</a>)</div><div>I rerun my custom stg dump and it seems the unique values (in {--} comments) are different.</div><div>How can I tell which is the real <b>Main.main</b> function?</div><div><br></div><div>Cheers,</div><div>Csaba<br></div><div><br></div><div style="margin-left:40px"><font size="1"><span style="font-family:monospace,monospace"><b>Main.main {-r1550-}</b> =<br>  closure (F:) (B:<br>  void.040 {-040-}) {<br>  Main.main1 {-r16514-}<br>    GHC.Prim.void# {-021-}}<br><br>Main.main3 {-r16518-} =<br>  closure (F:) (B:<br>  void.040 {-040-}) {<br>  GHC.TopHandler.runMainIO1 {-r9161-}<br>    Main.main1 {-r16514-}<br>    GHC.Prim.void# {-021-}}<br><br><b>Main.main {-0101-}</b> =<br>  closure (F:) (B:<br>  void.040 {-040-}) {<br>  Main.main3 {-r16518-}<br>    GHC.Prim.void# {-021-}}<br></span></font><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018 at 11:18 PM Ben Gamari <<a href="mailto:ben@well-typed.com">ben@well-typed.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Csaba Hruska <<a href="mailto:csaba.hruska@gmail.com" target="_blank">csaba.hruska@gmail.com</a>> writes:<br>
<br>
> Hello,<br>
><br>
> I added an STG exporter to my modified GHC to do experiments with the STG<br>
> representation of the program.<br>
> I noticed that there are multiple top-level binders for *Main.main*<br>
> function.<br>
> Is this a convention or a bug?<br>
><br>
What GHC command line did you use to produce this output? Is it possible<br>
that you passed -dsuppress-uniques? If so the multiple `main`s probably<br>
differ in unique.<br>
<br>
Cheers,<br>
<br>
- Ben<br>
<br>
</blockquote></div>