William Jones wrote:
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,
Not easily - if f is defined in the same module you'll have to save the Cmm
for it in the monad so that you can extract it later. But the Cmm for a
single function might consist of lots of separate code blocks.
Perhaps it's better to explain what you're trying to do - there might be a
better way to achieve it. Also note that the code generator is in
mid-rewrite; the new version of it starts with codeGen/StgCmm.hs.
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc