Quantcast

RecursiveASTVisitor and PragmaHandler

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RecursiveASTVisitor and PragmaHandler

Brian Cain via cfe-dev

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:

...

#pragma mypragma on

for ( i = 0; i < 5; i++) {          

...

}

#pragma mypragma off

..

Thanks

Marcel


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RecursiveASTVisitor and PragmaHandler

Brian Cain via cfe-dev

On Mar 23, 2017, at 3:28 AM, Compiler Dragon via cfe-dev <[hidden email]> 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.

Adam

...

#pragma mypragma on

for ( i = 0; i < 5; i++) {          

...

}

#pragma mypragma off

..

Thanks

Marcel

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...