forked from OSchip/llvm-project
parent
ac27f730d7
commit
0941b568ce
|
@ -496,12 +496,11 @@ static bool createManifestResourceFile(PECOFFLinkingContext &ctx,
|
|||
llvm::FileRemover rcFileRemover((Twine(rcFile)));
|
||||
|
||||
// Open the temporary file for writing.
|
||||
std::string errorInfo;
|
||||
llvm::raw_fd_ostream out(rcFileSmallString.c_str(), errorInfo,
|
||||
llvm::sys::fs::F_Text);
|
||||
if (!errorInfo.empty()) {
|
||||
std::error_code EC;
|
||||
llvm::raw_fd_ostream out(rcFileSmallString, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
diag << "Failed to open " << ctx.getManifestOutputPath() << ": "
|
||||
<< errorInfo << "\n";
|
||||
<< EC.message() << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -571,10 +570,10 @@ static bool createSideBySideManifestFile(PECOFFLinkingContext &ctx,
|
|||
path.append(".manifest");
|
||||
}
|
||||
|
||||
std::string errorInfo;
|
||||
llvm::raw_fd_ostream out(path.c_str(), errorInfo, llvm::sys::fs::F_Text);
|
||||
if (!errorInfo.empty()) {
|
||||
diag << errorInfo << "\n";
|
||||
std::error_code EC;
|
||||
llvm::raw_fd_ostream out(path, EC, llvm::sys::fs::F_Text);
|
||||
if (EC) {
|
||||
diag << EC.message() << "\n";
|
||||
return false;
|
||||
}
|
||||
out << createManifestXml(ctx);
|
||||
|
|
|
@ -66,11 +66,10 @@ public:
|
|||
// construct file header based on atom information accumulated
|
||||
this->makeHeader();
|
||||
|
||||
std::string errorInfo;
|
||||
llvm::raw_fd_ostream out(outPath.data(), errorInfo,
|
||||
llvm::sys::fs::F_None);
|
||||
if (!errorInfo.empty())
|
||||
return std::error_code(); // FIXME
|
||||
std::error_code ec;
|
||||
llvm::raw_fd_ostream out(outPath.data(), ec, llvm::sys::fs::F_None);
|
||||
if (ec)
|
||||
return ec;
|
||||
|
||||
this->write(out);
|
||||
|
||||
|
|
|
@ -1245,10 +1245,10 @@ public:
|
|||
|
||||
std::error_code writeFile(const lld::File &file, StringRef outPath) override {
|
||||
// Create stream to path.
|
||||
std::string errorInfo;
|
||||
llvm::raw_fd_ostream out(outPath.data(), errorInfo, llvm::sys::fs::F_Text);
|
||||
if (!errorInfo.empty())
|
||||
return make_error_code(llvm::errc::no_such_file_or_directory);
|
||||
std::error_code ec;
|
||||
llvm::raw_fd_ostream out(outPath.data(), ec, llvm::sys::fs::F_Text);
|
||||
if (ec)
|
||||
return ec;
|
||||
|
||||
// Create yaml Output writer, using yaml options for context.
|
||||
YamlContext yamlContext;
|
||||
|
|
Loading…
Reference in New Issue