Yue Li wrote:
I was trying to understand and document the semantics of the opcode
set used by Poly/ML's interpreter, and I'm wondering whether inside
Poly/ML's compiler, there are such debugging functions which could
print out the IR tree as well as the generated op code for an input ML
program? These functions would help me a lot to test my understanding
on Poly's IR data structure and code generation.  Thank you very much!

Yue,
There are switches in the PolyML.Compiler structure that will print out various stages of the compilation process when compiling something. Probably the most useful for you would be
PolyML.Compiler.codetree := true;
which will cause the compiler to print out the code-tree. You may also find "codetreeAfterOpt" (i.e. code-tree after it has been through the optimiser) and "assemblyCode" (the machine code generated by the final code-generator) useful as well.

Regards,
David
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to