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: [email protected] [mailto:[email protected]] On 
Behalf Of William Jones
Sent: 02 March 2009 20:50
To: [email protected]
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
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to