This is an archive of the discontinued LLVM Phabricator instance.

[docs] Fix self-contradictory description of llvm_unreachable
ClosedPublic

Authored by jkorous on Jun 3 2020, 8:47 PM.

Details

Summary

Just two paragraphs above it says:

If the compiler does not support this [skipping code generation for a particular branch], it will fall back to the "abort" implementation.

And that actually correctly describes current llvm_unreachable implementation.
https://llvm.org/docs/CodingStandards.html#assert-liberally

Alternatively, if we agree that llvm_unreachable should really have an assert-like semantics then we can make the call to abort in llvm_unreachable_internal conditional on #ifndef NDEBUG.
https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/ErrorHandling.cpp#L210
That would've to be approved by more people though.

Diff Detail

Event Timeline

jkorous created this revision.Jun 3 2020, 8:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2020, 8:47 PM
aaron.ballman accepted this revision.Jun 4 2020, 9:12 AM

LGTM! Thank you for these fixes; the changes do a good job of describing the current behavior of the APIs. If you'd like to propose a behavioral change, I agree that should be done with an RFC to the community.

This revision is now accepted and ready to land.Jun 4 2020, 9:12 AM
This revision was automatically updated to reflect the committed changes.