[cfe-dev] How to get preprocessed source?

Maxime van Noppen maxime.van.noppen at gmail.com
Thu Nov 28 09:24:47 PST 2013


Hi Robert,

Take a look at clang::DoPrintPreprocessedInput.

http://clang.llvm.org/doxygen/namespaceclang.html#a8f3083b46a33764cacbe03db4aaa4da0

Cheers,

On Thu, Nov 28, 2013 at 5:18 PM, Robert Ankeney <rrankene at gmail.com> wrote:
> How would I go about getting the preprocessed source in a string?
> Repeatedly calling getPreprocessor().Lex(token) gives me the tokens,
> but none of the white space between. Essentially I'd like the
> equivalent of a "clang -E -P foo.c" in a string.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



-- 
Maxime



More information about the cfe-dev mailing list