Get object output in a buffer

Hey all,

I'm compiling a bunch of files through a clang CompilerInvocation and I want
the results in a buffer (rather than on a file).

In order to get the output out of a compile invocation, one normally sets
FrontendOptions.OutputFile but on my environment, I don't want a file to be
I want to do post-processing myself before creating output.

Anyone has any ideas?