[llvm-commits] [PATCH] Transforming assertions into OCaml exceptions

Nathan Jeffords blunted2night at gmail.com
Sun Jun 13 02:13:57 PDT 2010


Assertions often detect problems after the state of the program becomes
corrupted. Exceptions are generally assumed to occur prior an operation that
may cause corruption such that the state of the system is known at whatever
point the exception is handled.

On Sat, Jun 12, 2010 at 9:43 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Jun 11, 2010, at 3:35 PM, Patrick Walton wrote:
>
> > Hi,
> >
> > This patch builds on the previous one
> (llvm-pcwalton-configurable-assertions.diff) and transforms assertions into
> exceptions in the OCaml bindings.
>
> I'm not sure this is the right way to go.  Assertions should *never*
> trigger, they are not a checked condition.  Transforming them into an
> exception is incorrect, because in certain build modes assertions are noops
> (the checks are not compiled in).
>
> -Chris
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100613/89eca7b8/attachment.html>


More information about the llvm-commits mailing list