<div>Eli, thanks for your answer. Sorry about the mailing list mixup!</div><div> </div><div>Not to sound lazy, but I'm trying to figure out how to use TreeTransform to do what I want and it is not clear to me. Basically, here is what I'm trying to do:</div>
<div> </div><div>- I want to clone a FunctionDecl to a new function that is a complete copy of the original function.</div><div>- Then, I want to apply different attributes to the arguments. I've already enabled overloading of functions with my attribute on the arguments, so there shouldn't be an issue there.</div>
<div>- After the arguments are modified, I want to run the parser on the copied FunctionDecl (just like it would be on an instantiated template)</div><div> </div><div>I'm looking at the template instantiation code, and it is a very large class that looks like it handles all of the syntax elements that might be found in a template. I'm trying to avoid this as it really shouldn't be necessary and it creates a code maintenance issue. Is there some way I can re-use the template instantiation code to do what I'm trying to do above?</div>
<div><br> </div><div class="gmail_quote">On Tue, Mar 27, 2012 at 5:44 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
There is code inside Sema to do something like this as part of<br>
template instantiation; see TreeTransform.h . It isn't exposed outside<br>
of Sema, though,<br>
<div><br>
</div>No, the instantiated function exists independently in the AST.<br>
<br>
cfe-dev would be a better list for followup questions.<br>
<span><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br>