On Fri, 2012-02-10 at 12:14 -0800, Satya Prakash Prasad wrote: > Thanks for the info Dave. I downloaded the tar ball but facing issues > while building it:
This is probably more appropriate for the plugin's mailing list: https://fedorahosted.org/mailman/listinfo/gcc-python-plugin rather than the general gcc list... > ImportError: cannot import name check_output ...but to answer the question, it looks like I accidentally added a python 2.7 requirement here [subprocess.check_output was added in 2.7] > I am not that familiar with Python - can you please help me out? If you're not particularly familiar with Python, then it may be easier to write the pass directly in C. > Also please let me know some references on how to write a new PASS > within GCC codebase? If you're new, it's probably easiest to do it within a plugin, see: http://gcc.gnu.org/wiki/plugins http://gcc.gnu.org/onlinedocs/gccint/Plugins.html LWN had an excellent tutorial on creating a new gcc pass via a plugin here: https://lwn.net/Articles/457543/ [1] Hope this is helpful Dave [1] fwiw I ported the example from the tutorial to Python here: http://gcc-python-plugin.readthedocs.org/en/latest/working-with-c.html#spell-checking-string-constants-within-source-code