[all-commits] [llvm/llvm-project] 2f7214: Frontend: Simplify handling of non-seeking streams...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Tue Jan 26 15:25:12 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f721476d10c1cc7a5336650a85012f78c94d33a
      https://github.com/llvm/llvm-project/commit/2f721476d10c1cc7a5336650a85012f78c94d33a
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2021-01-26 (Tue, 26 Jan 2021)

  Changed paths:
    M clang/include/clang/Frontend/CompilerInstance.h
    M clang/lib/Frontend/CompilerInstance.cpp
    M llvm/include/llvm/Support/raw_ostream.h
    M llvm/lib/Support/raw_ostream.cpp

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

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.

Differential Revision: https://reviews.llvm.org/D93260




More information about the All-commits mailing list