diff options
author | Rafael Auler <rafaelauler@gmail.com> | 2014-11-03 05:26:18 +0000 |
---|---|---|
committer | Rafael Auler <rafaelauler@gmail.com> | 2014-11-03 05:26:18 +0000 |
commit | d301b9b3e00408183e903069a3eb9d40ea23afbe (patch) | |
tree | 2c0041ffe1adaa3e07573efeb1537fc33886153e | |
parent | 554797f25538e191d25ed7f0343655b89d6b9d44 (diff) | |
download | bcm5719-llvm-d301b9b3e00408183e903069a3eb9d40ea23afbe.tar.gz bcm5719-llvm-d301b9b3e00408183e903069a3eb9d40ea23afbe.zip |
[LinkerScript] Change ErrorOr usage to fix MSVC2012 buildbots
Number parsing functions used an ErrorOr<> idiom that is not supported in
MSVC2012. This patch fixes this.
llvm-svn: 221128
-rw-r--r-- | lld/lib/ReaderWriter/LinkerScript.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/lib/ReaderWriter/LinkerScript.cpp b/lld/lib/ReaderWriter/LinkerScript.cpp index 52693eaeacd..3984408b605 100644 --- a/lld/lib/ReaderWriter/LinkerScript.cpp +++ b/lld/lib/ReaderWriter/LinkerScript.cpp @@ -94,7 +94,7 @@ static llvm::ErrorOr<uint64_t> parseDecimal(StringRef str) { for (auto &c : str) { res *= 10; if (c < '0' || c > '9') - return std::errc::io_error; + return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error)); res += c - '0'; } return res; @@ -105,7 +105,7 @@ static llvm::ErrorOr<uint64_t> parseOctal(StringRef str) { for (auto &c : str) { res <<= 3; if (c < '0' || c > '7') - return std::errc::io_error; + return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error)); res += c - '0'; } return res; @@ -116,7 +116,7 @@ static llvm::ErrorOr<uint64_t> parseBinary(StringRef str) { for (auto &c : str) { res <<= 1; if (c != '0' && c != '1') - return std::errc::io_error; + return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error)); res += c - '0'; } return res; @@ -133,7 +133,7 @@ static llvm::ErrorOr<uint64_t> parseHex(StringRef str) { else if (c >= 'A' && c <= 'F') res += c - 'A' + 10; else - return std::errc::io_error; + return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error)); } return res; } |