[cfe-dev] FrontendAction output

Mike Miller michael.g.miller at gmail.com
Mon May 10 11:49:27 PDT 2010


Some folks on #llvm helped me with this - the solution is to create a
virtual file using FileManager::getVirtualFile, and populate it with the
buffer's contents using SourceManager::overrideFileContents, then pass the
virtual file to the FrontendAction.

Hope that helps,
Mike

On Fri, May 7, 2010 at 3:30 PM, Mike Miller <michael.g.miller at gmail.com>wrote:

> Hi,
>
> I want to have the output of a FrontendAction(specifically an
> EmitObjAction) piped into a MemoryBuffer, instead of a file. What's the most
> straightforward way to do this?
>
> Thanks,
> Mike
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100510/680f3d9e/attachment.html>


More information about the cfe-dev mailing list