Skip to content

Commit 3fc649c

Browse files
committed
[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
1 parent 8e30a1c commit 3fc649c

File tree

34 files changed

+88
-91
lines changed

34 files changed

+88
-91
lines changed

clang-tools-extra/modularize/ModuleAssistant.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// to modularize. It then calls a writeModuleMap function to set up the
2626
// module map file output and walk the module tree, outputting the module
2727
// map file using a stream obtained and managed by an
28-
// llvm::tool_output_file object.
28+
// llvm::ToolOutputFile object.
2929
//
3030
//===---------------------------------------------------------------------===//
3131

@@ -271,7 +271,7 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath,
271271

272272
// Set up module map output file.
273273
std::error_code EC;
274-
llvm::tool_output_file Out(FilePath, EC, llvm::sys::fs::F_Text);
274+
llvm::ToolOutputFile Out(FilePath, EC, llvm::sys::fs::F_Text);
275275
if (EC) {
276276
llvm::errs() << Argv0 << ": error opening " << FilePath << ":"
277277
<< EC.message() << "\n";
@@ -289,7 +289,7 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath,
289289
if (!RootModule->output(OS, 0))
290290
return false;
291291

292-
// Tell tool_output_file that we want to keep the file.
292+
// Tell ToolOutputFile that we want to keep the file.
293293
Out.keep();
294294

295295
return true;

clang-tools-extra/pp-trace/PPTrace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ int main(int Argc, const char **Argv) {
215215
} else {
216216
// Set up output file.
217217
std::error_code EC;
218-
llvm::tool_output_file Out(OutputFileName, EC, llvm::sys::fs::F_Text);
218+
llvm::ToolOutputFile Out(OutputFileName, EC, llvm::sys::fs::F_Text);
219219
if (EC) {
220220
llvm::errs() << "pp-trace: error creating " << OutputFileName << ":"
221221
<< EC.message() << "\n";
@@ -224,7 +224,7 @@ int main(int Argc, const char **Argv) {
224224

225225
HadErrors = outputPPTrace(CallbackCalls, Out.os());
226226

227-
// Tell tool_output_file that we want to keep the file.
227+
// Tell ToolOutputFile that we want to keep the file.
228228
if (HadErrors == 0)
229229
Out.keep();
230230
}

clang/lib/CodeGen/CodeGenAction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,11 @@ namespace clang {
265265
Ctx.setDiagnosticsHotnessThreshold(
266266
CodeGenOpts.DiagnosticsHotnessThreshold);
267267

268-
std::unique_ptr<llvm::tool_output_file> OptRecordFile;
268+
std::unique_ptr<llvm::ToolOutputFile> OptRecordFile;
269269
if (!CodeGenOpts.OptRecordFile.empty()) {
270270
std::error_code EC;
271-
OptRecordFile =
272-
llvm::make_unique<llvm::tool_output_file>(CodeGenOpts.OptRecordFile,
273-
EC, sys::fs::F_None);
271+
OptRecordFile = llvm::make_unique<llvm::ToolOutputFile>(
272+
CodeGenOpts.OptRecordFile, EC, sys::fs::F_None);
274273
if (EC) {
275274
Diags.Report(diag::err_cannot_open_file) <<
276275
CodeGenOpts.OptRecordFile << EC.message();

libclc/utils/prepare-builtins.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ int main(int argc, char **argv) {
8484
}
8585

8686
std::error_code EC;
87-
std::unique_ptr<tool_output_file> Out
88-
(new tool_output_file(OutputFilename, EC, sys::fs::F_None));
87+
std::unique_ptr<ToolOutputFile> Out(
88+
new ToolOutputFile(OutputFilename, EC, sys::fs::F_None));
8989
if (EC) {
9090
errs() << EC.message() << '\n';
9191
exit(1);

llvm/include/llvm/LTO/LTO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ std::string getThinLTOOutputFile(const std::string &Path,
7171
const std::string &NewPrefix);
7272

7373
/// Setup optimization remarks.
74-
Expected<std::unique_ptr<tool_output_file>>
74+
Expected<std::unique_ptr<ToolOutputFile>>
7575
setupOptimizationRemarks(LLVMContext &Context, StringRef LTORemarksFilename,
7676
bool LTOPassRemarksWithHotness, int Count = -1);
7777

llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ struct LTOCodeGenerator {
237237
bool ShouldEmbedUselists = false;
238238
bool ShouldRestoreGlobalsLinkage = false;
239239
TargetMachine::CodeGenFileType FileType = TargetMachine::CGFT_ObjectFile;
240-
std::unique_ptr<tool_output_file> DiagnosticOutputFile;
240+
std::unique_ptr<ToolOutputFile> DiagnosticOutputFile;
241241
bool Freestanding = false;
242242
};
243243
}

llvm/include/llvm/Support/ToolOutputFile.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
//===----------------------------------------------------------------------===//
99
//
10-
// This file defines the tool_output_file class.
10+
// This file defines the ToolOutputFile class.
1111
//
1212
//===----------------------------------------------------------------------===//
1313

@@ -21,9 +21,9 @@ namespace llvm {
2121
/// This class contains a raw_fd_ostream and adds a few extra features commonly
2222
/// needed for compiler-like tool output files:
2323
/// - The file is automatically deleted if the process is killed.
24-
/// - The file is automatically deleted when the tool_output_file
24+
/// - The file is automatically deleted when the ToolOutputFile
2525
/// object is destroyed unless the client calls keep().
26-
class tool_output_file {
26+
class ToolOutputFile {
2727
/// This class is declared before the raw_fd_ostream so that it is constructed
2828
/// before the raw_fd_ostream is constructed and destructed after the
2929
/// raw_fd_ostream is destructed. It installs cleanups in its constructor and
@@ -45,10 +45,10 @@ class tool_output_file {
4545
public:
4646
/// This constructor's arguments are passed to to raw_fd_ostream's
4747
/// constructor.
48-
tool_output_file(StringRef Filename, std::error_code &EC,
49-
sys::fs::OpenFlags Flags);
48+
ToolOutputFile(StringRef Filename, std::error_code &EC,
49+
sys::fs::OpenFlags Flags);
5050

51-
tool_output_file(StringRef Filename, int FD);
51+
ToolOutputFile(StringRef Filename, int FD);
5252

5353
/// Return the contained raw_fd_ostream.
5454
raw_fd_ostream &os() { return OS; }

llvm/lib/LTO/LTO.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
11661166
return BackendProc->wait();
11671167
}
11681168

1169-
Expected<std::unique_ptr<tool_output_file>>
1169+
Expected<std::unique_ptr<ToolOutputFile>>
11701170
lto::setupOptimizationRemarks(LLVMContext &Context,
11711171
StringRef LTORemarksFilename,
11721172
bool LTOPassRemarksWithHotness, int Count) {
@@ -1179,7 +1179,7 @@ lto::setupOptimizationRemarks(LLVMContext &Context,
11791179

11801180
std::error_code EC;
11811181
auto DiagnosticFile =
1182-
llvm::make_unique<tool_output_file>(Filename, EC, sys::fs::F_None);
1182+
llvm::make_unique<ToolOutputFile>(Filename, EC, sys::fs::F_None);
11831183
if (EC)
11841184
return errorCodeToError(EC);
11851185
Context.setDiagnosticsOutputFile(

llvm/lib/LTO/LTOBackend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ Expected<const Target *> initAndLookupTarget(Config &C, Module &Mod) {
349349
}
350350

351351
static void
352-
finalizeOptimizationRemarks(std::unique_ptr<tool_output_file> DiagOutputFile) {
352+
finalizeOptimizationRemarks(std::unique_ptr<ToolOutputFile> DiagOutputFile) {
353353
// Make sure we flush the diagnostic remarks file in case the linker doesn't
354354
// call the global destructors before exiting.
355355
if (!DiagOutputFile)

llvm/lib/LTO/LTOCodeGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ bool LTOCodeGenerator::writeMergedModules(StringRef Path) {
225225

226226
// create output file
227227
std::error_code EC;
228-
tool_output_file Out(Path, EC, sys::fs::F_None);
228+
ToolOutputFile Out(Path, EC, sys::fs::F_None);
229229
if (EC) {
230230
std::string ErrMsg = "could not open bitcode file for writing: ";
231231
ErrMsg += Path;
@@ -265,7 +265,7 @@ bool LTOCodeGenerator::compileOptimizedToFile(const char **Name) {
265265
}
266266

267267
// generate object file
268-
tool_output_file objFile(Filename, FD);
268+
ToolOutputFile objFile(Filename, FD);
269269

270270
bool genResult = compileOptimized(&objFile.os());
271271
objFile.os().close();

0 commit comments

Comments
 (0)