[cfe-dev] Get location of #pragma

Daniel Powell divot.powell at googlemail.com
Thu Jun 14 04:44:36 PDT 2012


I'm writing a code re-writer involving the use of pragmas. I have my
PragmaHandler and every other bit working fine, but when I try to replace
the pragma statement it only replaces the parts after the #pragma keyword.
HandlePragma provides a SourceLocation to the token after #pragma, but not
the keyword itself. Is there any way, preferably from within the
PragmaHandler, that I can get a SourceLocation to the #pragma keyword?


Input: #pragma omp parallel for
Desired output: { char * specLoop; }
Actual output: #pragma { char * specLoop; }



Daniel Powell
divot.powell at googlemail.com

The University of Edinburgh
Institute for Computer Systems Architecture
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120614/39b0a1c2/attachment.html>

More information about the cfe-dev mailing list