Hi all,<br><br>I've just started using clang. I would like to use it for source-to-source transformations. For start, I would like to do the following:<br>If a #pragma <some_name> precedes a function call, then change the name of the function to be called. For example:<br>
<br>input:<br>...<br>#pragma <...><br>my_func(...)<br>...<br><br>output:<br>...<br>my_function_NEW(...)<br>...<br><br>I've been looking at the objC->C example and I understand (to limited extent tho, how to use Rewriter class to modify the input file). Also, I've familiarize myself with HandlePragma mechanism, and I am able to indentify that there is a #pragma <...> in the code. <br>
<br>The thing that I don't know is how to pass the information from lexical/syntax anlysis to the ASTConsumer, i.e how do I say (in this example) that specific call to my_func() should be renamed? Should I use SourceLocation or there is a better way?<br>
<br>Thanks.<br><br>Cedomir.<br>