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();
}
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);
}
}
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();
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";
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)
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);
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");
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;
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);
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;
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)
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);
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);
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);
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)
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)
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);
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());
}
// 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();
// 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");
}
// 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();
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");
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() + ")");
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>();
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;
/// 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) {
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)
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;
// 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;
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) {
// 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
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;
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;
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;
}
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");
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");
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;
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)
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);
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);
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());
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");
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;
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);
} 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;
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);
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());
}
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());
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());
// 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';
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;
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();
}
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";
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);
{
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);
}
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();
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);
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;
// 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)
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*/);
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;
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;
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();
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);
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);
}
}
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);
}
}
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();
}
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();
}
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());
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));
};
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();
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;
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;
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) {
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";
}
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);
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);
}
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);
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);
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;
}
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);
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);
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);
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);
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);
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;
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;
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;
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;
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;
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());
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;
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());
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());
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';
}
}
{
- 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';
}
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) {
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); }
}
}