[LLVMdev] [cfe-dev] Goal for 3.5: Library-friendly headers

Reid Kleckner rnk at google.com
Mon Nov 11 15:50:13 PST 2013


On Mon, Nov 11, 2013 at 11:16 AM, Alp Toker <alp at nuanti.com> wrote:
>
> Even when you have a !NDEBUG build, the platform assert() is pretty
> crummy on Windows and generates, at best a UTF-16 dump, or sometimes
> just pops up a dialog.


Agreed.  We have lots of hacks surrounding this.  See
LLVM_DISABLE_CRASH_REPORTING in lib/Support/Windows/Signals.inc.  I've also
had to change ninja to pass through UTF-16 output from Clang assertion
failures.

Having our own error reporting would be nice for Windows, but it would take
us further away from standard C library features.  We're already using
llvm_unreachable everywhere, so this might not be so bad.

WebKit and other projects take the same approach
> and define their own assertion macros to deal with this portably.
>
> So as far as I can tell, as long as the headers use assert(), they need
> to use our own version in order for the definition to match.
>

Even though I brought it up, the ODR problem feels small enough to skate by
without worrying about it.  The typical use case for embedders is to turn
off NDEBUG so they can debug, which means LLVM's cast<> implementation
might get slow if the linker picks the wrong definition to call from LLVM
libs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131111/64ee7ed1/attachment.html>


More information about the llvm-dev mailing list