Custom Pragma Support

Hello everyone,

I hope that this is the right list to post this question. If not, kindly accept our apologies for any inconvenience.

We are trying to use the LLVM compiler to support custom pragma annotation in a source code. As we have already seen this transformation is also part of the Clang LLVM ’ s front-end . Because of the lack of documentation, could you give as the procedure in order to achieve that? For example, we would like to modify the Clang/LLVM source code to support a “#pragma myfunc x” annotation, which will be substituted by the code of myfunc(x) . Will it be possible ?

Thanks

Manolis

Hi manolis,

this is a common issue and the documentation is quite sparse; I've
written small walkthrough on the different point you need to hack in
clang to support this, here:

    Implementing a Custom Directive Handler in Clang

Hope it helps