pycparser do not provide a special function for this. You can try to go throug the AST and do it manualy.
Thougt about Aspect-oriented programming? e.g. with aspect c++ you can add the "aspect" without changig the code (or use the intermediate output).