[llvm-dev] pragma and function insertion

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 13 10:40:40 PDT 2019


Hi,

several OpenMP directives do this, such as #pragma omp flush. It's
handling is in StmtOpenMP.cpp (OMPFlushDirective) and
CGOpenMPRuntime.cpp (CGOpenMPRuntime::emitFlush)

Michael


Am Do., 13. Juni 2019 um 12:13 Uhr schrieb Julien Schmitt via llvm-dev
<llvm-dev at lists.llvm.org>:
>
> Dear community,
>
> For my project, I defined a #pragma and i would like clang to replace this pragma by a function call.
>
> After reading tutorials, I managed to write a plugin which is able to parse and recognize this pragma.
>
> Now I have some difficulties to transform this pragma into a function call.
>
>
> My comprehension is that I need first to declare a new annotation token and insert it in the stream.
>
> Then I should process this token and call the function I want.
> Is this approach correct? Can a frontendAction do this job?
>
>
> However, I have the feeling this process should be very common and probably the solution is already written somewhere ...  Does anybody have a similar example?
>
>
> Thanks a lot !
>
>
>
> --------------------
> Julien Schmitt
> VSORA - immeuble LE PASTEUR
> 13/15 rue Jeanne Braconnier, 92360 Meudon La ForĂȘt,  France
> Mob : +33 6 66 81 08 76
> Email: julien.schmitt at vsora.com
> Web: www.vsora.com
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list