about summary refs log tree commit diff
path: root/src/rustllvm/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2017-11-20 17:47:29 +0100
committerRobin Kruppe <robin.kruppe@gmail.com>2017-11-20 17:47:29 +0100
commit296aa96deb7e7676455db22dcdbaab83d21736ce (patch)
treecedbe77b8edd7432d92a5f13ec8b760ed0be33aa /src/rustllvm/ArchiveWrapper.cpp
parent26e881d00fee7f28bdb7f0562dbcb7f24db43d1a (diff)
downloadrust-296aa96deb7e7676455db22dcdbaab83d21736ce.tar.gz
rust-296aa96deb7e7676455db22dcdbaab83d21736ce.zip
[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
Diffstat (limited to 'src/rustllvm/ArchiveWrapper.cpp')
-rw-r--r--src/rustllvm/ArchiveWrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustllvm/ArchiveWrapper.cpp b/src/rustllvm/ArchiveWrapper.cpp
index 7f76861c077..591ebdc9ddb 100644
--- a/src/rustllvm/ArchiveWrapper.cpp
+++ b/src/rustllvm/ArchiveWrapper.cpp
@@ -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.");
   }
 }