[cfe-dev] RecursiveASTVisitor and PragmaHandler

Adam Nemet via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 23 09:55:32 PDT 2017


> On Mar 23, 2017, at 3:28 AM, Compiler Dragon via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> I am currently writing a clang plugin, which does some transformation on for-loops. I have implemented a pragma handler, which is called back just fine. But now I am puzzled how to get the current state of the pragma in the RecursiveASTVisitor
> 
The easiest would be to extend the loop-hint pragma.  See what I did for loop-distribution: https://reviews.llvm.org/D19403 <https://reviews.llvm.org/D19403>.

Adam
> ...
> 
> #pragma mypragma on
> 
> for ( i = 0; i < 5; i++) {          
> 
> ...
> 
> }
> 
> #pragma mypragma off
> 
> ..
> 
> Thanks
> 
> Marcel
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

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


More information about the cfe-dev mailing list