How to get preprocessed source?

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.

Hi Robert,

Take a look at clang::DoPrintPreprocessedInput.