Number parsing functions used an ErrorOr<> idiom that is not supported in
MSVC2012. This patch fixes this.
llvm-svn: 221128
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;
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;
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;
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;
}