[pypy-dev] Control flow graph for method

Armin Rigo arigo at tunes.org
Sun Apr 14 09:28:26 CEST 2013


Hi,

On Sun, Apr 14, 2013 at 8:13 AM, Evgeny Startsev
<slayer-gurgen at yandex.ru> wrote:
> I am interesting in control-flow graph generation for python projects using
> python. I read http://doc.pypy.org/en/latest/translation.html#flow-model and
> studied how to investigate cfg for function.
> Is there any way to generate cfg for method using pypy?

In rpython/bin/translatorshell.py, instead of calling
Translation(func, [int]) you call Translation(Class.method.im_func,
[Class, int]).

This comes with the usual warnings: PyPy doesn't contain any tool that
gives you the cfg of a Python function or method, but only contains
tools that give the cfg of *RPython* function or methods.


A bientôt,

Armin.


More information about the pypy-dev mailing list