[cfe-dev] Get the location of a previous token in Clang

Manuel Klimek via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 27 00:03:05 PDT 2015


You'll want to use PPCallbacks to get to the pragma, I'd say...

On Mon, Oct 26, 2015 at 7:36 PM james long via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Dear all,
>
> I am currently writing a libtooling tool.
>
> Suppose  a 'pragma'  like following is registered:
>
> #pragma tool
>
> It is easily to get the location of token 'tool', but how to get the
> location
> of token 'pragma' ?  Which API should I use?
>
> Thanks in advance!
>
> Best
> James
> _______________________________________________
> 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/20151027/48e1b338/attachment.html>


More information about the cfe-dev mailing list