<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi All,<div><br></div><div>I'm trying to add parameters to a existing function, like:</div><div><br></div><div>void func(int x) {}</div><div><br></div><div>To:</div><div><br></div><div>void func(int x, int y) {}</div><div><br></div><div>I'm using the HandleTopLevelDecl of ASTConsumer to get the function.</div><div><br></div><div>What I do is something like this:</div><div><br></div><div><div>void AddParameter(FunctionDecl *FD) </div><div>{<span class="Apple-tab-span" style="white-space:pre">         </span></div><div>  SourceLocation loc;</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>for (FunctionDecl::param_iterator I=FD->param_begin(), E=FD->param_end(); I!=E; ++I)</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>loc = (*I)->getLocation();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><br></div><div>  Rewrite.InsertTextAfter(loc, ", int y", 7);</div><div>}</div><div><br></div><div>The problem is instead I get the void func(int x, int y), I get func(int , int yx)</div><div><br></div><div>Can someone tell me what is wrong?</div><div><br></div><div>Thanks,</div><div>Makslane</div></div><br /><hr />Instale o novo Internet Explorer 8 versão especial para o MSN.  <a href='http://ie8.msn.com/microsoft/internet-explorer-8/pt-br/ie8.aspx' target='_new'>Download aqui</a></body>
</html>