[APFloat] Fix checked error assert failures
authorEhud Katz <ehudkatz@gmail.com>
Thu, 9 Jan 2020 07:42:32 +0000 (09:42 +0200)
committerEhud Katz <ehudkatz@gmail.com>
Thu, 9 Jan 2020 07:42:32 +0000 (09:42 +0200)
commit24b326cc610dfdccdd50bc78505ec228d96c8e7a
treec3ff8db5608329acfb536b64f40467440145bff0
parent4ebb589629b0d3de0827cab179338836ebb3a8b6
[APFloat] Fix checked error assert failures

`APFLoat::convertFromString` returns `Expected` result, which must be
"checked" if the LLVM_ENABLE_ABI_BREAKING_CHECKS preprocessor flag is
set.
To mark an `Expected` result as "checked" we must consume the `Error`
within.
In many cases, we are only interested in knowing if an error occured,
without the need to examine the error info. This is achieved, easily,
with the `errorToBool()` API.
clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp
clang/lib/Lex/LiteralSupport.cpp
llvm/include/llvm/ADT/StringRef.h
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/Support/APFloat.cpp
llvm/lib/Support/StringRef.cpp
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/unittests/ADT/APFloatTest.cpp