search for: llvm_verify

Displaying 2 results from an estimated 2 matches for "llvm_verify".

2020 Apr 09
2
[RFC] Usage of NDEBUG as a guard for non-assert debug code
...s not, complain with msg. > > LLVM_ASSERT(expr, msg) > > > > // If asserts are enabled, evaluate and assert that expr is truthy. If it > is not, complain with msg. > > // If asserts are disabled, evaluate expr, do not assert. > > // either way, return expr > > LLVM_VERIFY(expr, msg) > > > > The first one is useful as a traditional assert. The second one is > useful if you are calling a function, and want to assert that it succeeds, > but still need it to be evaluated in release builds: > > > > auto *Foo = LLVM_VERIFY(ReturnsAPointerT...
2020 Apr 09
7
[RFC] Usage of NDEBUG as a guard for non-assert debug code
Hi all, During discussions about assertions in the Flang project, we noticed that there are a lot of cases in LLVM that #ifndef NDEBUG is used as a guard for non-assert code that we want enabled in debug builds. This works fine on its own, however it affects the behaviour of LLVM_ENABLE_ASSERTIONS; since NDEBUG controls whether assertions are enabled or not, a lot of debug code gets enabled in