diff options
author | Fangrui Song <maskray@google.com> | 2019-08-05 05:43:48 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-08-05 05:43:48 +0000 |
commit | d9b948b6eb7362f36264b71795dab179906e36be (patch) | |
tree | 35f79bbd28bc13b6b4b5e07ffece5d0388964b47 | |
parent | 1e4f2792faf1c14a6cfdbac3c6101b5faec5fbac (diff) | |
download | bcm5719-llvm-d9b948b6eb7362f36264b71795dab179906e36be.tar.gz bcm5719-llvm-d9b948b6eb7362f36264b71795dab179906e36be.zip |
Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC
F_{None,Text,Append} are kept for compatibility since r334221.
llvm-svn: 367800
120 files changed, 178 insertions, 174 deletions
diff --git a/clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp b/clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp index ffd1e65c790..021a90fab29 100644 --- a/clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp +++ b/clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp @@ -152,7 +152,7 @@ int main(int argc, char **argv) { // Write new file to disk std::error_code EC; - llvm::raw_fd_ostream FileStream(FileName, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream FileStream(FileName, EC, llvm::sys::fs::OF_None); if (EC) { llvm::errs() << "Could not open " << FileName << " for writing\n"; continue; diff --git a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp index c0bc5bc27bb..4ca488b0d0a 100644 --- a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp +++ b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp @@ -269,7 +269,8 @@ int main(int argc, const char **argv) { return 1; } std::error_code FileErr; - llvm::raw_fd_ostream InfoOS(InfoPath.get(), FileErr, llvm::sys::fs::F_None); + llvm::raw_fd_ostream InfoOS(InfoPath.get(), FileErr, + llvm::sys::fs::OF_None); if (FileErr != OK) { llvm::errs() << "Error opening info file: " << FileErr.message() << "\n"; continue; diff --git a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp index dbbe0738d03..c025a67198b 100644 --- a/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp +++ b/clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp @@ -114,7 +114,7 @@ bool Merge(llvm::StringRef MergeDir, llvm::StringRef OutputFile) { } } - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_None); if (EC) { llvm::errs() << "Can't open '" << OutputFile << "': " << EC.message() << '\n'; diff --git a/clang-tools-extra/clang-move/tool/ClangMove.cpp b/clang-tools-extra/clang-move/tool/ClangMove.cpp index 3b0d15f6535..2df7df7fe3a 100644 --- a/clang-tools-extra/clang-move/tool/ClangMove.cpp +++ b/clang-tools-extra/clang-move/tool/ClangMove.cpp @@ -30,7 +30,7 @@ namespace { std::error_code CreateNewFile(const llvm::Twine &path) { int fd = 0; if (std::error_code ec = llvm::sys::fs::openFileForWrite( - path, fd, llvm::sys::fs::CD_CreateAlways, llvm::sys::fs::F_Text)) + path, fd, llvm::sys::fs::CD_CreateAlways, llvm::sys::fs::OF_Text)) return ec; return llvm::sys::Process::SafelyCloseFileDescriptor(fd); diff --git a/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp b/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp index 63eed22708a..e60332d599a 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp @@ -66,7 +66,7 @@ void ClangTidyProfiling::storeProfileData() { } std::error_code EC; - llvm::raw_fd_ostream OS(Storage->StoreFilename, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(Storage->StoreFilename, EC, llvm::sys::fs::OF_None); if (EC) { llvm::errs() << "Error opening output file '" << Storage->StoreFilename << "': " << EC.message() << "\n"; diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index 2b2d5ac0e2d..07bf27b59d2 100644 --- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp +++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp @@ -443,7 +443,7 @@ static int clangTidyMain(int argc, const char **argv) { if (!ExportFixes.empty() && !Errors.empty()) { std::error_code EC; - llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::OF_None); if (EC) { llvm::errs() << "Error opening output file: " << EC.message() << '\n'; return 1; diff --git a/clang-tools-extra/modularize/ModuleAssistant.cpp b/clang-tools-extra/modularize/ModuleAssistant.cpp index c34308c2411..0cd7e9f0731 100644 --- a/clang-tools-extra/modularize/ModuleAssistant.cpp +++ b/clang-tools-extra/modularize/ModuleAssistant.cpp @@ -268,7 +268,7 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath, // Set up module map output file. std::error_code EC; - llvm::ToolOutputFile Out(FilePath, EC, llvm::sys::fs::F_Text); + llvm::ToolOutputFile Out(FilePath, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << Argv0 << ": error opening " << FilePath << ":" << EC.message() << "\n"; diff --git a/clang-tools-extra/pp-trace/PPTrace.cpp b/clang-tools-extra/pp-trace/PPTrace.cpp index 5155a8b243d..67fe60bd246 100644 --- a/clang-tools-extra/pp-trace/PPTrace.cpp +++ b/clang-tools-extra/pp-trace/PPTrace.cpp @@ -149,7 +149,7 @@ int main(int argc, const char **argv) { OptionsParser->getSourcePathList()); std::error_code EC; - llvm::ToolOutputFile Out(OutputFileName, EC, llvm::sys::fs::F_Text); + llvm::ToolOutputFile Out(OutputFileName, EC, llvm::sys::fs::OF_Text); if (EC) error(EC.message()); PPTraceFrontendActionFactory Factory(Filters, Out.os()); diff --git a/clang/lib/ARCMigrate/FileRemapper.cpp b/clang/lib/ARCMigrate/FileRemapper.cpp index 70b32dc0117..a031fe22ac1 100644 --- a/clang/lib/ARCMigrate/FileRemapper.cpp +++ b/clang/lib/ARCMigrate/FileRemapper.cpp @@ -121,7 +121,7 @@ bool FileRemapper::flushToFile(StringRef outputPath, DiagnosticsEngine &Diag) { std::error_code EC; std::string infoFile = outputPath; - llvm::raw_fd_ostream infoOut(infoFile, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream infoOut(infoFile, EC, llvm::sys::fs::OF_None); if (EC) return report(EC.message(), Diag); @@ -177,7 +177,7 @@ bool FileRemapper::overwriteOriginal(DiagnosticsEngine &Diag, Diag); std::error_code EC; - llvm::raw_fd_ostream Out(origFE->getName(), EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Out(origFE->getName(), EC, llvm::sys::fs::OF_None); if (EC) return report(EC.message(), Diag); diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index fbf2a1560af..b0ffdda8b2f 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -1951,7 +1951,7 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { if (IsOutputFile) { std::error_code EC; - llvm::raw_fd_ostream OS(MigrateDir, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(MigrateDir, EC, llvm::sys::fs::OF_None); if (EC) { DiagnosticsEngine &Diags = Ctx.getDiagnostics(); Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0")) diff --git a/clang/lib/ARCMigrate/PlistReporter.cpp b/clang/lib/ARCMigrate/PlistReporter.cpp index 6d7fcb053b4..d01563b2974 100644 --- a/clang/lib/ARCMigrate/PlistReporter.cpp +++ b/clang/lib/ARCMigrate/PlistReporter.cpp @@ -56,7 +56,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath, } std::error_code EC; - llvm::raw_fd_ostream o(outPath, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream o(outPath, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << "error: could not create file: " << outPath << '\n'; return; diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 84552e27a4c..60ce5174a12 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -119,7 +119,7 @@ class EmitAssemblyHelper { std::unique_ptr<llvm::ToolOutputFile> openOutputFile(StringRef Path) { std::error_code EC; auto F = llvm::make_unique<llvm::ToolOutputFile>(Path, EC, - llvm::sys::fs::F_None); + llvm::sys::fs::OF_None); if (EC) { Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message(); F.reset(); diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index 5f3026e6ce5..ba188f5c408 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -161,7 +161,7 @@ int Compilation::ExecuteCommand(const Command &C, std::error_code EC; OwnedStream.reset(new llvm::raw_fd_ostream( getDriver().CCPrintOptionsFilename, EC, - llvm::sys::fs::F_Append | llvm::sys::fs::F_Text)); + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text)); if (EC) { getDriver().Diag(diag::err_drv_cc_print_options_failure) << EC.message(); diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 60062d5c327..4681e013893 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -1995,7 +1995,8 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename, if (!CompilationDatabase) { std::error_code EC; - auto File = llvm::make_unique<llvm::raw_fd_ostream>(Filename, EC, llvm::sys::fs::F_Text); + auto File = llvm::make_unique<llvm::raw_fd_ostream>(Filename, EC, + llvm::sys::fs::OF_Text); if (EC) { D.Diag(clang::diag::err_drv_compilationdatabase) << Filename << EC.message(); diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp index f13e7b9781d..93b823b72e8 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -1350,7 +1350,7 @@ void tools::AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C, // Open script file and write the contents. std::error_code EC; - llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::OF_None); if (EC) { C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message(); @@ -1458,7 +1458,7 @@ void tools::AddHIPLinkerScript(const ToolChain &TC, Compilation &C, // Open script file and write the contents. std::error_code EC; - llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::OF_None); if (EC) { C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message(); diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 93715d831e6..a556f4e0df1 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -216,7 +216,7 @@ static void SetUpDiagnosticLog(DiagnosticOptions *DiagOpts, // Create the output stream. auto FileOS = llvm::make_unique<llvm::raw_fd_ostream>( DiagOpts->DiagnosticLogFile, EC, - llvm::sys::fs::F_Append | llvm::sys::fs::F_Text); + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text); if (EC) { Diags.Report(diag::warn_fe_cc_log_diagnostics_failure) << DiagOpts->DiagnosticLogFile << EC.message(); @@ -775,7 +775,7 @@ std::unique_ptr<llvm::raw_pwrite_stream> CompilerInstance::createOutputFile( OSFile = OutFile; OS.reset(new llvm::raw_fd_ostream( OSFile, Error, - (Binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text))); + (Binary ? llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text))); if (Error) return nullptr; } @@ -987,8 +987,8 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { StringRef StatsFile = getFrontendOpts().StatsFile; if (!StatsFile.empty()) { std::error_code EC; - auto StatS = llvm::make_unique<llvm::raw_fd_ostream>(StatsFile, EC, - llvm::sys::fs::F_Text); + auto StatS = llvm::make_unique<llvm::raw_fd_ostream>( + StatsFile, EC, llvm::sys::fs::OF_Text); if (EC) { getDiagnostics().Report(diag::warn_fe_unable_to_open_stats_file) << StatsFile << EC.message(); @@ -1370,7 +1370,7 @@ static void checkConfigMacro(Preprocessor &PP, StringRef ConfigMacro, /// Write a new timestamp file with the given path. static void writeTimestampFile(StringRef TimestampFile) { std::error_code EC; - llvm::raw_fd_ostream Out(TimestampFile.str(), EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream Out(TimestampFile.str(), EC, llvm::sys::fs::OF_None); } /// Prune the module cache of modules that haven't been accessed in diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index 375eb91ae36..152fe0360f5 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/lib/Frontend/DependencyFile.cpp @@ -316,7 +316,7 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) { } std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { Diags.Report(diag::err_fe_error_opening) << OutputFile << EC.message(); return; diff --git a/clang/lib/Frontend/DependencyGraph.cpp b/clang/lib/Frontend/DependencyGraph.cpp index 90624323a00..a123f1c6897 100644 --- a/clang/lib/Frontend/DependencyGraph.cpp +++ b/clang/lib/Frontend/DependencyGraph.cpp @@ -100,7 +100,7 @@ DependencyGraphCallback::writeNodeReference(raw_ostream &OS, void DependencyGraphCallback::OutputGraphFile() { std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { PP->getDiagnostics().Report(diag::err_fe_error_opening) << OutputFile << EC.message(); diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index e37afae5332..1bea322cedc 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -695,7 +695,7 @@ void DumpModuleInfoAction::ExecuteAction() { if (!OutputFileName.empty() && OutputFileName != "-") { std::error_code EC; OutFile.reset(new llvm::raw_fd_ostream(OutputFileName.str(), EC, - llvm::sys::fs::F_Text)); + llvm::sys::fs::OF_Text)); } llvm::raw_ostream &Out = OutFile.get()? *OutFile.get() : llvm::outs(); diff --git a/clang/lib/Frontend/HeaderIncludeGen.cpp b/clang/lib/Frontend/HeaderIncludeGen.cpp index d60f5333bf5..821a7e2cd91 100644 --- a/clang/lib/Frontend/HeaderIncludeGen.cpp +++ b/clang/lib/Frontend/HeaderIncludeGen.cpp @@ -100,7 +100,8 @@ void clang::AttachHeaderIncludeGen(Preprocessor &PP, if (!OutputPath.empty()) { std::error_code EC; llvm::raw_fd_ostream *OS = new llvm::raw_fd_ostream( - OutputPath.str(), EC, llvm::sys::fs::F_Append | llvm::sys::fs::F_Text); + OutputPath.str(), EC, + llvm::sys::fs::OF_Append | llvm::sys::fs::OF_Text); if (EC) { PP.getDiagnostics().Report(clang::diag::warn_fe_cc_print_header_failure) << EC.message(); diff --git a/clang/lib/Frontend/ModuleDependencyCollector.cpp b/clang/lib/Frontend/ModuleDependencyCollector.cpp index c1d8c0d9eb2..4398d5f36a4 100644 --- a/clang/lib/Frontend/ModuleDependencyCollector.cpp +++ b/clang/lib/Frontend/ModuleDependencyCollector.cpp @@ -148,7 +148,7 @@ void ModuleDependencyCollector::writeFileMap() { std::error_code EC; SmallString<256> YAMLPath = VFSDir; llvm::sys::path::append(YAMLPath, "vfs.yaml"); - llvm::raw_fd_ostream OS(YAMLPath, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(YAMLPath, EC, llvm::sys::fs::OF_Text); if (EC) { HasErrors = true; return; diff --git a/clang/lib/Frontend/Rewrite/FixItRewriter.cpp b/clang/lib/Frontend/Rewrite/FixItRewriter.cpp index 667b9f0469f..0217b3385a5 100644 --- a/clang/lib/Frontend/Rewrite/FixItRewriter.cpp +++ b/clang/lib/Frontend/Rewrite/FixItRewriter.cpp @@ -101,7 +101,7 @@ bool FixItRewriter::WriteFixedFiles( if (fd != -1) { OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true)); } else { - OS.reset(new llvm::raw_fd_ostream(Filename, EC, llvm::sys::fs::F_None)); + OS.reset(new llvm::raw_fd_ostream(Filename, EC, llvm::sys::fs::OF_None)); } if (EC) { Diags.Report(clang::diag::err_fe_unable_to_open_output) << Filename diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp index c1434a95cc7..0732d63dfe4 100644 --- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -781,7 +781,7 @@ void SDiagsWriter::finish() { std::error_code EC; auto OS = llvm::make_unique<llvm::raw_fd_ostream>(State->OutputFile.c_str(), - EC, llvm::sys::fs::F_None); + EC, llvm::sys::fs::OF_None); if (EC) { getMetaDiags()->Report(diag::warn_fe_serialized_diag_failure) << State->OutputFile << EC.message(); diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index e1b08dbc1ac..4b6775de055 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -4042,7 +4042,7 @@ static void updateModuleTimestamp(ModuleFile &MF) { // Overwrite the timestamp file contents so that file's mtime changes. std::string TimestampFilename = MF.getTimestampFilename(); std::error_code EC; - llvm::raw_fd_ostream OS(TimestampFilename, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(TimestampFilename, EC, llvm::sys::fs::OF_Text); if (EC) return; OS << "Timestamp file\n"; diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index 15b8e0c41c3..d79d91679ad 100644 --- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -599,7 +599,7 @@ void PlistDiagnostics::FlushDiagnosticsImpl( // Open the file. std::error_code EC; - llvm::raw_fd_ostream o(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream o(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << "warning: could not create file: " << EC.message() << '\n'; return; diff --git a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp index fd6d5010db5..f4e85b3fa8f 100644 --- a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp @@ -335,7 +335,7 @@ void SarifDiagnostics::FlushDiagnosticsImpl( // file can become large very quickly, so decoding into JSON to append a run // may be an expensive operation. std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << "warning: could not create file: " << EC.message() << '\n'; return; diff --git a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp index 0c628963a29..2a31f673a07 100644 --- a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp +++ b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp @@ -559,7 +559,7 @@ public: // Write the bitcode contents to the temporary file. { std::error_code EC; - raw_fd_ostream BitcodeFile(BitcodeFileName, EC, sys::fs::F_None); + raw_fd_ostream BitcodeFile(BitcodeFileName, EC, sys::fs::OF_None); if (EC) { errs() << "error: unable to open temporary file.\n"; return true; @@ -764,7 +764,7 @@ static bool BundleFiles() { std::error_code EC; // Create output file. - raw_fd_ostream OutputFile(OutputFileNames.front(), EC, sys::fs::F_None); + raw_fd_ostream OutputFile(OutputFileNames.front(), EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << OutputFileNames.front() << ".\n"; @@ -862,7 +862,7 @@ static bool UnbundleFiles() { // Check if the output file can be opened and copy the bundle to it. std::error_code EC; - raw_fd_ostream OutputFile(Output->second, EC, sys::fs::F_None); + raw_fd_ostream OutputFile(Output->second, EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << Output->second << ": " << EC.message() << "\n"; @@ -882,7 +882,7 @@ static bool UnbundleFiles() { if (Worklist.size() == TargetNames.size()) { for (auto &E : Worklist) { std::error_code EC; - raw_fd_ostream OutputFile(E.second, EC, sys::fs::F_None); + raw_fd_ostream OutputFile(E.second, EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << E.second << ": " << EC.message() << "\n"; @@ -905,7 +905,7 @@ static bool UnbundleFiles() { // If we still have any elements in the worklist, create empty files for them. for (auto &E : Worklist) { std::error_code EC; - raw_fd_ostream OutputFile(E.second, EC, sys::fs::F_None); + raw_fd_ostream OutputFile(E.second, EC, sys::fs::OF_None); if (EC) { errs() << "error: Can't open file " << E.second << ": " << EC.message() << "\n"; diff --git a/clang/tools/clang-refactor/ClangRefactor.cpp b/clang/tools/clang-refactor/ClangRefactor.cpp index 68a5cce8db5..2e4c6480a1e 100644 --- a/clang/tools/clang-refactor/ClangRefactor.cpp +++ b/clang/tools/clang-refactor/ClangRefactor.cpp @@ -497,7 +497,7 @@ public: if (opts::Inplace) { std::error_code EC; - llvm::raw_fd_ostream OS(File, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(File, EC, llvm::sys::fs::OF_Text); if (EC) { llvm::errs() << EC.message() << "\n"; return true; diff --git a/clang/tools/clang-rename/ClangRename.cpp b/clang/tools/clang-rename/ClangRename.cpp index 613885bf759..6dcd33aeb16 100644 --- a/clang/tools/clang-rename/ClangRename.cpp +++ b/clang/tools/clang-rename/ClangRename.cpp @@ -188,7 +188,7 @@ int main(int argc, const char **argv) { if (!ExportFixes.empty()) { std::error_code EC; - llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream OS(ExportFixes, EC, llvm::sys::fs::OF_None); if (EC) { llvm::errs() << "Error opening output file: " << EC.message() << '\n'; return 1; diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index a2902b6aa92..390cabff021 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -313,7 +313,7 @@ getOutputStream(StringRef Path, DiagnosticsEngine &Diags, bool Binary) { std::error_code EC; auto Out = llvm::make_unique<raw_fd_ostream>( - Path, EC, (Binary ? sys::fs::F_None : sys::fs::F_Text)); + Path, EC, (Binary ? sys::fs::OF_None : sys::fs::OF_Text)); if (EC) { Diags.Report(diag::err_fe_unable_to_open_output) << Path << EC.message(); return nullptr; diff --git a/libclc/utils/prepare-builtins.cpp b/libclc/utils/prepare-builtins.cpp index de1e804d6fc..550b5971913 100644 --- a/libclc/utils/prepare-builtins.cpp +++ b/libclc/utils/prepare-builtins.cpp @@ -95,10 +95,10 @@ int main(int argc, char **argv) { std::error_code EC; #if HAVE_LLVM >= 0x0600 std::unique_ptr<ToolOutputFile> Out( - new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); #else std::unique_ptr<tool_output_file> Out( - new tool_output_file(OutputFilename, EC, sys::fs::F_None)); + new tool_output_file(OutputFilename, EC, sys::fs::OF_None)); #endif if (EC) { errs() << EC.message() << '\n'; diff --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp index 4360ac23b26..6167520e589 100644 --- a/lld/COFF/DriverUtils.cpp +++ b/lld/COFF/DriverUtils.cpp @@ -322,7 +322,7 @@ public: if (!contents.empty()) { std::error_code ec; - raw_fd_ostream os(path, ec, sys::fs::F_None); + raw_fd_ostream os(path, ec, sys::fs::OF_None); if (ec) fatal("failed to open " + path + ": " + ec.message()); os << contents; @@ -410,7 +410,7 @@ static std::string createManifestXmlWithExternalMt(StringRef defaultXml) { // Create the default manifest file as a temporary file. TemporaryFile Default("defaultxml", "manifest"); std::error_code ec; - raw_fd_ostream os(Default.path, ec, sys::fs::F_Text); + raw_fd_ostream os(Default.path, ec, sys::fs::OF_Text); if (ec) fatal("failed to open " + Default.path + ": " + ec.message()); os << defaultXml; @@ -511,7 +511,7 @@ void createSideBySideManifest() { if (path == "") path = config->outputFile + ".manifest"; std::error_code ec; - raw_fd_ostream out(path, ec, sys::fs::F_Text); + raw_fd_ostream out(path, ec, sys::fs::OF_Text); if (ec) fatal("failed to create manifest: " + ec.message()); out << createManifestXml(); diff --git a/lld/COFF/LTO.cpp b/lld/COFF/LTO.cpp index eb3c60d6607..8e502d0cc9f 100644 --- a/lld/COFF/LTO.cpp +++ b/lld/COFF/LTO.cpp @@ -46,7 +46,7 @@ using namespace lld::coff; static std::unique_ptr<raw_fd_ostream> openFile(StringRef file) { std::error_code ec; auto ret = - llvm::make_unique<raw_fd_ostream>(file, ec, sys::fs::OpenFlags::F_None); + llvm::make_unique<raw_fd_ostream>(file, ec, sys::fs::OpenFlags::OF_None); if (ec) { error("cannot open " + file + ": " + ec.message()); return nullptr; diff --git a/lld/COFF/MapFile.cpp b/lld/COFF/MapFile.cpp index f98cf8fa613..db25cbac980 100644 --- a/lld/COFF/MapFile.cpp +++ b/lld/COFF/MapFile.cpp @@ -92,7 +92,7 @@ void coff::writeMapFile(ArrayRef<OutputSection *> outputSections) { return; std::error_code ec; - raw_fd_ostream os(config->mapFile, ec, sys::fs::F_None); + raw_fd_ostream os(config->mapFile, ec, sys::fs::OF_None); if (ec) fatal("cannot open " + config->mapFile + ": " + ec.message()); diff --git a/lld/COFF/MinGW.cpp b/lld/COFF/MinGW.cpp index 2ca8ca0c058..a22e609148a 100644 --- a/lld/COFF/MinGW.cpp +++ b/lld/COFF/MinGW.cpp @@ -148,7 +148,7 @@ bool AutoExporter::shouldExport(Defined *sym) const { void coff::writeDefFile(StringRef name) { std::error_code ec; - raw_fd_ostream os(name, ec, sys::fs::F_None); + raw_fd_ostream os(name, ec, sys::fs::OF_None); if (ec) fatal("cannot open " + name + ": " + ec.message()); diff --git a/lld/Common/Strings.cpp b/lld/Common/Strings.cpp index 0bf06626cc7..2240f9644e1 100644 --- a/lld/Common/Strings.cpp +++ b/lld/Common/Strings.cpp @@ -96,7 +96,7 @@ bool lld::isValidCIdentifier(StringRef s) { // Write the contents of the a buffer to a file void lld::saveBuffer(StringRef buffer, const Twine &path) { std::error_code ec; - raw_fd_ostream os(path.str(), ec, sys::fs::OpenFlags::F_None); + raw_fd_ostream os(path.str(), ec, sys::fs::OpenFlags::OF_None); if (ec) error("cannot create " + path + ": " + ec.message()); os << buffer; diff --git a/lld/ELF/CallGraphSort.cpp b/lld/ELF/CallGraphSort.cpp index 9aaadd48183..12f89e4f5d3 100644 --- a/lld/ELF/CallGraphSort.cpp +++ b/lld/ELF/CallGraphSort.cpp @@ -227,7 +227,7 @@ DenseMap<const InputSectionBase *, int> CallGraphSort::run() { if (!config->printSymbolOrder.empty()) { std::error_code ec; - raw_fd_ostream os(config->printSymbolOrder, ec, sys::fs::F_None); + raw_fd_ostream os(config->printSymbolOrder, ec, sys::fs::OF_None); if (ec) { error("cannot open " + config->printSymbolOrder + ": " + ec.message()); return orderMap; diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 36880b1b6be..075a4824462 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -50,7 +50,7 @@ using namespace lld::elf; static std::unique_ptr<raw_fd_ostream> openFile(StringRef file) { std::error_code ec; auto ret = - llvm::make_unique<raw_fd_ostream>(file, ec, sys::fs::OpenFlags::F_None); + llvm::make_unique<raw_fd_ostream>(file, ec, sys::fs::OpenFlags::OF_None); if (ec) { error("cannot open " + file + ": " + ec.message()); return nullptr; diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp index a4a6238fc65..869f55c0966 100644 --- a/lld/ELF/MapFile.cpp +++ b/lld/ELF/MapFile.cpp @@ -145,7 +145,7 @@ void elf::writeMapFile() { // Open a map file for writing. std::error_code ec; - raw_fd_ostream os(config->mapFile, ec, sys::fs::F_None); + raw_fd_ostream os(config->mapFile, ec, sys::fs::OF_None); if (ec) { error("cannot open " + config->mapFile + ": " + ec.message()); return; diff --git a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp index 38456024c9f..4cb0c6a8ae0 100644 --- a/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lld/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -897,8 +897,8 @@ static void addDependencyInfoHelper(llvm::raw_fd_ostream *DepInfo, std::error_code MachOLinkingContext::createDependencyFile(StringRef path) { std::error_code ec; - _dependencyInfo = std::unique_ptr<llvm::raw_fd_ostream>(new - llvm::raw_fd_ostream(path, ec, llvm::sys::fs::F_None)); + _dependencyInfo = std::unique_ptr<llvm::raw_fd_ostream>( + new llvm::raw_fd_ostream(path, ec, llvm::sys::fs::OF_None)); if (ec) { _dependencyInfo.reset(); return ec; diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index 5feff2a0514..77936399c1a 100644 --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -1299,7 +1299,7 @@ public: llvm::Error writeFile(const lld::File &file, StringRef outPath) override { // Create stream to path. std::error_code ec; - llvm::raw_fd_ostream out(outPath, ec, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream out(outPath, ec, llvm::sys::fs::OF_Text); if (ec) return llvm::errorCodeToError(ec); diff --git a/lldb/include/lldb/Utility/Reproducer.h b/lldb/include/lldb/Utility/Reproducer.h index 37f47208624..27a3cce864c 100644 --- a/lldb/include/lldb/Utility/Reproducer.h +++ b/lldb/include/lldb/Utility/Reproducer.h @@ -137,7 +137,7 @@ class DataRecorder { public: DataRecorder(const FileSpec &filename, std::error_code &ec) : m_filename(filename.GetFilename().GetStringRef()), - m_os(filename.GetPath(), ec, llvm::sys::fs::F_Text), m_record(true) {} + m_os(filename.GetPath(), ec, llvm::sys::fs::OF_Text), m_record(true) {} static llvm::Expected<std::unique_ptr<DataRecorder>> Create(const FileSpec &filename); diff --git a/lldb/source/API/SBReproducerPrivate.h b/lldb/source/API/SBReproducerPrivate.h index 84b6ce967c0..edd06941398 100644 --- a/lldb/source/API/SBReproducerPrivate.h +++ b/lldb/source/API/SBReproducerPrivate.h @@ -40,7 +40,7 @@ public: SBProvider(const FileSpec &directory) : Provider(directory), m_stream(directory.CopyByAppendingPathComponent("sbapi.bin").GetPath(), - m_ec, llvm::sys::fs::OpenFlags::F_None), + m_ec, llvm::sys::fs::OpenFlags::OF_None), m_serializer(m_stream) {} Serializer &GetSerializer() { return m_serializer; } diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 83c91b84aee..a7c8f65655d 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1200,9 +1200,9 @@ bool Debugger::EnableLog(llvm::StringRef channel, if (pos != m_log_streams.end()) log_stream_sp = pos->second.lock(); if (!log_stream_sp) { - llvm::sys::fs::OpenFlags flags = llvm::sys::fs::F_Text; + llvm::sys::fs::OpenFlags flags = llvm::sys::fs::OF_Text; if (log_options & LLDB_LOG_OPTION_APPEND) - flags |= llvm::sys::fs::F_Append; + flags |= llvm::sys::fs::OF_Append; int FD; if (std::error_code ec = llvm::sys::fs::openFileForWrite( log_file, FD, llvm::sys::fs::CD_CreateAlways, flags)) { diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp index e99018d88cb..a5a27a8600d 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -405,7 +405,7 @@ Status AdbClient::ShellToFile(const char *command, milliseconds timeout, const auto output_filename = output_file_spec.GetPath(); std::error_code EC; - llvm::raw_fd_ostream dst(output_filename, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream dst(output_filename, EC, llvm::sys::fs::OF_None); if (EC) return Status("Unable to open local file %s", output_filename.c_str()); @@ -432,7 +432,7 @@ Status AdbClient::SyncService::internalPullFile(const FileSpec &remote_file, llvm::FileRemover local_file_remover(local_file_path); std::error_code EC; - llvm::raw_fd_ostream dst(local_file_path, EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream dst(local_file_path, EC, llvm::sys::fs::OF_None); if (EC) return Status("Unable to open local file %s", local_file_path.c_str()); diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index cd59fc1179b..6b07064a78a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -179,8 +179,8 @@ public: FileSpec history_file = GetRoot().CopyByAppendingPathComponent(Info::file); std::error_code EC; - m_stream_up = llvm::make_unique<raw_fd_ostream>(history_file.GetPath(), EC, - sys::fs::OpenFlags::F_Text); + m_stream_up = llvm::make_unique<raw_fd_ostream>( + history_file.GetPath(), EC, sys::fs::OpenFlags::OF_Text); return m_stream_up.get(); } diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index c4089625ce0..3fb857075ca 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1628,7 +1628,7 @@ Status Platform::DownloadModuleSlice(const FileSpec &src_file_spec, Status error; std::error_code EC; - llvm::raw_fd_ostream dst(dst_file_spec.GetPath(), EC, llvm::sys::fs::F_None); + llvm::raw_fd_ostream dst(dst_file_spec.GetPath(), EC, llvm::sys::fs::OF_None); if (EC) { error.SetErrorStringWithFormat("unable to open destination file: %s", dst_file_spec.GetPath().c_str()); diff --git a/lldb/source/Utility/Reproducer.cpp b/lldb/source/Utility/Reproducer.cpp index 479ed311d1d..90cfca2c4f4 100644 --- a/lldb/source/Utility/Reproducer.cpp +++ b/lldb/source/Utility/Reproducer.cpp @@ -176,7 +176,7 @@ void Generator::AddProvidersToIndex() { std::error_code EC; auto strm = llvm::make_unique<raw_fd_ostream>(index.GetPath(), EC, - sys::fs::OpenFlags::F_None); + sys::fs::OpenFlags::OF_None); yaml::Output yout(*strm); std::vector<std::string> files; @@ -254,7 +254,7 @@ void CommandProvider::Keep() { FileSpec file = GetRoot().CopyByAppendingPathComponent(Info::file); std::error_code ec; - llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::OF_Text); if (ec) return; yaml::Output yout(os); @@ -266,7 +266,7 @@ void CommandProvider::Discard() { m_data_recorders.clear(); } void VersionProvider::Keep() { FileSpec file = GetRoot().CopyByAppendingPathComponent(Info::file); std::error_code ec; - llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream os(file.GetPath(), ec, llvm::sys::fs::OF_Text); if (ec) return; os << m_version << "\n"; diff --git a/lldb/tools/lldb-server/LLDBServerUtilities.cpp b/lldb/tools/lldb-server/LLDBServerUtilities.cpp index 095d281e920..7f9271e36b6 100644 --- a/lldb/tools/lldb-server/LLDBServerUtilities.cpp +++ b/lldb/tools/lldb-server/LLDBServerUtilities.cpp @@ -24,7 +24,7 @@ static std::shared_ptr<raw_ostream> GetLogStream(StringRef log_file) { if (!log_file.empty()) { std::error_code EC; std::shared_ptr<raw_ostream> stream_sp = std::make_shared<raw_fd_ostream>( - log_file, EC, sys::fs::F_Text | sys::fs::F_Append); + log_file, EC, sys::fs::OF_Text | sys::fs::OF_Append); if (!EC) return stream_sp; errs() << llvm::formatv( diff --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst index b8056c7b937..a794b46c71a 100644 --- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst +++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.rst @@ -144,7 +144,7 @@ our file to: auto Filename = "output.o"; std::error_code EC; - raw_fd_ostream dest(Filename, EC, sys::fs::F_None); + raw_fd_ostream dest(Filename, EC, sys::fs::OF_None); if (EC) { errs() << "Could not open file: " << EC.message(); diff --git a/llvm/examples/BrainF/BrainFDriver.cpp b/llvm/examples/BrainF/BrainFDriver.cpp index 1eef5fcf853..64483479692 100644 --- a/llvm/examples/BrainF/BrainFDriver.cpp +++ b/llvm/examples/BrainF/BrainFDriver.cpp @@ -126,7 +126,7 @@ int main(int argc, char **argv) { } if (OutputFilename != "-") { std::error_code EC; - out = new raw_fd_ostream(OutputFilename, EC, sys::fs::F_None); + out = new raw_fd_ostream(OutputFilename, EC, sys::fs::OF_None); } } diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp index 9f17d51993a..c5628cf2154 100644 --- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp @@ -1245,7 +1245,7 @@ int main() { auto Filename = "output.o"; std::error_code EC; - raw_fd_ostream dest(Filename, EC, sys::fs::F_None); + raw_fd_ostream dest(Filename, EC, sys::fs::OF_None); if (EC) { errs() << "Could not open file: " << EC.message(); diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h index 0410a331465..c9e8df5db1c 100644 --- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h +++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h @@ -99,7 +99,7 @@ public: errs() << "Writing '" << Filename << "'..."; - raw_fd_ostream File(Filename, EC, sys::fs::F_Text); + raw_fd_ostream File(Filename, EC, sys::fs::OF_Text); std::string GraphName = DOTGraphTraits<GraphT>::getGraphName(Graph); std::string Title = GraphName + " for '" + F.getName().str() + "' function"; @@ -162,7 +162,7 @@ public: errs() << "Writing '" << Filename << "'..."; - raw_fd_ostream File(Filename, EC, sys::fs::F_Text); + raw_fd_ostream File(Filename, EC, sys::fs::OF_Text); std::string Title = DOTGraphTraits<GraphT>::getGraphName(Graph); if (!EC) diff --git a/llvm/lib/Analysis/CFGPrinter.cpp b/llvm/lib/Analysis/CFGPrinter.cpp index 619b675b58d..4f4103fefa2 100644 --- a/llvm/lib/Analysis/CFGPrinter.cpp +++ b/llvm/lib/Analysis/CFGPrinter.cpp @@ -99,7 +99,7 @@ static void writeCFGToDotFile(Function &F, bool CFGOnly = false) { errs() << "Writing '" << Filename << "'..."; std::error_code EC; - raw_fd_ostream File(Filename, EC, sys::fs::F_Text); + raw_fd_ostream File(Filename, EC, sys::fs::OF_Text); if (!EC) WriteGraph(File, (const Function*)&F, CFGOnly); diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index e25eb290a66..b10678a2184 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -813,7 +813,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex( if (!ModuleSummaryDotFile.empty()) { std::error_code EC; - raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OSDot(ModuleSummaryDotFile, EC, sys::fs::OpenFlags::OF_None); if (EC) report_fatal_error(Twine("Failed to open dot file ") + ModuleSummaryDotFile + ": " + EC.message() + "\n"); diff --git a/llvm/lib/Bitcode/Writer/BitWriter.cpp b/llvm/lib/Bitcode/Writer/BitWriter.cpp index 76ca89147e5..be59c1f9283 100644 --- a/llvm/lib/Bitcode/Writer/BitWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitWriter.cpp @@ -19,7 +19,7 @@ using namespace llvm; int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { std::error_code EC; - raw_fd_ostream OS(Path, EC, sys::fs::F_None); + raw_fd_ostream OS(Path, EC, sys::fs::OF_None); if (EC) return -1; diff --git a/llvm/lib/CodeGen/RegAllocPBQP.cpp b/llvm/lib/CodeGen/RegAllocPBQP.cpp index 20d7a9aee24..217947e0c9c 100644 --- a/llvm/lib/CodeGen/RegAllocPBQP.cpp +++ b/llvm/lib/CodeGen/RegAllocPBQP.cpp @@ -848,7 +848,7 @@ bool RegAllocPBQP::runOnMachineFunction(MachineFunction &MF) { std::string GraphFileName = FullyQualifiedName + "." + RS.str() + ".pbqpgraph"; std::error_code EC; - raw_fd_ostream OS(GraphFileName, EC, sys::fs::F_Text); + raw_fd_ostream OS(GraphFileName, EC, sys::fs::OF_Text); LLVM_DEBUG(dbgs() << "Dumping graph for round " << Round << " to \"" << GraphFileName << "\"\n"); G.dump(OS); diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 310935b5213..b4dc91bc3f3 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -386,7 +386,7 @@ void LLVMDumpModule(LLVMModuleRef M) { LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename, char **ErrorMessage) { std::error_code EC; - raw_fd_ostream dest(Filename, EC, sys::fs::F_Text); + raw_fd_ostream dest(Filename, EC, sys::fs::OF_Text); if (EC) { *ErrorMessage = strdup(EC.message().c_str()); return true; diff --git a/llvm/lib/IR/RemarkStreamer.cpp b/llvm/lib/IR/RemarkStreamer.cpp index 4f5c19369ff..a8650c694aa 100644 --- a/llvm/lib/IR/RemarkStreamer.cpp +++ b/llvm/lib/IR/RemarkStreamer.cpp @@ -126,7 +126,7 @@ llvm::setupOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, std::error_code EC; auto RemarksFile = - llvm::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::F_None); + llvm::make_unique<ToolOutputFile>(RemarksFilename, EC, sys::fs::OF_None); // We don't use llvm::FileError here because some diagnostics want the file // name separately. if (EC) diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 8d44ba2029e..a67fa941696 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1205,7 +1205,7 @@ public: std::error_code EC; raw_fd_ostream OS(NewModulePath + ".thinlto.bc", EC, - sys::fs::OpenFlags::F_None); + sys::fs::OpenFlags::OF_None); if (EC) return errorCodeToError(EC); WriteIndexToFile(CombinedIndex, OS, &ModuleToSummariesForIndex); @@ -1382,7 +1382,7 @@ lto::setupStatsFile(StringRef StatsFilename) { llvm::EnableStatistics(false); std::error_code EC; auto StatsFile = - llvm::make_unique<ToolOutputFile>(StatsFilename, EC, sys::fs::F_None); + llvm::make_unique<ToolOutputFile>(StatsFilename, EC, sys::fs::OF_None); if (EC) return errorCodeToError(EC); diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp index 7456e717516..1879b40808a 100644 --- a/llvm/lib/LTO/LTOBackend.cpp +++ b/llvm/lib/LTO/LTOBackend.cpp @@ -58,7 +58,7 @@ Error Config::addSaveTemps(std::string OutputFileName, std::error_code EC; ResolutionFile = llvm::make_unique<raw_fd_ostream>( - OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::F_Text); + OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::OF_Text); if (EC) return errorCodeToError(EC); @@ -83,7 +83,7 @@ Error Config::addSaveTemps(std::string OutputFileName, PathPrefix = M.getModuleIdentifier() + "."; std::string Path = PathPrefix + PathSuffix + ".bc"; std::error_code EC; - raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::OF_None); // Because -save-temps is a debugging feature, we report the error // directly and exit. if (EC) @@ -103,7 +103,7 @@ Error Config::addSaveTemps(std::string OutputFileName, CombinedIndexHook = [=](const ModuleSummaryIndex &Index) { std::string Path = OutputFileName + "index.bc"; std::error_code EC; - raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::OF_None); // Because -save-temps is a debugging feature, we report the error // directly and exit. if (EC) @@ -111,7 +111,7 @@ Error Config::addSaveTemps(std::string OutputFileName, WriteIndexToFile(Index, OS); Path = OutputFileName + "index.dot"; - raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OSDot(Path, EC, sys::fs::OpenFlags::OF_None); if (EC) reportOpenError(Path, EC.message()); Index.exportToDot(OSDot); @@ -329,7 +329,7 @@ void codegen(Config &Conf, TargetMachine *TM, AddStreamFn AddStream, if (!DwoFile.empty()) { std::error_code EC; - DwoOut = llvm::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::F_None); + DwoOut = llvm::make_unique<ToolOutputFile>(DwoFile, EC, sys::fs::OF_None); if (EC) report_fatal_error("Failed to open " + DwoFile + ": " + EC.message()); } diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 6bb3bfaefc9..c1a19fae90f 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -229,7 +229,7 @@ bool LTOCodeGenerator::writeMergedModules(StringRef Path) { // create output file std::error_code EC; - ToolOutputFile Out(Path, EC, sys::fs::F_None); + ToolOutputFile Out(Path, EC, sys::fs::OF_None); if (EC) { std::string ErrMsg = "could not open bitcode file for writing: "; ErrMsg += Path.str() + ": " + EC.message(); diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 1c52218836c..70d61c97c72 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -89,7 +89,7 @@ static void saveTempBitcode(const Module &TheModule, StringRef TempDir, // User asked to save temps, let dump the bitcode file after import. std::string SaveTempPath = (TempDir + llvm::Twine(count) + Suffix).str(); std::error_code EC; - raw_fd_ostream OS(SaveTempPath, EC, sys::fs::F_None); + raw_fd_ostream OS(SaveTempPath, EC, sys::fs::OF_None); if (EC) report_fatal_error(Twine("Failed to open ") + SaveTempPath + " to save optimized bitcode\n"); @@ -845,7 +845,7 @@ ThinLTOCodeGenerator::writeGeneratedObject(int count, StringRef CacheEntryPath, } // No cache entry, just write out the buffer. std::error_code Err; - raw_fd_ostream OS(OutputPath, Err, sys::fs::F_None); + raw_fd_ostream OS(OutputPath, Err, sys::fs::OF_None); if (Err) report_fatal_error("Can't open output '" + OutputPath + "'\n"); OS << OutputBuffer.getBuffer(); @@ -900,7 +900,7 @@ void ThinLTOCodeGenerator::run() { if (!SaveTempsDir.empty()) { auto SaveTempPath = SaveTempsDir + "index.bc"; std::error_code EC; - raw_fd_ostream OS(SaveTempPath, EC, sys::fs::F_None); + raw_fd_ostream OS(SaveTempPath, EC, sys::fs::OF_None); if (EC) report_fatal_error(Twine("Failed to open ") + SaveTempPath + " to save optimized bitcode\n"); diff --git a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp index 1160934dc62..9c064207c7c 100644 --- a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp +++ b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp @@ -779,7 +779,7 @@ bool DarwinAsmParser::parseDirectiveSecureLogUnique(StringRef, SMLoc IDLoc) { if (!OS) { std::error_code EC; auto NewOS = llvm::make_unique<raw_fd_ostream>( - StringRef(SecureLogFile), EC, sys::fs::F_Append | sys::fs::F_Text); + StringRef(SecureLogFile), EC, sys::fs::OF_Append | sys::fs::OF_Text); if (EC) return Error(IDLoc, Twine("can't open secure log file: ") + SecureLogFile + " (" + EC.message() + ")"); diff --git a/llvm/lib/ProfileData/GCOV.cpp b/llvm/lib/ProfileData/GCOV.cpp index fa4e433d7aa..47c8cfbbf4d 100644 --- a/llvm/lib/ProfileData/GCOV.cpp +++ b/llvm/lib/ProfileData/GCOV.cpp @@ -706,7 +706,7 @@ FileInfo::openCoveragePath(StringRef CoveragePath) { std::error_code EC; auto OS = - llvm::make_unique<raw_fd_ostream>(CoveragePath, EC, sys::fs::F_Text); + llvm::make_unique<raw_fd_ostream>(CoveragePath, EC, sys::fs::OF_Text); if (EC) { errs() << EC.message() << "\n"; return llvm::make_unique<raw_null_ostream>(); diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp index 8b876e0aa5d..93ec2bbbb26 100644 --- a/llvm/lib/ProfileData/SampleProfWriter.cpp +++ b/llvm/lib/ProfileData/SampleProfWriter.cpp @@ -350,9 +350,9 @@ SampleProfileWriter::create(StringRef Filename, SampleProfileFormat Format) { std::error_code EC; std::unique_ptr<raw_ostream> OS; if (Format == SPF_Binary || Format == SPF_Compact_Binary) - OS.reset(new raw_fd_ostream(Filename, EC, sys::fs::F_None)); + OS.reset(new raw_fd_ostream(Filename, EC, sys::fs::OF_None)); else - OS.reset(new raw_fd_ostream(Filename, EC, sys::fs::F_Text)); + OS.reset(new raw_fd_ostream(Filename, EC, sys::fs::OF_Text)); if (EC) return EC; diff --git a/llvm/lib/Support/CachePruning.cpp b/llvm/lib/Support/CachePruning.cpp index 9813eec0e43..7a2f6c53435 100644 --- a/llvm/lib/Support/CachePruning.cpp +++ b/llvm/lib/Support/CachePruning.cpp @@ -45,7 +45,7 @@ struct FileInfo { /// interval option. static void writeTimestampFile(StringRef TimestampFile) { std::error_code EC; - raw_fd_ostream Out(TimestampFile.str(), EC, sys::fs::F_None); + raw_fd_ostream Out(TimestampFile.str(), EC, sys::fs::OF_None); } static Expected<std::chrono::seconds> parseDuration(StringRef Duration) { diff --git a/llvm/lib/Support/CodeGenCoverage.cpp b/llvm/lib/Support/CodeGenCoverage.cpp index f39eb7533b4..902736c13d4 100644 --- a/llvm/lib/Support/CodeGenCoverage.cpp +++ b/llvm/lib/Support/CodeGenCoverage.cpp @@ -101,7 +101,7 @@ bool CodeGenCoverage::emit(StringRef CoveragePrefix, std::string CoverageFilename = (CoveragePrefix + Pid).str(); std::error_code EC; - sys::fs::OpenFlags OpenFlags = sys::fs::F_Append; + sys::fs::OpenFlags OpenFlags = sys::fs::OF_Append; std::unique_ptr<ToolOutputFile> CoverageFile = llvm::make_unique<ToolOutputFile>(CoverageFilename, EC, OpenFlags); if (EC) diff --git a/llvm/lib/Support/FileCollector.cpp b/llvm/lib/Support/FileCollector.cpp index 556a3c03db5..47fca641372 100644 --- a/llvm/lib/Support/FileCollector.cpp +++ b/llvm/lib/Support/FileCollector.cpp @@ -179,7 +179,7 @@ std::error_code FileCollector::writeMapping(StringRef mapping_file) { VFSWriter.setUseExternalNames(false); std::error_code EC; - raw_fd_ostream os(mapping_file, EC, sys::fs::F_Text); + raw_fd_ostream os(mapping_file, EC, sys::fs::OF_Text); if (EC) return EC; diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 2a7ff1eaaf6..17de654a1de 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -68,7 +68,7 @@ std::unique_ptr<raw_fd_ostream> llvm::CreateInfoOutputFile() { // info output file before running commands which write to it. std::error_code EC; auto Result = llvm::make_unique<raw_fd_ostream>( - OutputFilename, EC, sys::fs::F_Append | sys::fs::F_Text); + OutputFilename, EC, sys::fs::OF_Append | sys::fs::OF_Text); if (!EC) return Result; diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 5c2c061fb88..dfd9389d2c6 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -887,9 +887,9 @@ static int nativeOpenFlags(CreationDisposition Disp, OpenFlags Flags, else if (Access == (FA_Read | FA_Write)) Result |= O_RDWR; - // This is for compatibility with old code that assumed F_Append implied + // This is for compatibility with old code that assumed OF_Append implied // would open an existing file. See Windows/Path.inc for a longer comment. - if (Flags & F_Append) + if (Flags & OF_Append) Disp = CD_OpenAlways; if (Disp == CD_CreateNew) { @@ -904,7 +904,7 @@ static int nativeOpenFlags(CreationDisposition Disp, OpenFlags Flags, // Nothing special, just don't add O_CREAT and we get these semantics. } - if (Flags & F_Append) + if (Flags & OF_Append) Result |= O_APPEND; #ifdef O_CLOEXEC diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc index c4123a64046..9f641c4f771 100644 --- a/llvm/lib/Support/Unix/Program.inc +++ b/llvm/lib/Support/Unix/Program.inc @@ -444,7 +444,7 @@ std::error_code llvm::sys::writeFileWithEncoding(StringRef FileName, StringRef Contents, WindowsEncodingMethod Encoding /*unused*/) { std::error_code EC; - llvm::raw_fd_ostream OS(FileName, EC, llvm::sys::fs::OpenFlags::F_Text); + llvm::raw_fd_ostream OS(FileName, EC, llvm::sys::fs::OpenFlags::OF_Text); if (EC) return EC; diff --git a/llvm/lib/Support/Windows/Program.inc b/llvm/lib/Support/Windows/Program.inc index 0f54e59ee55..a23ed95fc39 100644 --- a/llvm/lib/Support/Windows/Program.inc +++ b/llvm/lib/Support/Windows/Program.inc @@ -470,7 +470,7 @@ std::error_code llvm::sys::writeFileWithEncoding(StringRef FileName, StringRef Contents, WindowsEncodingMethod Encoding) { std::error_code EC; - llvm::raw_fd_ostream OS(FileName, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(FileName, EC, llvm::sys::fs::OF_Text); if (EC) return EC; diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 2baccaa0cbd..16e56ed7835 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -843,7 +843,7 @@ void raw_fd_ostream::anchor() {} raw_ostream &llvm::outs() { // Set buffer settings to model stdout behavior. std::error_code EC; - static raw_fd_ostream S("-", EC, sys::fs::F_None); + static raw_fd_ostream S("-", EC, sys::fs::OF_None); assert(!EC); return S; } diff --git a/llvm/lib/TableGen/Main.cpp b/llvm/lib/TableGen/Main.cpp index bcd39584e45..f51267f7ce4 100644 --- a/llvm/lib/TableGen/Main.cpp +++ b/llvm/lib/TableGen/Main.cpp @@ -64,7 +64,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; - ToolOutputFile DepOut(DependFilename, EC, sys::fs::F_Text); + ToolOutputFile DepOut(DependFilename, EC, sys::fs::OF_Text); if (EC) return reportError(argv0, "error opening " + DependFilename + ":" + EC.message() + "\n"); @@ -122,7 +122,7 @@ int llvm::TableGenMain(char *argv0, TableGenMainFn *MainFn) { return 0; std::error_code EC; - ToolOutputFile OutFile(OutputFilename, EC, sys::fs::F_Text); + ToolOutputFile OutFile(OutputFilename, EC, sys::fs::OF_Text); if (EC) return reportError(argv0, "error opening " + OutputFilename + ":" + EC.message() + "\n"); diff --git a/llvm/lib/Target/TargetMachineC.cpp b/llvm/lib/Target/TargetMachineC.cpp index 5d9029682fd..3ac9c38dfc0 100644 --- a/llvm/lib/Target/TargetMachineC.cpp +++ b/llvm/lib/Target/TargetMachineC.cpp @@ -219,7 +219,7 @@ static LLVMBool LLVMTargetMachineEmit(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, char* Filename, LLVMCodeGenFileType codegen, char** ErrorMessage) { std::error_code EC; - raw_fd_ostream dest(Filename, EC, sys::fs::F_None); + raw_fd_ostream dest(Filename, EC, sys::fs::OF_None); if (EC) { *ErrorMessage = strdup(EC.message().c_str()); return true; diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 62c7fbd0722..c81ed538cbc 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -892,7 +892,7 @@ std::error_code llvm::EmitImportsFiles( StringRef ModulePath, StringRef OutputFilename, const std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex) { std::error_code EC; - raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream ImportsOS(OutputFilename, EC, sys::fs::OpenFlags::OF_None); if (EC) return EC; for (auto &ILI : ModuleToSummariesForIndex) diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp index 769dc484b9e..fd1b0cd7ad3 100644 --- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp +++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp @@ -1630,7 +1630,7 @@ bool LowerTypeTestsModule::runForTesting(Module &M) { ExitOnError ExitOnErr("-lowertypetests-write-summary: " + ClWriteSummary + ": "); std::error_code EC; - raw_fd_ostream OS(ClWriteSummary, EC, sys::fs::F_Text); + raw_fd_ostream OS(ClWriteSummary, EC, sys::fs::OF_Text); ExitOnErr(errorCodeToError(EC)); yaml::Output Out(OS); diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp index ea3a055fc70..4436363f658 100644 --- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp +++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -771,7 +771,7 @@ bool DevirtModule::runForTesting( ExitOnError ExitOnErr( "-wholeprogramdevirt-write-summary: " + ClWriteSummary + ": "); std::error_code EC; - raw_fd_ostream OS(ClWriteSummary, EC, sys::fs::F_Text); + raw_fd_ostream OS(ClWriteSummary, EC, sys::fs::OF_Text); ExitOnErr(errorCodeToError(EC)); yaml::Output Out(OS); diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 59950ffc4e9..b2d52fad1c0 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -669,7 +669,8 @@ void GCOVProfiler::emitProfileNotes() { continue; std::error_code EC; - raw_fd_ostream out(mangleName(CU, GCovFileType::GCNO), EC, sys::fs::F_None); + raw_fd_ostream out(mangleName(CU, GCovFileType::GCNO), EC, + sys::fs::OF_None); if (EC) { Ctx->emitError(Twine("failed to open coverage notes file for writing: ") + EC.message()); diff --git a/llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp b/llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp index a2c1ddfd279..93d3a8a14d5 100644 --- a/llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp +++ b/llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp @@ -100,7 +100,8 @@ public: if (!ClOrderFileWriteMapping.empty()) { std::lock_guard<std::mutex> LogLock(MappingMutex); std::error_code EC; - llvm::raw_fd_ostream OS(ClOrderFileWriteMapping, EC, llvm::sys::fs::F_Append); + llvm::raw_fd_ostream OS(ClOrderFileWriteMapping, EC, + llvm::sys::fs::OF_Append); if (EC) { report_fatal_error(Twine("Failed to open ") + ClOrderFileWriteMapping + " to save mapping file for order file instrumentation\n"); diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index 562de795238..e093389bdfe 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -79,7 +79,7 @@ bool BugDriver::writeProgramToFile(int FD, const Module &M) const { bool BugDriver::writeProgramToFile(const std::string &Filename, const Module &M) const { std::error_code EC; - ToolOutputFile Out(Filename, EC, sys::fs::F_None); + ToolOutputFile Out(Filename, EC, sys::fs::OF_None); if (!EC) return writeProgramToFileAux(Out, M); return true; diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp index 759b5e4e26c..bf42ec73269 100644 --- a/llvm/tools/dsymutil/dsymutil.cpp +++ b/llvm/tools/dsymutil/dsymutil.cpp @@ -178,7 +178,7 @@ static Error createPlistFile(llvm::StringRef Bin, llvm::StringRef BundleRoot) { llvm::SmallString<128> InfoPlist(BundleRoot); llvm::sys::path::append(InfoPlist, "Contents/Info.plist"); std::error_code EC; - llvm::raw_fd_ostream PL(InfoPlist, EC, llvm::sys::fs::F_Text); + llvm::raw_fd_ostream PL(InfoPlist, EC, llvm::sys::fs::OF_Text); if (EC) return make_error<StringError>( "cannot create Plist: " + toString(errorCodeToError(EC)), EC); @@ -584,7 +584,7 @@ int main(int argc, char **argv) { } else { std::error_code EC; OS = std::make_shared<raw_fd_ostream>(NoOutput ? "-" : OutputFile, EC, - sys::fs::F_None); + sys::fs::OF_None); if (EC) { WithColor::error() << OutputFile << ": " << EC.message(); return 1; diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp index 1052c48734d..0211add7e20 100644 --- a/llvm/tools/gold/gold-plugin.cpp +++ b/llvm/tools/gold/gold-plugin.cpp @@ -886,7 +886,7 @@ static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite, case options::OT_BC_ONLY: Conf.PostInternalizeModuleHook = [](size_t Task, const Module &M) { std::error_code EC; - raw_fd_ostream OS(output_name, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(output_name, EC, sys::fs::OpenFlags::OF_None); if (EC) message(LDPL_FATAL, "Failed to write the output file."); WriteBitcodeToFile(M, OS, /* ShouldPreserveUseListOrder */ false); @@ -947,7 +947,7 @@ static void writeEmptyDistributedBuildOutputs(const std::string &ModulePath, std::error_code EC; { raw_fd_ostream OS(NewModulePath + ".thinlto.bc", EC, - sys::fs::OpenFlags::F_None); + sys::fs::OpenFlags::OF_None); if (EC) message(LDPL_FATAL, "Failed to write '%s': %s", (NewModulePath + ".thinlto.bc").c_str(), EC.message().c_str()); @@ -960,7 +960,7 @@ static void writeEmptyDistributedBuildOutputs(const std::string &ModulePath, } if (options::thinlto_emit_imports_files) { raw_fd_ostream OS(NewModulePath + ".imports", EC, - sys::fs::OpenFlags::F_None); + sys::fs::OpenFlags::OF_None); if (EC) message(LDPL_FATAL, "Failed to write '%s': %s", (NewModulePath + ".imports").c_str(), EC.message().c_str()); @@ -975,7 +975,7 @@ static std::unique_ptr<raw_fd_ostream> CreateLinkedObjectsFile() { assert(options::thinlto_index_only); std::error_code EC; auto LinkedObjectsFile = llvm::make_unique<raw_fd_ostream>( - options::thinlto_linked_objects_file, EC, sys::fs::OpenFlags::F_None); + options::thinlto_linked_objects_file, EC, sys::fs::OpenFlags::OF_None); if (EC) message(LDPL_FATAL, "Failed to create '%s': %s", options::thinlto_linked_objects_file.c_str(), EC.message().c_str()); diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp index 76da843f065..7df07b90a1d 100644 --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -239,9 +239,9 @@ static std::unique_ptr<ToolOutputFile> GetOutputStream(const char *TargetName, // Open the file. std::error_code EC; - sys::fs::OpenFlags OpenFlags = sys::fs::F_None; + sys::fs::OpenFlags OpenFlags = sys::fs::OF_None; if (!Binary) - OpenFlags |= sys::fs::F_Text; + OpenFlags |= sys::fs::OF_Text; auto FDOut = llvm::make_unique<ToolOutputFile>(OutputFilename, EC, OpenFlags); if (EC) { WithColor::error() << EC.message() << '\n'; @@ -480,7 +480,7 @@ static int compileModule(char **argv, LLVMContext &Context) { if (!SplitDwarfOutputFile.empty()) { std::error_code EC; DwoOut = llvm::make_unique<ToolOutputFile>(SplitDwarfOutputFile, EC, - sys::fs::F_None); + sys::fs::OF_None); if (EC) { WithColor::error(errs(), argv[0]) << EC.message() << '\n'; return 1; diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 932bec129f6..fc76a6c5ad2 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -251,7 +251,7 @@ public: sys::fs::create_directories(Twine(dir)); } std::error_code EC; - raw_fd_ostream outfile(CacheName, EC, sys::fs::F_None); + raw_fd_ostream outfile(CacheName, EC, sys::fs::OF_None); outfile.write(Obj.getBufferStart(), Obj.getBufferSize()); outfile.close(); } @@ -726,7 +726,7 @@ static std::function<void(Module &)> createDebugDumper() { case DumpKind::DumpModsToDisk: return [](Module &M) { std::error_code EC; - raw_fd_ostream Out(M.getModuleIdentifier() + ".ll", EC, sys::fs::F_Text); + raw_fd_ostream Out(M.getModuleIdentifier() + ".ll", EC, sys::fs::OF_Text); if (EC) { errs() << "Couldn't open " << M.getModuleIdentifier() << " for dumping.\nError:" << EC.message() << "\n"; diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 91746d0fab3..7c4cc26ad6d 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -489,7 +489,7 @@ static void doExtract(StringRef Name, const object::Archive::Child &C) { int FD; failIfError(sys::fs::openFileForWrite(sys::path::filename(Name), FD, sys::fs::CD_CreateAlways, - sys::fs::F_None, Mode), + sys::fs::OF_None, Mode), Name); { diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp index 234fef907a3..c9f50e38fc6 100644 --- a/llvm/tools/llvm-as/llvm-as.cpp +++ b/llvm/tools/llvm-as/llvm-as.cpp @@ -82,7 +82,7 @@ static void WriteOutputFile(const Module *M, const ModuleSummaryIndex *Index) { std::error_code EC; std::unique_ptr<ToolOutputFile> Out( - new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); if (EC) { errs() << EC.message() << '\n'; exit(1); diff --git a/llvm/tools/llvm-cat/llvm-cat.cpp b/llvm/tools/llvm-cat/llvm-cat.cpp index 6a0992806d6..85f2b410f87 100644 --- a/llvm/tools/llvm-cat/llvm-cat.cpp +++ b/llvm/tools/llvm-cat/llvm-cat.cpp @@ -85,7 +85,7 @@ int main(int argc, char **argv) { } std::error_code EC; - raw_fd_ostream OS(OutputFilename, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(OutputFilename, EC, sys::fs::OpenFlags::OF_None); if (EC) { errs() << argv[0] << ": cannot open " << OutputFilename << " for writing: " << EC.message(); diff --git a/llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp b/llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp index 87d4d06bbc9..b53a6364c89 100644 --- a/llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp +++ b/llvm/tools/llvm-cxxmap/llvm-cxxmap.cpp @@ -145,7 +145,7 @@ int main(int argc, const char *argv[]) { exitWithErrorCode(RemappingBufOrError.getError(), RemappingFile); std::error_code EC; - raw_fd_ostream OS(OutputFilename.data(), EC, sys::fs::F_Text); + raw_fd_ostream OS(OutputFilename.data(), EC, sys::fs::OF_Text); if (EC) exitWithErrorCode(EC, OutputFilename); diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp index 3f337b874b1..1db498f035f 100644 --- a/llvm/tools/llvm-dis/llvm-dis.cpp +++ b/llvm/tools/llvm-dis/llvm-dis.cpp @@ -186,7 +186,7 @@ int main(int argc, char **argv) { std::error_code EC; std::unique_ptr<ToolOutputFile> Out( - new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); if (EC) { errs() << EC.message() << '\n'; return 1; diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index 9715ee32af7..0085a357888 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -703,7 +703,7 @@ int main(int argc, char **argv) { // Create the output file. std::error_code EC; - ToolOutputFile OutFile(OutputFilename, EC, sys::fs::F_None); + ToolOutputFile OutFile(OutputFilename, EC, sys::fs::OF_None); Optional<buffer_ostream> BOS; raw_pwrite_stream *OS; if (EC) diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp index a352eabcd6d..685f31a2b7d 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp @@ -406,7 +406,7 @@ llvm::Error InstructionBenchmark::writeYaml(const LLVMState &State, int ResultFD = 0; if (auto E = llvm::errorCodeToError( openFileForWrite(Filename, ResultFD, llvm::sys::fs::CD_CreateAlways, - llvm::sys::fs::F_Text))) { + llvm::sys::fs::OF_Text))) { return E; } llvm::raw_fd_ostream Ostr(ResultFD, true /*shouldClose*/); diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp index 300bc0b4bd5..b74b76e78eb 100644 --- a/llvm/tools/llvm-extract/llvm-extract.cpp +++ b/llvm/tools/llvm-extract/llvm-extract.cpp @@ -350,7 +350,7 @@ int main(int argc, char **argv) { Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls std::error_code EC; - ToolOutputFile Out(OutputFilename, EC, sys::fs::F_None); + ToolOutputFile Out(OutputFilename, EC, sys::fs::OF_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 50ba57178d0..46d9d5d7292 100644 --- a/llvm/tools/llvm-link/llvm-link.cpp +++ b/llvm/tools/llvm-link/llvm-link.cpp @@ -381,7 +381,7 @@ int main(int argc, char **argv) { errs() << "Here's the assembly:\n" << *Composite; std::error_code EC; - ToolOutputFile Out(OutputFilename, EC, sys::fs::F_None); + ToolOutputFile Out(OutputFilename, EC, sys::fs::OF_None); if (EC) { WithColor::error() << EC.message() << '\n'; return 1; diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp index 585207b2518..eb3448e74e6 100644 --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/tools/llvm-lto/llvm-lto.cpp @@ -420,7 +420,7 @@ static void createCombinedModuleSummaryIndex() { std::error_code EC; assert(!OutputFilename.empty()); raw_fd_ostream OS(OutputFilename + ".thinlto.bc", EC, - sys::fs::OpenFlags::F_None); + sys::fs::OpenFlags::OF_None); error(EC, "error opening the file '" + OutputFilename + ".thinlto.bc'"); WriteIndexToFile(CombinedIndex, OS); OS.close(); @@ -510,7 +510,7 @@ static std::unique_ptr<Module> loadModuleFromInput(lto::InputFile &File, static void writeModuleToFile(Module &TheModule, StringRef Filename) { std::error_code EC; - raw_fd_ostream OS(Filename, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(Filename, EC, sys::fs::OpenFlags::OF_None); error(EC, "error opening the file '" + Filename + "'"); maybeVerifyModule(TheModule); WriteBitcodeToFile(TheModule, OS, /* ShouldPreserveUseListOrder */ true); @@ -581,7 +581,7 @@ private: if (!CombinedIndex) report_fatal_error("ThinLink didn't create an index"); std::error_code EC; - raw_fd_ostream OS(OutputFilename, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(OutputFilename, EC, sys::fs::OpenFlags::OF_None); error(EC, "error opening the file '" + OutputFilename + "'"); WriteIndexToFile(*CombinedIndex, OS); } @@ -619,7 +619,7 @@ private: } OutputName = getThinLTOOutputFile(OutputName, OldPrefix, NewPrefix); std::error_code EC; - raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::OF_None); error(EC, "error opening the file '" + OutputName + "'"); WriteIndexToFile(*Index, OS, &ModuleToSummariesForIndex); } @@ -802,7 +802,7 @@ private: } std::error_code EC; - raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::OF_None); error(EC, "error opening the file '" + OutputName + "'"); OS << std::get<0>(BinName)->getBuffer(); } @@ -848,7 +848,7 @@ private: for (unsigned BufID = 0; BufID < Binaries.size(); ++BufID) { auto OutputName = InputFilenames[BufID] + ".thinlto.o"; std::error_code EC; - raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::F_None); + raw_fd_ostream OS(OutputName, EC, sys::fs::OpenFlags::OF_None); error(EC, "error opening the file '" + OutputName + "'"); OS << Binaries[BufID]->getBuffer(); } @@ -1020,7 +1020,7 @@ int main(int argc, char **argv) { if (Parallelism != 1) PartFilename += "." + utostr(I); std::error_code EC; - OSs.emplace_back(PartFilename, EC, sys::fs::F_None); + OSs.emplace_back(PartFilename, EC, sys::fs::OF_None); if (EC) error("error opening the file '" + PartFilename + "': " + EC.message()); OSPtrs.push_back(&OSs.back().os()); diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp index 0adb048b18e..91e2a444326 100644 --- a/llvm/tools/llvm-lto2/llvm-lto2.cpp +++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp @@ -333,7 +333,7 @@ static int run(int argc, char **argv) { std::string Path = OutputFilename + "." + utostr(Task); std::error_code EC; - auto S = llvm::make_unique<raw_fd_ostream>(Path, EC, sys::fs::F_None); + auto S = llvm::make_unique<raw_fd_ostream>(Path, EC, sys::fs::OF_None); check(EC, Path); return llvm::make_unique<lto::NativeObjectStream>(std::move(S)); }; 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 64154b999c9..a996d496a99 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 @@ -211,7 +211,7 @@ int AssembleOneInput(const uint8_t *Data, size_t Size) { std::error_code EC; const std::string OutputFilename = "-"; auto Out = - llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::F_None); + llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_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 90bc7c7a4b0..d13a86af919 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -211,7 +211,7 @@ static const Target *GetTarget(const char *ProgName) { static std::unique_ptr<ToolOutputFile> GetOutputStream(StringRef Path) { std::error_code EC; - auto Out = llvm::make_unique<ToolOutputFile>(Path, EC, sys::fs::F_None); + auto Out = llvm::make_unique<ToolOutputFile>(Path, EC, sys::fs::OF_None); if (EC) { WithColor::error() << EC.message() << '\n'; return nullptr; diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp index 05c118e5ef7..a6acca4e678 100644 --- a/llvm/tools/llvm-mca/llvm-mca.cpp +++ b/llvm/tools/llvm-mca/llvm-mca.cpp @@ -222,7 +222,7 @@ ErrorOr<std::unique_ptr<ToolOutputFile>> getOutputStream() { OutputFilename = "-"; std::error_code EC; auto Out = - llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::F_None); + llvm::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_None); if (!EC) return std::move(Out); return EC; diff --git a/llvm/tools/llvm-modextract/llvm-modextract.cpp b/llvm/tools/llvm-modextract/llvm-modextract.cpp index 3adefc5f0d3..7c409962584 100644 --- a/llvm/tools/llvm-modextract/llvm-modextract.cpp +++ b/llvm/tools/llvm-modextract/llvm-modextract.cpp @@ -54,7 +54,7 @@ int main(int argc, char **argv) { std::error_code EC; std::unique_ptr<ToolOutputFile> Out( - new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); ExitOnErr(errorCodeToError(EC)); if (BinaryExtract) { diff --git a/llvm/tools/llvm-opt-report/OptReport.cpp b/llvm/tools/llvm-opt-report/OptReport.cpp index b45c3fd10de..a0bc5dccbcf 100644 --- a/llvm/tools/llvm-opt-report/OptReport.cpp +++ b/llvm/tools/llvm-opt-report/OptReport.cpp @@ -242,8 +242,7 @@ static bool readLocationInfo(LocationInfoTy &LocationInfo) { static bool writeReport(LocationInfoTy &LocationInfo) { std::error_code EC; - llvm::raw_fd_ostream OS(OutputFileName, EC, - llvm::sys::fs::F_Text); + llvm::raw_fd_ostream OS(OutputFileName, EC, llvm::sys::fs::OF_Text); if (EC) { WithColor::error() << "Can't open file " << OutputFileName << ": " << EC.message() << "\n"; diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp index 16d3ebe3fcb..926dd1576e6 100644 --- a/llvm/tools/llvm-profdata/llvm-profdata.cpp +++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp @@ -380,7 +380,7 @@ static void mergeInstrProfile(const WeightedFileVector &Inputs, } std::error_code EC; - raw_fd_ostream Output(OutputFilename.data(), EC, sys::fs::F_None); + raw_fd_ostream Output(OutputFilename.data(), EC, sys::fs::OF_None); if (EC) exitWithErrorCode(EC, OutputFilename); @@ -682,7 +682,7 @@ static int overlap_main(int argc, const char *argv[]) { cl::ParseCommandLineOptions(argc, argv, "LLVM profile data overlap tool\n"); std::error_code EC; - raw_fd_ostream OS(Output.data(), EC, sys::fs::F_Text); + raw_fd_ostream OS(Output.data(), EC, sys::fs::OF_Text); if (EC) exitWithErrorCode(EC, Output); @@ -1027,7 +1027,7 @@ static int show_main(int argc, const char *argv[]) { } std::error_code EC; - raw_fd_ostream OS(OutputFilename.data(), EC, sys::fs::F_Text); + raw_fd_ostream OS(OutputFilename.data(), EC, sys::fs::OF_Text); if (EC) exitWithErrorCode(EC, OutputFilename); diff --git a/llvm/tools/llvm-split/llvm-split.cpp b/llvm/tools/llvm-split/llvm-split.cpp index 879e69ccec5..102188b43bd 100644 --- a/llvm/tools/llvm-split/llvm-split.cpp +++ b/llvm/tools/llvm-split/llvm-split.cpp @@ -55,7 +55,7 @@ int main(int argc, char **argv) { SplitModule(std::move(M), NumOutputs, [&](std::unique_ptr<Module> MPart) { std::error_code EC; std::unique_ptr<ToolOutputFile> Out( - new ToolOutputFile(OutputFilename + utostr(I++), EC, sys::fs::F_None)); + new ToolOutputFile(OutputFilename + utostr(I++), EC, sys::fs::OF_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 a455bf13fe7..5f76e5bf7ec 100644 --- a/llvm/tools/llvm-stress/llvm-stress.cpp +++ b/llvm/tools/llvm-stress/llvm-stress.cpp @@ -752,7 +752,7 @@ int main(int argc, char **argv) { OutputFilename = "-"; std::error_code EC; - Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); if (EC) { errs() << EC.message() << '\n'; return 1; diff --git a/llvm/tools/llvm-xray/xray-account.cpp b/llvm/tools/llvm-xray/xray-account.cpp index 2b49a311d7e..e37cd212377 100644 --- a/llvm/tools/llvm-xray/xray-account.cpp +++ b/llvm/tools/llvm-xray/xray-account.cpp @@ -421,7 +421,7 @@ static CommandRegistration Unused(&Account, []() -> Error { } std::error_code EC; - raw_fd_ostream OS(AccountOutput, EC, sys::fs::OpenFlags::F_Text); + raw_fd_ostream OS(AccountOutput, EC, sys::fs::OpenFlags::OF_Text); if (EC) return make_error<StringError>( Twine("Cannot open file '") + AccountOutput + "' for writing.", EC); diff --git a/llvm/tools/llvm-xray/xray-converter.cpp b/llvm/tools/llvm-xray/xray-converter.cpp index dfc757e0f27..7258245b95c 100644 --- a/llvm/tools/llvm-xray/xray-converter.cpp +++ b/llvm/tools/llvm-xray/xray-converter.cpp @@ -387,8 +387,8 @@ static CommandRegistration Unused(&Convert, []() -> Error { std::error_code EC; raw_fd_ostream OS(ConvertOutput, EC, ConvertOutputFormat == ConvertFormats::BINARY - ? sys::fs::OpenFlags::F_None - : sys::fs::OpenFlags::F_Text); + ? sys::fs::OpenFlags::OF_None + : sys::fs::OpenFlags::OF_Text); if (EC) return make_error<StringError>( Twine("Cannot open file '") + ConvertOutput + "' for writing.", EC); diff --git a/llvm/tools/llvm-xray/xray-extract.cpp b/llvm/tools/llvm-xray/xray-extract.cpp index 7c7d26b5a38..7800b88d9ee 100644 --- a/llvm/tools/llvm-xray/xray-extract.cpp +++ b/llvm/tools/llvm-xray/xray-extract.cpp @@ -80,7 +80,7 @@ static CommandRegistration Unused(&Extract, []() -> Error { InstrumentationMapOrError.takeError()); std::error_code EC; - raw_fd_ostream OS(ExtractOutput, EC, sys::fs::OpenFlags::F_Text); + raw_fd_ostream OS(ExtractOutput, EC, sys::fs::OpenFlags::OF_Text); if (EC) return make_error<StringError>( Twine("Cannot open file '") + ExtractOutput + "' for writing.", EC); diff --git a/llvm/tools/llvm-xray/xray-graph-diff.cpp b/llvm/tools/llvm-xray/xray-graph-diff.cpp index a514be97f40..116aa6869ec 100644 --- a/llvm/tools/llvm-xray/xray-graph-diff.cpp +++ b/llvm/tools/llvm-xray/xray-graph-diff.cpp @@ -470,7 +470,7 @@ static CommandRegistration Unused(&GraphDiff, []() -> Error { auto &GDR = *GDROrErr; std::error_code EC; - raw_fd_ostream OS(GraphDiffOutput, EC, sys::fs::OpenFlags::F_Text); + raw_fd_ostream OS(GraphDiffOutput, EC, sys::fs::OpenFlags::OF_Text); if (EC) return make_error<StringError>( Twine("Cannot open file '") + GraphDiffOutput + "' for writing.", EC); diff --git a/llvm/tools/llvm-xray/xray-graph.cpp b/llvm/tools/llvm-xray/xray-graph.cpp index c09357fcb50..0be511219c1 100644 --- a/llvm/tools/llvm-xray/xray-graph.cpp +++ b/llvm/tools/llvm-xray/xray-graph.cpp @@ -506,7 +506,7 @@ static CommandRegistration Unused(&GraphC, []() -> Error { auto &GR = *GROrError; std::error_code EC; - raw_fd_ostream OS(GraphOutput, EC, sys::fs::OpenFlags::F_Text); + raw_fd_ostream OS(GraphOutput, EC, sys::fs::OpenFlags::OF_Text); if (EC) return make_error<StringError>( Twine("Cannot open file '") + GraphOutput + "' for writing.", EC); diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index ccf8b073b82..a30547b89f8 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -612,7 +612,7 @@ int main(int argc, char **argv) { OutputFilename = "-"; std::error_code EC; - Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + Out.reset(new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); if (EC) { errs() << EC.message() << '\n'; return 1; @@ -620,7 +620,7 @@ int main(int argc, char **argv) { if (!ThinLinkBitcodeFile.empty()) { ThinLinkOut.reset( - new ToolOutputFile(ThinLinkBitcodeFile, EC, sys::fs::F_None)); + new ToolOutputFile(ThinLinkBitcodeFile, EC, sys::fs::OF_None)); if (EC) { errs() << EC.message() << '\n'; return 1; @@ -721,7 +721,7 @@ int main(int argc, char **argv) { std::error_code EC; Out = llvm::make_unique<ToolOutputFile>(OutputFilename, EC, - sys::fs::F_None); + sys::fs::OF_None); if (EC) { errs() << EC.message() << '\n'; return 1; diff --git a/llvm/tools/verify-uselistorder/verify-uselistorder.cpp b/llvm/tools/verify-uselistorder/verify-uselistorder.cpp index 527ba37bcc5..f61d23940fb 100644 --- a/llvm/tools/verify-uselistorder/verify-uselistorder.cpp +++ b/llvm/tools/verify-uselistorder/verify-uselistorder.cpp @@ -123,7 +123,7 @@ bool TempFile::init(const std::string &Ext) { bool TempFile::writeBitcode(const Module &M) const { LLVM_DEBUG(dbgs() << " - write bitcode\n"); std::error_code EC; - raw_fd_ostream OS(Filename, EC, sys::fs::F_None); + raw_fd_ostream OS(Filename, EC, sys::fs::OF_None); if (EC) { errs() << "verify-uselistorder: error: " << EC.message() << "\n"; return true; @@ -136,7 +136,7 @@ bool TempFile::writeBitcode(const Module &M) const { bool TempFile::writeAssembly(const Module &M) const { LLVM_DEBUG(dbgs() << " - write assembly\n"); std::error_code EC; - raw_fd_ostream OS(Filename, EC, sys::fs::F_Text); + raw_fd_ostream OS(Filename, EC, sys::fs::OF_Text); if (EC) { errs() << "verify-uselistorder: error: " << EC.message() << "\n"; return true; diff --git a/llvm/tools/yaml2obj/yaml2obj.cpp b/llvm/tools/yaml2obj/yaml2obj.cpp index f2266401da7..533c8ea1446 100644 --- a/llvm/tools/yaml2obj/yaml2obj.cpp +++ b/llvm/tools/yaml2obj/yaml2obj.cpp @@ -77,7 +77,7 @@ int main(int argc, char **argv) { std::error_code EC; std::unique_ptr<ToolOutputFile> Out( - new ToolOutputFile(OutputFilename, EC, sys::fs::F_None)); + new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); if (EC) error("yaml2obj: Error opening '" + OutputFilename + "': " + EC.message()); diff --git a/llvm/unittests/BinaryFormat/TestFileMagic.cpp b/llvm/unittests/BinaryFormat/TestFileMagic.cpp index 22c26df3080..9ed707bb5b3 100644 --- a/llvm/unittests/BinaryFormat/TestFileMagic.cpp +++ b/llvm/unittests/BinaryFormat/TestFileMagic.cpp @@ -123,7 +123,7 @@ TEST_F(MagicTest, Magic) { SmallString<128> file_pathname(TestDirectory); llvm::sys::path::append(file_pathname, i->filename); std::error_code EC; - raw_fd_ostream file(file_pathname, EC, sys::fs::F_None); + raw_fd_ostream file(file_pathname, EC, sys::fs::OF_None); ASSERT_FALSE(file.has_error()); StringRef magic(i->magic_str, i->magic_str_len); file << magic; diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp index f336b0eebda..d2c0f3c3b20 100644 --- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp @@ -531,7 +531,7 @@ bool dwarfgen::Generator::saveFile(StringRef Path) { if (FileBytes.empty()) return false; std::error_code EC; - raw_fd_ostream Strm(Path, EC, sys::fs::F_None); + raw_fd_ostream Strm(Path, EC, sys::fs::OF_None); if (EC) return false; Strm.write(FileBytes.data(), FileBytes.size()); diff --git a/llvm/unittests/ProfileData/SampleProfTest.cpp b/llvm/unittests/ProfileData/SampleProfTest.cpp index a9a8b119688..450dcd02346 100644 --- a/llvm/unittests/ProfileData/SampleProfTest.cpp +++ b/llvm/unittests/ProfileData/SampleProfTest.cpp @@ -44,7 +44,7 @@ struct SampleProfTest : ::testing::Test { void createWriter(SampleProfileFormat Format, StringRef Profile) { std::error_code EC; std::unique_ptr<raw_ostream> OS( - new raw_fd_ostream(Profile, EC, sys::fs::F_None)); + new raw_fd_ostream(Profile, EC, sys::fs::OF_None)); auto WriterOrErr = SampleProfileWriter::create(OS, Format); ASSERT_TRUE(NoError(WriterOrErr.getError())); Writer = std::move(WriterOrErr.get()); diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index ccd72d7f176..5e0581c945b 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -1021,7 +1021,7 @@ TEST_F(FileSystemTest, CarriageReturn) { path::append(FilePathname, "test"); { - raw_fd_ostream File(FilePathname, EC, sys::fs::F_Text); + raw_fd_ostream File(FilePathname, EC, sys::fs::OF_Text); ASSERT_NO_ERROR(EC); File << '\n'; } @@ -1032,7 +1032,7 @@ TEST_F(FileSystemTest, CarriageReturn) { } { - raw_fd_ostream File(FilePathname, EC, sys::fs::F_None); + raw_fd_ostream File(FilePathname, EC, sys::fs::OF_None); ASSERT_NO_ERROR(EC); File << '\n'; } @@ -1418,7 +1418,7 @@ TEST_F(FileSystemTest, AppendSetsCorrectFileOffset) { fs::CD_OpenExisting}; // Write some data and re-open it with every possible disposition (this is a - // hack that shouldn't work, but is left for compatibility. F_Append + // hack that shouldn't work, but is left for compatibility. OF_Append // overrides // the specified disposition. for (fs::CreationDisposition Disp : Disps) { diff --git a/llvm/unittests/Support/raw_ostream_test.cpp b/llvm/unittests/Support/raw_ostream_test.cpp index 4ce4917fcea..497d31317ce 100644 --- a/llvm/unittests/Support/raw_ostream_test.cpp +++ b/llvm/unittests/Support/raw_ostream_test.cpp @@ -339,7 +339,7 @@ TEST(raw_ostreamTest, FormattedHexBytes) { TEST(raw_fd_ostreamTest, multiple_raw_fd_ostream_to_stdout) { std::error_code EC; - { raw_fd_ostream("-", EC, sys::fs::OpenFlags::F_None); } - { raw_fd_ostream("-", EC, sys::fs::OpenFlags::F_None); } + { raw_fd_ostream("-", EC, sys::fs::OpenFlags::OF_None); } + { raw_fd_ostream("-", EC, sys::fs::OpenFlags::OF_None); } } } diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp index b9cb568ff64..9276dfab787 100644 --- a/polly/lib/Exchange/JSONExporter.cpp +++ b/polly/lib/Exchange/JSONExporter.cpp @@ -178,7 +178,7 @@ static void exportScop(Scop &S) { // Write to file. std::error_code EC; - ToolOutputFile F(FileName, EC, llvm::sys::fs::F_Text); + ToolOutputFile F(FileName, EC, llvm::sys::fs::OF_Text); std::string FunctionName = S.getFunction().getName(); errs() << "Writing JScop '" << S.getNameStr() << "' in function '" diff --git a/polly/lib/Support/DumpModulePass.cpp b/polly/lib/Support/DumpModulePass.cpp index 615fd75b97e..e190ee672b7 100644 --- a/polly/lib/Support/DumpModulePass.cpp +++ b/polly/lib/Support/DumpModulePass.cpp @@ -63,7 +63,7 @@ public: std::unique_ptr<ToolOutputFile> Out; std::error_code EC; - Out.reset(new ToolOutputFile(Dumpfile, EC, sys::fs::F_None)); + Out.reset(new ToolOutputFile(Dumpfile, EC, sys::fs::OF_None)); if (EC) { errs() << EC.message() << '\n'; return false; |