[clang] [llvm] [OpenMP][OMPIRBuilder] Handle non-failing calls properly (PR #115863)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 13:20:48 PST 2024


Meinersbur wrote:

`cantFail` is not guaranteed to crash, e.g. in `-DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_UNREACHABLE_OPTIMIZE=ON`. I think this is fine for implementation code, for which `LLVM_UNREACHABLE_OPTIMIZE` is meant to improve performance, but for unittests such tests could silently pass in release builds. 

Ideas:
 * `ASSERT_FALSE(errorToBool(Err))`
 * `if (Err) report_fatal_error(Err)`
 * Some new helper function

https://github.com/llvm/llvm-project/pull/115863


More information about the cfe-commits mailing list