This is an archive of the discontinued LLVM Phabricator instance.

Frontend: Simplify handling of non-seeking streams in CompilerInstance, NFC
ClosedPublic

Authored by dexonsmith on Dec 14 2020, 5:52 PM.

Details

Summary

Add a new raw_pwrite_ostream variant, buffer_unique_ostream, which
is like buffer_ostream but with unique ownership of the stream it's
wrapping. Use this in CompilerInstance to simplify the ownership of
non-seeking output streams, avoiding logic sprawled around to deal with
them specially.

This also simplifies future work to encapsulate output files in a
different class.

Diff Detail