[rustllvm] Use report_fatal_error over llvm_unreachable

This makes it more robust when assertions are disabled,
crashing instead of causing UB.

Also introduces a tidy check to enforce this rule,
which in turn necessitated making tidy run on src/rustllvm.

Fixes #44020
This commit is contained in:
Robin Kruppe 2017-11-20 17:47:29 +01:00
parent 26e881d00f
commit 296aa96deb
5 changed files with 37 additions and 30 deletions

View file

@ -66,7 +66,7 @@ static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
case LLVMRustArchiveKind::COFF:
return Archive::K_COFF;
default:
llvm_unreachable("Bad ArchiveKind.");
report_fatal_error("Bad ArchiveKind.");
}
}