[cfe-dev] Dynamically adding a new FunctionDecl to the AST

Dillon Sharlet dsharlet at gmail.com
Wed Mar 28 16:27:50 PDT 2012


Hello,

I'm attempting to construct a new function in the course of parsing the
AST. I've got it mostly working, except the function I've generated only
gets emitted as a declaration in LLVM, not a definition. I'm attempting to
figure out where in the template instanatiation logic the function gets
added to the AST for code gen, but I haven't been able to find it.

If I create a new function, how do I get it to be emitted in the AST
consumer? I've copied just about all of the logic that I can from
TemplateDeclInstantiator::VisitFunctionDecl
(which does basically the same thing I'm doing, adds a dynamically
generated FunctionDecl to the AST) without much luck.

Thanks for any advice!

Dillon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120328/671156b5/attachment.html>


More information about the cfe-dev mailing list