[cfe-dev] Add new types and functions to the program

Weiwei Chen weiwei.chen at uci.edu
Mon Sep 16 13:00:40 PDT 2013


Thanks for the response, Reid! 

Yes, your suggestion is perfectly reasonable if the new types and functions are stand alone ones. However, our project may need to instrument / recode the program based on the knowledge / analysis of the code. For instance, to add wrapper functions for existing functions, add intermediate variables, or even change the control flow of the program for architecture mapping and optimization purpose. We are doing some surveys to decide which infrastructure is the best fit for our project. We would very much like to use Clang, but wanna make sure there won't be too much hurdle to achieve our goal.

-- Weiwei



On Sep 16, 2013, at 11:53 AM, Reid Kleckner <rnk at google.com> wrote:

> How is this semantically different from sticking in a header at the top of the file?  Can you use -include to just add code to every TU you care about?
> 
> 
> On Mon, Sep 16, 2013 at 11:26 AM, Weiwei Chen <weiwei.chen at uci.edu> wrote:
> Hi there,
> 
> this may be a dumb question, but we would like to add new types and new functions to the Clang AST. Just wondering if it is possible to do this since we are aware that the Clang AST is immutable. We somehow need more control to the AST rather than source level editing. Could anyone give us some ideas whether Clang is the right infrastructure to use or not?
> 
> Thank you very much in advance!
> 
> 
> -- Weiwei
> 
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130916/78955c6a/attachment.html>


More information about the cfe-dev mailing list