Retrieving closure code during code generation
Simon Peyton-Jones
simonpj at microsoft.com
Tue Mar 3 12:00:07 EST 2009
There's no mapping Id -> CmmProc in the CgMonad at the moment, but it'd be easy to add, at least for top-level procedures.
However in the example you give, 'f' is a parameter of 'map', so there's no hope of finding what it's bound to, because that depends on the caller (which might not even have been written yet). Furthermore, 'f' is a closure (a pair of code and environment) not just code.
From: cvs-ghc-bounces at haskell.org [mailto:cvs-ghc-bounces at haskell.org] On Behalf Of William Jones
Sent: 02 March 2009 20:50
To: cvs-ghc at haskell.org
Subject: Retrieving closure code during code generation
Hello,
I am currently working with GHC's code generator and am wondering if there is any way I can retrieve the Cmm for a function during the compilation of another? I have looked at the information passed using CgMonad and at the bindings in scope but these don't seem to be what I need. As an example, when generating code for the tail call "map f xs," can I retrieve the Cmm expressions that make up "f"?
Apologies if I am missing something glaringly obvious, thanks,
Will
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/cvs-ghc/attachments/20090303/38e40266/attachment.htm
More information about the Cvs-ghc
mailing list