forked from OSchip/llvm-project
[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. llvm-svn: 314050
This commit is contained in:
parent
8e30a1c607
commit
3fc649cb76
|
@ -25,7 +25,7 @@
|
|||
// to modularize. It then calls a writeModuleMap function to set up the
|
||||
// module map file output and walk the module tree, outputting the module
|
||||
// map file using a stream obtained and managed by an
|
||||
// llvm::tool_output_file object.
|
||||
// llvm::ToolOutputFile object.
|
||||
//
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
|
@ -271,7 +271,7 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath,
|
|||
|
||||
// Set up module map output file.
|
||||
std::error_code EC;
|
||||
llvm::tool_output_file Out(FilePath, EC, llvm::sys::fs::F_Text);
|
||||
llvm::ToolOutputFile Out(FilePath, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
llvm::errs() << Argv0 << ": error opening " << FilePath << ":"
|
||||
<< EC.message() << "\n";
|
||||
|
@ -289,7 +289,7 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath,
|
|||
if (!RootModule->output(OS, 0))
|
||||
return false;
|
||||
|
||||
// Tell tool_output_file that we want to keep the file.
|
||||
// Tell ToolOutputFile that we want to keep the file.
|
||||
Out.keep();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -215,7 +215,7 @@ int main(int Argc, const char **Argv) {
|
|||
} else {
|
||||
// Set up output file.
|
||||
std::error_code EC;
|
||||
llvm::tool_output_file Out(OutputFileName, EC, llvm::sys::fs::F_Text);
|
||||
llvm::ToolOutputFile Out(OutputFileName, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
llvm::errs() << "pp-trace: error creating " << OutputFileName << ":"
|
||||
<< EC.message() << "\n";
|
||||
|
@ -224,7 +224,7 @@ int main(int Argc, const char **Argv) {
|
|||
|
||||
HadErrors = outputPPTrace(CallbackCalls, Out.os());
|
||||
|
||||
// Tell tool_output_file that we want to keep the file.
|
||||
// Tell ToolOutputFile that we want to keep the file.
|
||||
if (HadErrors == 0)
|
||||
Out.keep();
|
||||
}
|
||||
|
|
|
@ -265,12 +265,11 @@ namespace clang {
|
|||
Ctx.setDiagnosticsHotnessThreshold(
|
||||
CodeGenOpts.DiagnosticsHotnessThreshold);
|
||||
|
||||
std::unique_ptr<llvm::tool_output_file> OptRecordFile;
|
||||
std::unique_ptr<llvm::ToolOutputFile> OptRecordFile;
|
||||
if (!CodeGenOpts.OptRecordFile.empty()) {
|
||||
std::error_code EC;
|
||||
OptRecordFile =
|
||||
llvm::make_unique<llvm::tool_output_file>(CodeGenOpts.OptRecordFile,
|
||||
EC, sys::fs::F_None);
|
||||
OptRecordFile = llvm::make_unique<llvm::ToolOutputFile>(
|
||||
CodeGenOpts.OptRecordFile, EC, sys::fs::F_None);
|
||||
if (EC) {
|
||||
Diags.Report(diag::err_cannot_open_file) <<
|
||||
CodeGenOpts.OptRecordFile << EC.message();
|
||||
|
|
|
@ -84,8 +84,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';
|
||||
exit(1);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ static void exportScop(Scop &S) {
|
|||
|
||||
// Write to file.
|
||||
std::error_code EC;
|
||||
tool_output_file F(FileName, EC, llvm::sys::fs::F_Text);
|
||||
ToolOutputFile F(FileName, EC, llvm::sys::fs::F_Text);
|
||||
|
||||
std::string FunctionName = S.getFunction().getName();
|
||||
errs() << "Writing JScop '" << S.getNameStr() << "' in function '"
|
||||
|
|
|
@ -65,9 +65,9 @@ public:
|
|||
}
|
||||
DEBUG(dbgs() << "Dumping module to " << Dumpfile << '\n');
|
||||
|
||||
std::unique_ptr<tool_output_file> Out;
|
||||
std::unique_ptr<ToolOutputFile> Out;
|
||||
std::error_code EC;
|
||||
Out.reset(new tool_output_file(Dumpfile, EC, sys::fs::F_None));
|
||||
Out.reset(new ToolOutputFile(Dumpfile, EC, sys::fs::F_None));
|
||||
if (EC) {
|
||||
errs() << EC.message() << '\n';
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue