ΒΆllvm::Error writeToOutput(
    llvm::StringRef OutputFileName,
    std::function<Error(raw_ostream&)> Write)

Description

This helper creates an output stream and then passes it to \p Write. The stream created is based on the specified \p OutputFileName: llvm::outs for "-", raw_null_ostream for "/dev/null", and raw_fd_ostream for other names. For raw_fd_ostream instances, the stream writes to a temporary file. The final output file is atomically replaced with the temporary file after the \p Write function is finished.

Declared at: llvm/include/llvm/Support/raw_ostream.h:744

Parameters

llvm::StringRef OutputFileName
std::function<Error(raw_ostream&)> Write