]> granicus.if.org Git - llvm/commitdiff
[Support] Rename tool_output_file to ToolOutputFile, NFC
authorReid Kleckner <rnk@google.com>
Sat, 23 Sep 2017 01:03:17 +0000 (01:03 +0000)
committerReid Kleckner <rnk@google.com>
Sat, 23 Sep 2017 01:03:17 +0000 (01:03 +0000)
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

28 files changed:
include/llvm/LTO/LTO.h
include/llvm/LTO/legacy/LTOCodeGenerator.h
include/llvm/Support/ToolOutputFile.h
lib/LTO/LTO.cpp
lib/LTO/LTOBackend.cpp
lib/LTO/LTOCodeGenerator.cpp
lib/Object/ArchiveWriter.cpp
lib/Support/ToolOutputFile.cpp
lib/TableGen/Main.cpp
tools/bugpoint/ExtractFunction.cpp
tools/bugpoint/OptimizerDriver.cpp
tools/llc/llc.cpp
tools/llvm-as/llvm-as.cpp
tools/llvm-cov/CodeCoverage.cpp
tools/llvm-dis/llvm-dis.cpp
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/llvm-link.cpp
tools/llvm-lto/llvm-lto.cpp
tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
tools/llvm-mc/llvm-mc.cpp
tools/llvm-modextract/llvm-modextract.cpp
tools/llvm-objdump/MachODump.cpp
tools/llvm-split/llvm-split.cpp
tools/llvm-stress/llvm-stress.cpp
tools/opt/NewPMDriver.cpp
tools/opt/NewPMDriver.h
tools/opt/opt.cpp
tools/yaml2obj/yaml2obj.cpp

index 537e70e84cae9fdaca9f723959bcecf9b63c810a..f784d4997430d61d7ef46d92deb7ca8cf626e0a1 100644 (file)
@@ -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);
 
index 4add67245578d74b890eea412e97703da07f56ca..f48ab02863a5b4da219a9bbebaa0ac9e4bfca798 100644 (file)
@@ -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;
 };
 }
index 1be26c2cb58baccf22f99d0f488122a4568ef5aa..b41ca5a6edaa2638c2019455f67a05a77d9f03e5 100644 (file)
@@ -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; }
index fad6d5ca0063a9389a9bda96790f47a2ac16d9b6..4fb36e7998eba3bb6e06f36daf05184548962740 100644 (file)
@@ -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(
index 5c1132120418b886fd9a3559058f37af18691fec..501d6284117b67ec23cf2f53592dcc6c494ce240 100644 (file)
@@ -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)
index ee9c70126b83526cb4a83602791a10bfa6b0e79f..0e6c3edb140f7f23555c355bd57b419dafcfba26 100644 (file)
@@ -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();
index 19a46c01c597ce49851eaab346ec948e63db7e00..b36b256d446d715d0579faae54ad0f40fc0d3967 100644 (file)
@@ -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";
index 8ae977db6a1471e074faf71b5de8c9b050c3a0b6..e12d9e824f7edbac06309543ba26e9aed7c29f3b 100644 (file)
@@ -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.
 //
 //===----------------------------------------------------------------------===//
 
 #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) {}
index 278b567fb22099d305bc7f674f507dd737e2278d..fc9d0cc08885698ab5002c6c35aefe701497357c 100644 (file)
@@ -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");
index 72872e83f7923d09838c0bd3869c1b13a5f74088..ec97ca30e7c74c5e7286080fd468bad26aa6882a 100644 (file)
@@ -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;
index 0b22f1b729a6777760f5dbe0da551bca4a23286a..c112ae00ed600dddffbd7b2bb8c316bc79574f97 100644 (file)
@@ -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();
index bbbec2212084eae16bcb876a9c4a4b1a13f5f99d..fe6b97e34b645f6ef7ea2cfdeac55bed83e1b744 100644 (file)
@@ -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;
 
index 06bc2e99010532a822d074f5a8b7da61f127b2b0..dffe9e6ace3af1901733908e543f56db27898c2e 100644 (file)
@@ -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);
index 981c93a2d95b4014a5e64b4915256add0366a3ce..ed87e9e8e618ca8832675ca96be570a5894a0843 100644 (file)
@@ -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.
index 6828b69abe89cc8e39b2ed6ef78711c35a05fdd8..c91aa1c71a1534349ece1073e40cbfc84eadf137 100644 (file)
@@ -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;
index d868db7f78ad16c1aefa9a74baef0a58ef524819..c39ffa58fbf7edbbfac7273a3c8a374c1ded6fcf 100644 (file)
@@ -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;
index 805ea73b3f621f608a9ff4bc33c7f66a9a671300..50f506aeaae9bb7cc22a889de017880f580eafb4 100644 (file)
@@ -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;
index bbd0edac108f00e831f3a351aeae549ce57b34b3..113ba9640a7661801aef96c8ad84a25e9f3a64a7 100644 (file)
@@ -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)
index 63264a78c032a2d094a21ba42547b087857bfcdc..5a0d6ac4f47649c20423e8fadbe1bdee766b9e51 100644 (file)
@@ -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();
index ec4c5d542cee494a2fefa0247a743377a1c6dc0f..dcd74a6af8b4b878f55bf26d049cadeedd6d0f75 100644 (file)
@@ -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;
 
index 58cede1374ea501e28aa0fb33659abbb345bbad2..b2d21c23a0946a514e38c8eb0b49984e0f32f7bd 100644 (file)
@@ -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) {
index 006ba5765e79ba19b3e280ba1eaddb1287e74f1d..e9b531fb50d69493ffa58ab4af3101077d661768 100644 (file)
@@ -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;
index d340d18fccc987c891ec36b8a54160e23e0f5936..03625fb4a854546ece4f27299886311551c0f30a 100644 (file)
@@ -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);
index 650ae9627ecd3b6fe404eb76f068b4e9f44af641..d8ec11251ff65a1d4b035f8785f987a75dd4e06e 100644 (file)
@@ -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;
index 3ce33fd729e75800041b9d1fc5b560974b72c036..a3f16f2538c4b618b7cd80d2669a0a0f0458b669 100644 (file)
@@ -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,
index 88184f1aabc22cdb49c5f00f3d2de468d7587a20..e5490deaeaf5226efcd58bb0cab52c67509f343d 100644 (file)
@@ -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,
index 4c7d090097a0730d158521246fddda0095a347ed..fd851f240a4a76f861883b5ad285ed0b5ffc3ca0 100644 (file)
@@ -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;
index ead4b7a86b2e19f924c8cc77777d36f5129cad78..3e2a5ca7ae0ff5df125552427866889fdc1edebf 100644 (file)
@@ -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());