class ToolOutputFile

Declaration

class ToolOutputFile { /* full declaration omitted */ };

Description

This class contains a raw_fd_ostream and adds a few extra features commonly needed for compiler-like tool output files: - The file is automatically deleted if the process is killed. - The file is automatically deleted when the ToolOutputFile object is destroyed unless the client calls keep().

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:26

Member Variables

private class CleanupInstaller Installer
private Optional<llvm::raw_fd_ostream> OSHolder
Storage for the stream, if we're owning our own stream. This is intentionally declared after Installer.
private llvm::raw_fd_ostream* OS
The actual stream to use.

Method Overview

Methods

ToolOutputFile(llvm::StringRef Filename,
               std::error_code& EC,
               sys::fs::OpenFlags Flags)

Description

This constructor's arguments are passed to raw_fd_ostream's constructor.

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:54

Parameters

llvm::StringRef Filename
std::error_code& EC
sys::fs::OpenFlags Flags

ToolOutputFile(llvm::StringRef Filename, int FD)

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:57

Parameters

llvm::StringRef Filename
int FD

llvm::StringRef getFilename()

Description

Return the filename initialized with.

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:63

void keep()

Description

Indicate that the tool's job wrt this output file has been successful and the file should not be deleted.

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:67

llvm::raw_fd_ostream& os()

Description

Return the contained raw_fd_ostream.

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:60

const std::string& outputFilename()

Declared at: llvm/include/llvm/Support/ToolOutputFile.h:69