[cfe-dev] How to get preprocessed source?

Robert Ankeney rrankene at gmail.com
Thu Nov 28 09:18:04 PST 2013


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.



More information about the cfe-dev mailing list