<div dir="ltr"><div>Hi Marcel,<br></div><div><br></div><div>I believe that you can get the location of '('/')' and insert a new parameter after/before that location. The locations of braces should be in the FunctionTypeLoc which you can extract from the TypeLoc value returned by calling ((FunctionDecl *)YourFunction)-><span style="color:rgb(0,0,0)">getTypeSourceInfo-></span><span style="color:rgb(0,0,0)">getTypeLoc</span><span style="color:rgb(0,0,0)">();</span></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Alex</div><div class="gmail_extra"><br><div class="gmail_quote">On 30 July 2017 at 16:44, Marcel Schaible via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<br>
<br>
I am trying to transform function arguments. For functions with a at least one argument I can position the Rewriter on the paramdecl.<br>
<br>
But if the function has no arguments there is no paramdecl. So how can I rewrite the argument list of such a function?<br>
<br>
Example:<br>
<br>
int foo() { return 42; } transform into int foo(int p1) { return 42;);<br>
<br>
Thanks<br>
<br>
Marcel<br>
<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div>