The comment where llvm_unreachable says
Marks that the current location is not supposed to be reachable. In !NDEBUG builds, prints the message and location info to stderr. In NDEBUG builds, if the platform does not support a builtin unreachable then we call an internal LLVM runtime function. Otherwise the behavior is controlled by the CMake flag -DLLVM_UNREACHABLE_OPTIMIZE * When "ON" (default) llvm_unreachable() becomes an optimizer hint that the current location is not supposed to be reachable: the hint turns such code path into undefined behavior. On compilers that don't support such hints, prints a reduced message instead and aborts the program. * When "OFF", a builtin_trap is emitted instead of an optimizer hint or printing a reduced message. Use this instead of assert(0). It conveys intent more clearly, suppresses diagnostics for unreachable code paths, and allows compilers to omit unnecessary code.
We have discussions on the discourse here: https://discourse.llvm.org/t/llvm-unreachable-is-widely-misused/60587/8
Link: https://github.com/llvm/llvm-project/blob/50312ea133999cb2aad1ab9ef0ec39429a9427c5/llvm/include/llvm/Support/ErrorHandling.h#L125
Link: https://discourse.llvm.org/t/llvm-unreachable-is-widely-misused/60587/8
This looks like it should probably be: assert(!PassedFirst && "Passed first decl twice, invalid redecl chain!"); rather than an if statement with recovery mechanisms.