summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp2
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp8
-rw-r--r--llvm/tools/llc/llc.cpp17
-rw-r--r--llvm/tools/llvm-as/llvm-as.cpp4
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp4
-rw-r--r--llvm/tools/llvm-dis/llvm-dis.cpp4
-rw-r--r--llvm/tools/llvm-extract/llvm-extract.cpp2
-rw-r--r--llvm/tools/llvm-link/llvm-link.cpp2
-rw-r--r--llvm/tools/llvm-lto/llvm-lto.cpp4
-rw-r--r--llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp4
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp8
-rw-r--r--llvm/tools/llvm-modextract/llvm-modextract.cpp4
-rw-r--r--llvm/tools/llvm-objdump/MachODump.cpp2
-rw-r--r--llvm/tools/llvm-split/llvm-split.cpp4
-rw-r--r--llvm/tools/llvm-stress/llvm-stress.cpp4
-rw-r--r--llvm/tools/opt/NewPMDriver.cpp5
-rw-r--r--llvm/tools/opt/NewPMDriver.h6
-rw-r--r--llvm/tools/opt/opt.cpp18
-rw-r--r--llvm/tools/yaml2obj/yaml2obj.cpp4
19 files changed, 52 insertions, 54 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index 72872e83f79..ec97ca30e7c 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/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/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 0b22f1b729a..c112ae00ed6 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/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/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index bbbec221208..fe6b97e34b6 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/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/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp
index 06bc2e99010..dffe9e6ace3 100644
--- a/llvm/tools/llvm-as/llvm-as.cpp
+++ b/llvm/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/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index 981c93a2d95..ed87e9e8e61 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/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/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index 6828b69abe8..c91aa1c71a1 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/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/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp
index d868db7f78a..c39ffa58fbf 100644
--- a/llvm/tools/llvm-extract/llvm-extract.cpp
+++ b/llvm/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/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index 805ea73b3f6..50f506aeaae 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/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/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp
index bbd0edac108..113ba9640a7 100644
--- a/llvm/tools/llvm-lto/llvm-lto.cpp
+++ b/llvm/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/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp b/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
index 63264a78c03..5a0d6ac4f47 100644
--- a/llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
+++ b/llvm/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/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index ec4c5d542ce..dcd74a6af8b 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/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/llvm/tools/llvm-modextract/llvm-modextract.cpp b/llvm/tools/llvm-modextract/llvm-modextract.cpp
index 58cede1374e..b2d21c23a09 100644
--- a/llvm/tools/llvm-modextract/llvm-modextract.cpp
+++ b/llvm/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/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp
index 006ba5765e7..e9b531fb50d 100644
--- a/llvm/tools/llvm-objdump/MachODump.cpp
+++ b/llvm/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/llvm/tools/llvm-split/llvm-split.cpp b/llvm/tools/llvm-split/llvm-split.cpp
index d340d18fccc..03625fb4a85 100644
--- a/llvm/tools/llvm-split/llvm-split.cpp
+++ b/llvm/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/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp
index 650ae9627ec..d8ec11251ff 100644
--- a/llvm/tools/llvm-stress/llvm-stress.cpp
+++ b/llvm/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/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 3ce33fd729e..a3f16f2538c 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/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/llvm/tools/opt/NewPMDriver.h b/llvm/tools/opt/NewPMDriver.h
index 88184f1aabc..e5490deaeaf 100644
--- a/llvm/tools/opt/NewPMDriver.h
+++ b/llvm/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/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 4c7d090097a..fd851f240a4 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/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/llvm/tools/yaml2obj/yaml2obj.cpp b/llvm/tools/yaml2obj/yaml2obj.cpp
index ead4b7a86b2..3e2a5ca7ae0 100644
--- a/llvm/tools/yaml2obj/yaml2obj.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud