[llvm-objcopy][Support] move writeToOutput helper function to Support.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Thu, 4 Mar 2021 09:51:30 +0000 (12:51 +0300)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Mon, 22 Mar 2021 12:41:10 +0000 (15:41 +0300)
commit972b6a3a3471c2a742c5c5d8ec004ff640d544c4
tree3e6c7e5feddf2c2d47a29ae748dcbdd6193c084d
parent9cd7c4130635a6f0c94046f529fb1ee19118bbfb
[llvm-objcopy][Support] move writeToOutput helper function to Support.

writeToOutput function is useful when it is necessary to create different kinds
of streams(based on stream name) and when we need to use a temporary file
while writing(which would be renamed into the resulting file in a success case).
This patch moves the writeToStream helper into the Support library.

Differential Revision: https://reviews.llvm.org/D98426
llvm/include/llvm/Support/raw_ostream.h
llvm/lib/Support/raw_ostream.cpp
llvm/tools/llvm-objcopy/llvm-objcopy.cpp
llvm/tools/llvm-objcopy/llvm-objcopy.h
llvm/unittests/Support/raw_ostream_test.cpp