aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-09-23 01:03:17 +0000
committerReid Kleckner <rnk@google.com>2017-09-23 01:03:17 +0000
commit97ca964f3d1bbd0b5884612a16c55297db34e39c (patch)
treecf2b1793551aa687a99d753dbc268e90f91c9052
parent4e65a6d127cba830c5a7ca87869d137796c2ba8b (diff)
[Support] Rename tool_output_file to ToolOutputFile, NFC
This class isn't similar to anything from the STL, so it shouldn't use the STL naming conventions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314050 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/LTO/LTO.h2
-rw-r--r--include/llvm/LTO/legacy/LTOCodeGenerator.h2
-rw-r--r--include/llvm/Support/ToolOutputFile.h12
-rw-r--r--lib/LTO/LTO.cpp4
-rw-r--r--lib/LTO/LTOBackend.cpp2
-rw-r--r--lib/LTO/LTOCodeGenerator.cpp4
-rw-r--r--lib/Object/ArchiveWriter.cpp2
-rw-r--r--lib/Support/ToolOutputFile.cpp14
-rw-r--r--lib/TableGen/Main.cpp4
-rw-r--r--tools/bugpoint/ExtractFunction.cpp2
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp8
-rw-r--r--tools/llc/llc.cpp17
-rw-r--r--tools/llvm-as/llvm-as.cpp4
-rw-r--r--tools/llvm-cov/CodeCoverage.cpp4
-rw-r--r--tools/llvm-dis/llvm-dis.cpp4
-rw-r--r--tools/llvm-extract/llvm-extract.cpp2
-rw-r--r--tools/llvm-link/llvm-link.cpp2
-rw-r--r--tools/llvm-lto/llvm-lto.cpp4
-rw-r--r--tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp4
-rw-r--r--tools/llvm-mc/llvm-mc.cpp8
-rw-r--r--tools/llvm-modextract/llvm-modextract.cpp4
-rw-r--r--tools/llvm-objdump/MachODump.cpp2
-rw-r--r--tools/llvm-split/llvm-split.cpp4
-rw-r--r--tools/llvm-stress/llvm-stress.cpp4
-rw-r--r--tools/opt/NewPMDriver.cpp5
-rw-r--r--tools/opt/NewPMDriver.h6
-rw-r--r--tools/opt/opt.cpp18
-rw-r--r--tools/yaml2obj/yaml2obj.cpp4
28 files changed, 75 insertions, 77 deletions
diff --git a/include/llvm/LTO/LTO.h b/include/llvm/LTO/LTO.h
index 537e70e84ca..f784d499743 100644
--- a/include/llvm/LTO/LTO.h
+++ b/include/llvm/LTO/LTO.h
@@ -71,7 +71,7 @@ std::string getThinLTOOutputFile(const std::string &Path,
const std::string &NewPrefix);
/// Setup optimization remarks.
-Expected<std::unique_ptr<tool_output_file>>
+Expected<std::unique_ptr<ToolOutputFile>>
setupOptimizationRemarks(LLVMContext &Context, StringRef LTORemarksFilename,
bool LTOPassRemarksWithHotness, int Count = -1);
diff --git a/include/llvm/LTO/legacy/LTOCodeGenerator.h b/include/llvm/LTO/legacy/LTOCodeGenerator.h
index 4add6724557..f48ab02863a 100644
--- a/include/llvm/LTO/legacy/LTOCodeGenerator.h
+++ b/include/llvm/LTO/legacy/LTOCodeGenerator.h
@@ -237,7 +237,7 @@ private:
bool ShouldEmbedUselists = false;
bool ShouldRestoreGlobalsLinkage = false;
TargetMachine::CodeGenFileType FileType = TargetMachine::CGFT_ObjectFile;
- std::unique_ptr<tool_output_file> DiagnosticOutputFile;
+ std::unique_ptr<ToolOutputFile> DiagnosticOutputFile;
bool Freestanding = false;
};
}
diff --git a/include/llvm/Support/ToolOutputFile.h b/include/llvm/Support/ToolOutputFile.h
index 1be26c2cb58..b41ca5a6eda 100644
--- a/include/llvm/Support/ToolOutputFile.h
+++ b/include/llvm/Support/ToolOutputFile.h
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file defines the tool_output_file class.
+// This file defines the ToolOutputFile class.
//
//===----------------------------------------------------------------------===//
@@ -21,9 +21,9 @@ namespace llvm {
/// 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 tool_output_file
+/// - The file is automatically deleted when the ToolOutputFile
/// object is destroyed unless the client calls keep().
-class tool_output_file {
+class ToolOutputFile {
/// This class is declared before the raw_fd_ostream so that it is constructed
/// before the raw_fd_ostream is constructed and destructed after the
/// raw_fd_ostream is destructed. It installs cleanups in its constructor and
@@ -45,10 +45,10 @@ class tool_output_file {
public:
/// This constructor's arguments are passed to to raw_fd_ostream's
/// constructor.
- tool_output_file(StringRef Filename, std::error_code &EC,
- sys::fs::OpenFlags Flags);
+ ToolOutputFile(StringRef Filename, std::error_code &EC,
+ sys::fs::OpenFlags Flags);
- tool_output_file(StringRef Filename, int FD);
+ ToolOutputFile(StringRef Filename, int FD);
/// Return the contained raw_fd_ostream.
raw_fd_ostream &os() { return OS; }
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index fad6d5ca006..4fb36e7998e 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -1166,7 +1166,7 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
return BackendProc->wait();
}
-Expected<std::unique_ptr<tool_output_file>>
+Expected<std::unique_ptr<ToolOutputFile>>
lto::setupOptimizationRemarks(LLVMContext &Context,
StringRef LTORemarksFilename,
bool LTOPassRemarksWithHotness, int Count) {
@@ -1179,7 +1179,7 @@ lto::setupOptimizationRemarks(LLVMContext &Context,
std::error_code EC;
auto DiagnosticFile =
- llvm::make_unique<tool_output_file>(Filename, EC, sys::fs::F_None);
+ llvm::make_unique<ToolOutputFile>(Filename, EC, sys::fs::F_None);
if (EC)
return errorCodeToError(EC);
Context.setDiagnosticsOutputFile(
diff --git a/lib/LTO/LTOBackend.cpp b/lib/LTO/LTOBackend.cpp
index 5c113212041..501d6284117 100644
--- a/lib/LTO/LTOBackend.cpp
+++ b/lib/LTO/LTOBackend.cpp
@@ -349,7 +349,7 @@ Expected<const Target *> initAndLookupTarget(Config &C, Module &Mod) {
}
static void
-finalizeOptimizationRemarks(std::unique_ptr<tool_output_file> DiagOutputFile) {
+finalizeOptimizationRemarks(std::unique_ptr<ToolOutputFile> DiagOutputFile) {
// Make sure we flush the diagnostic remarks file in case the linker doesn't
// call the global destructors before exiting.
if (!DiagOutputFile)
diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp
index ee9c70126b8..0e6c3edb140 100644
--- a/lib/LTO/LTOCodeGenerator.cpp
+++ b/lib/LTO/LTOCodeGenerator.cpp
@@ -225,7 +225,7 @@ bool LTOCodeGenerator::writeMergedModules(StringRef Path) {
// create output file
std::error_code EC;
- tool_output_file Out(Path, EC, sys::fs::F_None);
+ ToolOutputFile Out(Path, EC, sys::fs::F_None);
if (EC) {
std::string ErrMsg = "could not open bitcode file for writing: ";
ErrMsg += Path;
@@ -265,7 +265,7 @@ bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
}
// generate object file
- tool_output_file objFile(Filename, FD);
+ ToolOutputFile objFile(Filename, FD);
bool genResult = compileOptimized(&objFile.os());
objFile.os().close();
diff --git a/lib/Object/ArchiveWriter.cpp b/lib/Object/ArchiveWriter.cpp
index 19a46c01c59..b36b256d446 100644
--- a/lib/Object/ArchiveWriter.cpp
+++ b/lib/Object/ArchiveWriter.cpp
@@ -394,7 +394,7 @@ Error llvm::writeArchive(StringRef ArcName,
TmpArchiveFD, TmpArchive))
return errorCodeToError(EC);
- tool_output_file Output(TmpArchive, TmpArchiveFD);
+ ToolOutputFile Output(TmpArchive, TmpArchiveFD);
raw_fd_ostream &Out = Output.os();
if (Thin)
Out << "!<thin>\n";
diff --git a/lib/Support/ToolOutputFile.cpp b/lib/Support/ToolOutputFile.cpp
index 8ae977db6a1..e12d9e824f7 100644
--- a/lib/Support/ToolOutputFile.cpp
+++ b/lib/Support/ToolOutputFile.cpp
@@ -1,4 +1,4 @@
-//===--- ToolOutputFile.cpp - Implement the tool_output_file class --------===//
+//===--- ToolOutputFile.cpp - Implement the ToolOutputFile class --------===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This implements the tool_output_file class.
+// This implements the ToolOutputFile class.
//
//===----------------------------------------------------------------------===//
@@ -16,14 +16,14 @@
#include "llvm/Support/Signals.h"
using namespace llvm;
-tool_output_file::CleanupInstaller::CleanupInstaller(StringRef Filename)
+ToolOutputFile::CleanupInstaller::CleanupInstaller(StringRef Filename)
: Filename(Filename), Keep(false) {
// Arrange for the file to be deleted if the process is killed.
if (Filename != "-")
sys::RemoveFileOnSignal(Filename);
}
-tool_output_file::CleanupInstaller::~CleanupInstaller() {
+ToolOutputFile::CleanupInstaller::~CleanupInstaller() {
// Delete the file if the client hasn't told us not to.
if (!Keep && Filename != "-")
sys::fs::remove(Filename);
@@ -34,13 +34,13 @@ tool_output_file::CleanupInstaller::~CleanupInstaller() {
sys::DontRemoveFileOnSignal(Filename);
}
-tool_output_file::tool_output_file(StringRef Filename, std::error_code &EC,
- sys::fs::OpenFlags Flags)
+ToolOutputFile::ToolOutputFile(StringRef Filename, std::error_code &EC,
+ sys::fs::OpenFlags Flags)
: Installer(Filename), OS(Filename, EC, Flags) {
// If open fails, no cleanup is needed.
if (EC)
Installer.Keep = true;
}
-tool_output_file::tool_output_file(StringRef Filename, int FD)
+ToolOutputFile::ToolOutputFile(StringRef Filename, int FD)
: Installer(Filename), OS(FD, true) {}
diff --git a/lib/TableGen/Main.cpp b/lib/TableGen/Main.cpp
index 278b567fb22..fc9d0cc0888 100644
--- a/lib/TableGen/Main.cpp
+++ b/lib/TableGen/Main.cpp
@@ -61,7 +61,7 @@ static int createDependencyFile(const TGParser &Parser, const char *argv0) {
return reportError(argv0, "the option -d must be used together with -o\n");
std::error_code EC;
- tool_output_file DepOut(DependFilename, EC, sys::fs::F_Text);
+ ToolOutputFile DepOut(DependFilename, EC, sys::fs::F_Text);
if (EC)
return reportError(argv0, "error opening " + DependFilename + ":" +
EC.message() + "\n");
@@ -97,7 +97,7 @@ int llvm::TableGenMain(char *argv0, TableGenMainFn *MainFn) {
return 1;
std::error_code EC;
- tool_output_file Out(OutputFilename, EC, sys::fs::F_Text);
+ ToolOutputFile Out(OutputFilename, EC, sys::fs::F_Text);
if (EC)
return reportError(argv0, "error opening " + OutputFilename + ":" +
EC.message() + "\n");
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 72872e83f79..ec97ca30e7c 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -385,7 +385,7 @@ BugDriver::extractMappedBlocksFromModule(const std::vector<BasicBlock *> &BBs,
}
sys::RemoveFileOnSignal(Filename);
- tool_output_file BlocksToNotExtractFile(Filename.c_str(), FD);
+ ToolOutputFile BlocksToNotExtractFile(Filename.c_str(), FD);
for (std::vector<BasicBlock *>::const_iterator I = BBs.begin(), E = BBs.end();
I != E; ++I) {
BasicBlock *BB = *I;
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 0b22f1b729a..c112ae00ed6 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -58,7 +58,7 @@ static cl::opt<std::string>
/// writeProgramToFile - This writes the current "Program" to the named bitcode
/// file. If an error occurs, true is returned.
///
-static bool writeProgramToFileAux(tool_output_file &Out, const Module *M) {
+static bool writeProgramToFileAux(ToolOutputFile &Out, const Module *M) {
WriteBitcodeToFile(M, Out.os(), PreserveBitcodeUseListOrder);
Out.os().close();
if (!Out.os().has_error()) {
@@ -70,14 +70,14 @@ static bool writeProgramToFileAux(tool_output_file &Out, const Module *M) {
bool BugDriver::writeProgramToFile(const std::string &Filename, int FD,
const Module *M) const {
- tool_output_file Out(Filename, FD);
+ ToolOutputFile Out(Filename, FD);
return writeProgramToFileAux(Out, M);
}
bool BugDriver::writeProgramToFile(const std::string &Filename,
const Module *M) const {
std::error_code EC;
- tool_output_file Out(Filename, EC, sys::fs::F_None);
+ ToolOutputFile Out(Filename, EC, sys::fs::F_None);
if (!EC)
return writeProgramToFileAux(Out, M);
return true;
@@ -154,7 +154,7 @@ bool BugDriver::runPasses(Module *Program,
return 1;
}
- tool_output_file InFile(InputFilename, InputFD);
+ ToolOutputFile InFile(InputFilename, InputFD);
WriteBitcodeToFile(Program, InFile.os(), PreserveBitcodeUseListOrder);
InFile.os().close();
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index bbbec221208..fe6b97e34b6 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -167,9 +167,9 @@ static cl::opt<RunPassOption, true, cl::parser<std::string>> RunPass(
static int compileModule(char **, LLVMContext &);
-static std::unique_ptr<tool_output_file>
-GetOutputStream(const char *TargetName, Triple::OSType OS,
- const char *ProgName) {
+static std::unique_ptr<ToolOutputFile> GetOutputStream(const char *TargetName,
+ Triple::OSType OS,
+ const char *ProgName) {
// If we don't yet have an output filename, make one.
if (OutputFilename.empty()) {
if (InputFilename == "-")
@@ -225,8 +225,7 @@ GetOutputStream(const char *TargetName, Triple::OSType OS,
sys::fs::OpenFlags OpenFlags = sys::fs::F_None;
if (!Binary)
OpenFlags |= sys::fs::F_Text;
- auto FDOut = llvm::make_unique<tool_output_file>(OutputFilename, EC,
- OpenFlags);
+ auto FDOut = llvm::make_unique<ToolOutputFile>(OutputFilename, EC, OpenFlags);
if (EC) {
errs() << EC.message() << '\n';
return nullptr;
@@ -322,11 +321,11 @@ int main(int argc, char **argv) {
if (PassRemarksHotnessThreshold)
Context.setDiagnosticsHotnessThreshold(PassRemarksHotnessThreshold);
- std::unique_ptr<tool_output_file> YamlFile;
+ std::unique_ptr<ToolOutputFile> YamlFile;
if (RemarksFilename != "") {
std::error_code EC;
- YamlFile = llvm::make_unique<tool_output_file>(RemarksFilename, EC,
- sys::fs::F_None);
+ YamlFile =
+ llvm::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
return 1;
@@ -470,7 +469,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
Options.FloatABIType = FloatABIForCalls;
// Figure out where we are going to send the output.
- std::unique_ptr<tool_output_file> Out =
+ std::unique_ptr<ToolOutputFile> Out =
GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0]);
if (!Out) return 1;
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp
index 06bc2e99010..dffe9e6ace3 100644
--- a/tools/llvm-as/llvm-as.cpp
+++ b/tools/llvm-as/llvm-as.cpp
@@ -72,8 +72,8 @@ static void WriteOutputFile(const Module *M) {
}
std::error_code EC;
- std::unique_ptr<tool_output_file> Out(
- new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ std::unique_ptr<ToolOutputFile> Out(
+ new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
if (EC) {
errs() << EC.message() << '\n';
exit(1);
diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp
index 981c93a2d95..ed87e9e8e61 100644
--- a/tools/llvm-cov/CodeCoverage.cpp
+++ b/tools/llvm-cov/CodeCoverage.cpp
@@ -446,7 +446,7 @@ void CodeCoverageTool::demangleSymbols(const CoverageMapping &Coverage) {
error(InputPath, EC.message());
return;
}
- tool_output_file InputTOF{InputPath, InputFD};
+ ToolOutputFile InputTOF{InputPath, InputFD};
unsigned NumSymbols = 0;
for (const auto &Function : Coverage.getCoveredFunctions()) {
@@ -464,7 +464,7 @@ void CodeCoverageTool::demangleSymbols(const CoverageMapping &Coverage) {
error(OutputPath, EC.message());
return;
}
- tool_output_file OutputTOF{OutputPath, OutputFD};
+ ToolOutputFile OutputTOF{OutputPath, OutputFD};
OutputTOF.os().close();
// Invoke the demangler.
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp
index 6828b69abe8..c91aa1c71a1 100644
--- a/tools/llvm-dis/llvm-dis.cpp
+++ b/tools/llvm-dis/llvm-dis.cpp
@@ -191,8 +191,8 @@ int main(int argc, char **argv) {
}
std::error_code EC;
- std::unique_ptr<tool_output_file> Out(
- new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ std::unique_ptr<ToolOutputFile> Out(
+ new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
if (EC) {
errs() << EC.message() << '\n';
return 1;
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index d868db7f78a..c39ffa58fbf 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -296,7 +296,7 @@ int main(int argc, char **argv) {
Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls
std::error_code EC;
- tool_output_file Out(OutputFilename, EC, sys::fs::F_None);
+ ToolOutputFile Out(OutputFilename, EC, sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
return 1;
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index 805ea73b3f6..50f506aeaae 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -383,7 +383,7 @@ int main(int argc, char **argv) {
if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite;
std::error_code EC;
- tool_output_file Out(OutputFilename, EC, sys::fs::F_None);
+ ToolOutputFile Out(OutputFilename, EC, sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
return 1;
diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp
index bbd0edac108..113ba9640a7 100644
--- a/tools/llvm-lto/llvm-lto.cpp
+++ b/tools/llvm-lto/llvm-lto.cpp
@@ -936,7 +936,7 @@ int main(int argc, char **argv) {
error("writing merged module failed.");
}
- std::list<tool_output_file> OSs;
+ std::list<ToolOutputFile> OSs;
std::vector<raw_pwrite_stream *> OSPtrs;
for (unsigned I = 0; I != Parallelism; ++I) {
std::string PartFilename = OutputFilename;
@@ -953,7 +953,7 @@ int main(int argc, char **argv) {
// Diagnostic messages should have been printed by the handler.
error("error compiling the code");
- for (tool_output_file &OS : OSs)
+ for (ToolOutputFile &OS : OSs)
OS.keep();
} else {
if (Parallelism != 1)
diff --git a/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
index 63264a78c03..5a0d6ac4f47 100644
--- a/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
+++ b/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
@@ -209,8 +209,8 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) {
std::error_code EC;
const std::string OutputFilename = "-";
- auto Out = llvm::make_unique<tool_output_file>(OutputFilename, EC,
- sys::fs::F_None);
+ auto Out =
+ llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
abort();
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index ec4c5d542ce..dcd74a6af8b 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -197,13 +197,13 @@ static const Target *GetTarget(const char *ProgName) {
return TheTarget;
}
-static std::unique_ptr<tool_output_file> GetOutputStream() {
+static std::unique_ptr<ToolOutputFile> GetOutputStream() {
if (OutputFilename == "")
OutputFilename = "-";
std::error_code EC;
- auto Out = llvm::make_unique<tool_output_file>(OutputFilename, EC,
- sys::fs::F_None);
+ auto Out =
+ llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
return nullptr;
@@ -534,7 +534,7 @@ int main(int argc, char **argv) {
FeaturesStr = Features.getString();
}
- std::unique_ptr<tool_output_file> Out = GetOutputStream();
+ std::unique_ptr<ToolOutputFile> Out = GetOutputStream();
if (!Out)
return 1;
diff --git a/tools/llvm-modextract/llvm-modextract.cpp b/tools/llvm-modextract/llvm-modextract.cpp
index 58cede1374e..b2d21c23a09 100644
--- a/tools/llvm-modextract/llvm-modextract.cpp
+++ b/tools/llvm-modextract/llvm-modextract.cpp
@@ -54,8 +54,8 @@ int main(int argc, char **argv) {
}
std::error_code EC;
- std::unique_ptr<tool_output_file> Out(
- new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ std::unique_ptr<ToolOutputFile> Out(
+ new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
ExitOnErr(errorCodeToError(EC));
if (BinaryExtract) {
diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp
index 006ba5765e7..e9b531fb50d 100644
--- a/tools/llvm-objdump/MachODump.cpp
+++ b/tools/llvm-objdump/MachODump.cpp
@@ -5950,7 +5950,7 @@ static void DumpBitcodeSection(MachOObjectFile *O, const char *sect,
errs() << XarEC.message() << "\n";
return;
}
- tool_output_file XarFile(XarFilename, FD);
+ ToolOutputFile XarFile(XarFilename, FD);
raw_fd_ostream &XarOut = XarFile.os();
StringRef XarContents(sect, size);
XarOut << XarContents;
diff --git a/tools/llvm-split/llvm-split.cpp b/tools/llvm-split/llvm-split.cpp
index d340d18fccc..03625fb4a85 100644
--- a/tools/llvm-split/llvm-split.cpp
+++ b/tools/llvm-split/llvm-split.cpp
@@ -55,8 +55,8 @@ int main(int argc, char **argv) {
unsigned I = 0;
SplitModule(std::move(M), NumOutputs, [&](std::unique_ptr<Module> MPart) {
std::error_code EC;
- std::unique_ptr<tool_output_file> Out(new tool_output_file(
- OutputFilename + utostr(I++), EC, sys::fs::F_None));
+ std::unique_ptr<ToolOutputFile> Out(
+ new ToolOutputFile(OutputFilename + utostr(I++), EC, sys::fs::F_None));
if (EC) {
errs() << EC.message() << '\n';
exit(1);
diff --git a/tools/llvm-stress/llvm-stress.cpp b/tools/llvm-stress/llvm-stress.cpp
index 650ae9627ec..d8ec11251ff 100644
--- a/tools/llvm-stress/llvm-stress.cpp
+++ b/tools/llvm-stress/llvm-stress.cpp
@@ -747,13 +747,13 @@ int main(int argc, char **argv) {
IntroduceControlFlow(F, R);
// Figure out what stream we are supposed to write to...
- std::unique_ptr<tool_output_file> Out;
+ std::unique_ptr<ToolOutputFile> Out;
// Default to standard output.
if (OutputFilename.empty())
OutputFilename = "-";
std::error_code EC;
- Out.reset(new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
if (EC) {
errs() << EC.message() << '\n';
return 1;
diff --git a/tools/opt/NewPMDriver.cpp b/tools/opt/NewPMDriver.cpp
index 3ce33fd729e..a3f16f2538c 100644
--- a/tools/opt/NewPMDriver.cpp
+++ b/tools/opt/NewPMDriver.cpp
@@ -168,9 +168,8 @@ void RegisterPollyPasses(PassBuilder &);
#endif
bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
- tool_output_file *Out,
- tool_output_file *ThinLTOLinkOut,
- tool_output_file *OptRemarkFile,
+ ToolOutputFile *Out, ToolOutputFile *ThinLTOLinkOut,
+ ToolOutputFile *OptRemarkFile,
StringRef PassPipeline, OutputKind OK,
VerifierKind VK,
bool ShouldPreserveAssemblyUseListOrder,
diff --git a/tools/opt/NewPMDriver.h b/tools/opt/NewPMDriver.h
index 88184f1aabc..e5490deaeaf 100644
--- a/tools/opt/NewPMDriver.h
+++ b/tools/opt/NewPMDriver.h
@@ -26,7 +26,7 @@ class StringRef;
class LLVMContext;
class Module;
class TargetMachine;
-class tool_output_file;
+class ToolOutputFile;
namespace opt_tool {
enum OutputKind {
@@ -52,8 +52,8 @@ enum VerifierKind {
/// ThinLTOLinkOut is only used when OK is OK_OutputThinLTOBitcode, and can be
/// nullptr.
bool runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
- tool_output_file *Out, tool_output_file *ThinLinkOut,
- tool_output_file *OptRemarkFile, StringRef PassPipeline,
+ ToolOutputFile *Out, ToolOutputFile *ThinLinkOut,
+ ToolOutputFile *OptRemarkFile, StringRef PassPipeline,
opt_tool::OutputKind OK, opt_tool::VerifierKind VK,
bool ShouldPreserveAssemblyUseListOrder,
bool ShouldPreserveBitcodeUseListOrder,
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 4c7d090097a..fd851f240a4 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -430,11 +430,11 @@ int main(int argc, char **argv) {
if (PassRemarksHotnessThreshold)
Context.setDiagnosticsHotnessThreshold(PassRemarksHotnessThreshold);
- std::unique_ptr<tool_output_file> OptRemarkFile;
+ std::unique_ptr<ToolOutputFile> OptRemarkFile;
if (RemarksFilename != "") {
std::error_code EC;
- OptRemarkFile = llvm::make_unique<tool_output_file>(RemarksFilename, EC,
- sys::fs::F_None);
+ OptRemarkFile =
+ llvm::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
return 1;
@@ -471,8 +471,8 @@ int main(int argc, char **argv) {
M->setDataLayout(ClDataLayout);
// Figure out what stream we are supposed to write to...
- std::unique_ptr<tool_output_file> Out;
- std::unique_ptr<tool_output_file> ThinLinkOut;
+ std::unique_ptr<ToolOutputFile> Out;
+ std::unique_ptr<ToolOutputFile> ThinLinkOut;
if (NoOutput) {
if (!OutputFilename.empty())
errs() << "WARNING: The -o (output filename) option is ignored when\n"
@@ -483,7 +483,7 @@ int main(int argc, char **argv) {
OutputFilename = "-";
std::error_code EC;
- Out.reset(new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
if (EC) {
errs() << EC.message() << '\n';
return 1;
@@ -491,7 +491,7 @@ int main(int argc, char **argv) {
if (!ThinLinkBitcodeFile.empty()) {
ThinLinkOut.reset(
- new tool_output_file(ThinLinkBitcodeFile, EC, sys::fs::F_None));
+ new ToolOutputFile(ThinLinkBitcodeFile, EC, sys::fs::F_None));
if (EC) {
errs() << EC.message() << '\n';
return 1;
@@ -580,8 +580,8 @@ int main(int argc, char **argv) {
OutputFilename = "-";
std::error_code EC;
- Out = llvm::make_unique<tool_output_file>(OutputFilename, EC,
- sys::fs::F_None);
+ Out = llvm::make_unique<ToolOutputFile>(OutputFilename, EC,
+ sys::fs::F_None);
if (EC) {
errs() << EC.message() << '\n';
return 1;
diff --git a/tools/yaml2obj/yaml2obj.cpp b/tools/yaml2obj/yaml2obj.cpp
index ead4b7a86b2..3e2a5ca7ae0 100644
--- a/tools/yaml2obj/yaml2obj.cpp
+++ b/tools/yaml2obj/yaml2obj.cpp
@@ -79,8 +79,8 @@ int main(int argc, char **argv) {
OutputFilename = "-";
std::error_code EC;
- std::unique_ptr<tool_output_file> Out(
- new tool_output_file(OutputFilename, EC, sys::fs::F_None));
+ std::unique_ptr<ToolOutputFile> Out(
+ new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
if (EC)
error("yaml2obj: Error opening '" + OutputFilename + "': " + EC.message());