[lld] r216395 - Update for LLVM api change
Rafael Espindola
rafael.espindola at gmail.com
Mon Aug 25 11:16:56 PDT 2014
Author: rafael
Date: Mon Aug 25 13:16:56 2014
New Revision: 216395
URL: http://llvm.org/viewvc/llvm-project?rev=216395&view=rev
Log:
Update for LLVM api change
Modified:
lld/trunk/lib/Driver/WinLinkDriver.cpp
lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=216395&r1=216394&r2=216395&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Mon Aug 25 13:16:56 2014
@@ -496,12 +496,11 @@ static bool createManifestResourceFile(P
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
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);
Modified: lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp?rev=216395&r1=216394&r2=216395&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp Mon Aug 25 13:16:56 2014
@@ -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);
Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=216395&r1=216394&r2=216395&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Mon Aug 25 13:16:56 2014
@@ -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;
More information about the llvm-commits
mailing list