[cfe-dev] Locating Includes for Rewriting

Hendrik vP variadic.template at googlemail.com
Thu Mar 17 07:20:32 PDT 2011


You can derive of the PPCallbacks-class and overwrite the
InclusionDirective- or FileChanged-method to get informed about inclusions.
Then, add an instance of your class per addPPCallbacks to your preprocessor.

Hendrik

2011/3/17 Gabriel Martinez <mystal at vt.edu>

> I am working on a source-to-source translator plugin for clang. Currently,
> I rewrite both the main file and some included files to new files in the
> process. Given this, I wanted to automatically rewrite the includes of
> rewritten header files.
>
> In the RewriteObjC class something similar is done where they rewrite
> #imports to #includes. Theeir method of locating the imports is by manually
> traversing the buffer character by character, which works fine but in my
> case would be more complex. Therefore, I was wondering if there is any
> portion of clang or llvm that may aid me in locating the includes?
>
>
> Thanks,
> Gabriel
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110317/6bae1239/attachment.html>


More information about the cfe-dev mailing list