<div dir="ltr">Hi all,<br><br>Posted similar questions 2 days ago, this time more detailed.<br><br>I'm working on a tool for src-2-src transformations.<br>One of the functions of this tool is replacing function calls in the code.<br>

I'm having problems with this operation whenever one of the arguments of the call is a macro, or of a type declared in an included header:<br><ol><li>To get the value of arguments I get it's SourceRange, and get the associated code using SourceManager::getCharacterData. That usually works, but when it's a macro I get an error: "terminate called after throwing an instance of 'std::length_error'  what():  basic_string::_S_create ".</li>

<li>In order to replace function calls, I use StmtVisitor to find all CallExpr. The problem is when one of the arguments is of a type declared in an included header, this call, for some reason, is ignored and not visited.<br>

</li></ol>Both this issues concern pre-processing, so I have a principle question- when accessing the AST wiith ASTConsumer, is it after the pre-proccessing phase?<br><br><br>Thanks in advance, any help will be greatly appreciated,<br>

Ilya<br><br clear="all"><br>-- <br><div dir="ltr">Best Regards,<br>Ilya Mirsky<br><a href="http://www.cs.bgu.ac.il/%7Emirskyil" target="_blank">www.cs.bgu.ac.il/~mirskyil</a><br></div><br>
</div>