[PATCH] D135551: [clang] replace `assert(0)` with `llvm_unreachable` NFC

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 13 07:15:39 PDT 2022


probinson added a comment.

dblaikie:

> In the same way that an assert says "This condition should never be false" - I use "should" in the same sense in both unreachable and assert, and I believe that's the prevailing opinion of LLVM developers/the LLVM style guide.

aaronballman:

> I believe our code base says something different than our "prevailing opinion" and we should not be discounting the reality of how our code is written today.

So, there are lots of ways and places where "the reality of how our code is written today" fails to conform to the style guide.
One conclusion is that the style guide is wrong and should be changed to reflect reality.
Another conclusion is that conforming to the style guide is the goal and one aspect of development is to strive to reach the goal. The imperfection of the state of the code today merely reflects an imperfect understanding of the goal.

I suggest a Round Table at the (less than one month away) Dev Meeting, assuming that the active parties in this discussion will be there. Put off any RFC until after that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135551/new/

https://reviews.llvm.org/D135551



More information about the cfe-commits mailing list