[all-commits] [llvm/llvm-project] 24b326: [APFloat] Fix checked error assert failures

Ehud Katz via All-commits all-commits at lists.llvm.org
Wed Jan 8 23:53:58 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 24b326cc610dfdccdd50bc78505ec228d96c8e7a
      https://github.com/llvm/llvm-project/commit/24b326cc610dfdccdd50bc78505ec228d96c8e7a
  Author: Ehud Katz <ehudkatz at gmail.com>
  Date:   2020-01-09 (Thu, 09 Jan 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp
    M clang/lib/Lex/LiteralSupport.cpp
    M llvm/include/llvm/ADT/StringRef.h
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/Support/APFloat.cpp
    M llvm/lib/Support/StringRef.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    M llvm/unittests/ADT/APFloatTest.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list