Shail Dave via llvm-dev
2017-Feb-17 03:48 UTC
[llvm-dev] Help needed to define and handle custom pragma #mypragma
Hi, I want to allow compilation of my own pragma in C/Cpp files such as #pragma mypragma and I want to handle it in this way -- upon identification of this pragma, I want to insert a function call and delete some code in the original source file. My problem is defining pragma and to handle it for inserting a function call. It would be great if someone can guide or suggest some tutorials. I am referring following resources but being newbie in front-end parsing, it is little hard. So, any help is highly appreciated. Thank you! :) Resources that I am following are -- http://wvanteijlingen.github.io/notes/clang_pragmas http://llvm.org/devmtg/2013-04/pellegrini-slides.pdf Best, *Shail* ᐧ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170216/495604ef/attachment.html>
serge guelton via llvm-dev
2017-Feb-17 12:53 UTC
[llvm-dev] Help needed to define and handle custom pragma #mypragma
On Thu, Feb 16, 2017 at 08:48:02PM -0700, Shail Dave via llvm-dev wrote:> Hi, > > I want to allow compilation of my own pragma in C/Cpp files such as > #pragma mypragma and I want to handle it in this way -- upon identification > of this pragma, I want to insert a function call and delete some code in > the original source file. > > My problem is defining pragma and to handle it for inserting a function > call. It would be great if someone can guide or suggest some tutorials. I > am referring following resources but being newbie in front-end parsing, it > is little hard. So, any help is highly appreciated. Thank you! :) > > Resources that I am following are -- > http://wvanteijlingen.github.io/notes/clang_pragmas > http://llvm.org/devmtg/2013-04/pellegrini-slides.pdf > > Best, > *Shail*I choke upon the same issue a while ago and detailed my walk through here : http://blog.quarkslab.com/implementing-a-custom-directive-handler-in-clang.html hope it helps, Serge