Hi,<div>  There is no function to get FunctionTypeLoc from a FunctionDecl. Is there any other way to get a FunctionTypeLoc?</div><div><br></div><div>Regards,</div><div>Adil</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sun, Nov 11, 2012 at 7:32 AM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, Nov 10, 2012 at 3:27 PM, madil90 <<a href="mailto:madil90@gmail.com">madil90@gmail.com</a>> wrote:<br>
> Hi,<br>
>    I am using clang to create and parse an AST. I have a function in an<br>
> ASTVisitor called "VisitFunctionDecl" which gives me a functiondecl object.<br>
> I need to add a new parameter to this declaration in source code e.g.<br>
><br>
> int foo()<br>
> {<br>
><br>
> }<br>
><br>
>   should be converted to<br>
><br>
> int foo(int a)<br>
> {<br>
> }<br>
><br>
>    I need to find the location just before the ending bracket. Is there any<br>
> way to do that?<br>
<br>
Get a FunctionTypeLoc out of the decl; that stores the relevant locations.<br>
<br>
> Also, can I ensure that the new parameter being added<br>
> doesn't conflict with some variable in the function?<br>
<br>
You can use a RecursiveASTVisitor or something like that to visit all<br>
the declarations in the function.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Mohammad Adil<div>LUMS SSE</div><br>
</div>