<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Sep 19, 2011, at 2:37 PM, David Blaikie wrote:</div><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">We generally prefer llvm_unreachable to assert(0)</div></blockquote><div><br></div>
<div>we do (specifically just clang, or llvm as a whole)? I've seen some variation in this & when someone was fixing up the assert("foo")s in the code to assert(0 && "foo")s a week or two ago I thought about suggesting they be llvm_unreachables instead, but when I searched I think I found an email by Chris Lattner saying that assert(0 && "foo") was preferred (I can see if I can find it again).<br></div></div></blockquote><div><br></div>This is what I and several others recommend for Clang.  There are several theoretical advantages to llvm_unreachable, plus it's just clearer.  Really, the only disadvantage is that the name's a bit long and unwieldy.</div><div><br></div><div>I think Chris has gone back and forward about it.  It *used* to actually be a performance issue because it didn't completely compile away in non-assertions builds, but that's no longer true, at least when built by Clang.</div><div><br></div><div>John.</div></body></html>