Hi,guys: I am try to get some information from the IR, such as Function type, Function arguments, I want to save then to the data structure which defined by myself, and I want use the data structure to modify the AST. But I know ,the IR was produced by the AST, I am not sure my thought is wright or not. If so, with API or function in the LLVM I will used? or some linkage or demo that I can learn form? Thanks, Yao. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150305/b5618518/attachment.html>
Hi Yao,> I am try to get some information from the IR, such as Function type, > Function arguments, > I want to save then to the data structure which defined by myself, and I > want use the data structure to modify the > AST. > But I know ,the IR was produced by the AST, I am not sure my thought is > wright or not. > If so, with API or function in the LLVM I will used? or some linkage or demo > that I can learn form?The frontend (clang) should be the right place to modify the AST. The information you want could be get from the frontend, too. You might refer [1] to see the basic idea. [1] http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang HTH, chenwj -- Wei-Ren Chen (陳韋任) Homepage: http://people.cs.nctu.edu.tw/~chenwj
Thanks a lot :) At 2015-03-06 09:40:04, "陳韋任" <chenwj.cs97g at g2.nctu.edu.tw> wrote:>Hi Yao, > >> I am try to get some information from the IR, such as Function type, >> Function arguments, >> I want to save then to the data structure which defined by myself, and I >> want use the data structure to modify the >> AST. >> But I know ,the IR was produced by the AST, I am not sure my thought is >> wright or not. >> If so, with API or function in the LLVM I will used? or some linkage or demo >> that I can learn form? > > The frontend (clang) should be the right place to modify the AST. >The information >you want could be get from the frontend, too. You might refer [1] to >see the basic idea. > >[1] http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang > >HTH, >chenwj > >-- >Wei-Ren Chen (陳韋任) >Homepage: http://people.cs.nctu.edu.tw/~chenwj