Displaying 3 results from an estimated 3 matches for "llvm_llasseert_strm".
2011 Jul 27
5
[LLVMdev] Proposal for better assertions in LLVM
...ne LLVM_ASSERT_STRM(expr, args) \
do { if (!(expr)) { \
assertion_prologue(__FILE__, __LINE__); \
errs() << args << "\n"; \
assertion_trap(); \
} while (false)
#endif
/// Assertion macro that behaves like standard C assert().
#define LLVM_ASSERT(expr) LLVM_LLASSEERT_STRM(expr, #expr)
/// Assertion macro that expects two values to be equal, as defined
/// by the equality operator.
#define LLVM_LLASSERT_EQ(expected, actual) \
LLVM_LLASSEERT_STRM(expected == actual, "Expected: " << expected << \
" but actually was "...
2011 Jul 27
0
[LLVMdev] Proposal for better assertions in LLVM
sorry, my previous message got sent too early
I think the macro should look something like this:
#define ASSERT_STRM(cond,expr) \
do {
if (cond) {
std::cerr << expr << std::end;
assertion_trap ();
}
} while (false)
On Tue, Jul 26, 2011 at 7:57 PM, Nathan Jeffords <blunted2night at gmail.com>wrote:
> wrapping the macro's body in:
>
> do { ... } while
2011 Jul 27
3
[LLVMdev] Proposal for better assertions in LLVM
wrapping the macro's body in:
do { ... } while (false)
would make the the macro a proper statement so that:
if (cond)
ASSERT(some_other_cond);
else
do_something_cool ();
compiles as expected.
IMO, it would work as such
#define ASSERT_STM(cond,expr)
On Tue, Jul 26, 2011 at 6:36 PM, Reid Kleckner <reid.kleckner at gmail.com>wrote:
> He wants to be able to resume execution