On Sun, Feb 10, 2013 at 4:37 AM, y a yaniv.azriel.samsung@gmail.com wrote:
Hi all
I am simply awed by the gcc-python-plugin ;)
It looks like a fantastic effort
However, I cant find any sample which actually modifies the original C program
For example, how to add a runtime reference count to each CHAR *
Obviously, this is a large, long term project
For C++, this replaces CHAR* with an object
For C, I might do a simpler effort and just add an additional counter variable for each char*
But is the python-plugin even suitable for this or should I go for a native gcc plugin ?
It will be great to get any links to something similar
The goal of static analysis (heck, of the compiler itself) is never to modify the code. To achieve the kind of changes you are trying to make you need a refactoring framework (check out rope for python). These tools indeed use some kind of static analysis tool internally to decide where to make what changes.
Coincidentially, my interest in gcc-python-plugin is to eventually use it as the internal engine of a C++ refactoring engine. I haven't really started building that, but it is certainly one interesting application.
David E. Narváez