[LLVMdev] Proposal for better assertions in LLVM

Nathan Jeffords blunted2night at gmail.com
Tue Jul 26 19:57:29 PDT 2011


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 from the debugger after
> assertion failure.
>
> Reid
>
> On Tue, Jul 26, 2011 at 8:07 PM, Alistair Lynn <arplynn at gmail.com> wrote:
> > Hi-
> >
> >> Yep, but tripping the debugger is highly non-portable.
> >
> > You're suggesting that inline asm is more portable than calling abort?
> >
> > Alistair
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110726/ce7a2037/attachment.html>


More information about the llvm-dev mailing list