Convert an llvm_unreachable in an 'else' block to a removal of the 'if' and an assertion of its condition. Suggestion from David Blaikie.
llvm-svn: 211142
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 869296a..adc4c4a 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5370,7 +5370,9 @@
if (OtherRange.NonNegative) {
if (OtherWidth >= Value.getActiveBits())
return;
- } else if (!OtherRange.NonNegative && !ConstantSigned) {
+ } else { // OtherSigned
+ assert(!ConstantSigned &&
+ "Two signed types converted to unsigned types.");
// Check to see if the constant is representable in OtherT.
if (OtherWidth > Value.getActiveBits())
return;
@@ -5384,8 +5386,6 @@
// after conversion. Relational comparison still works, but equality
// comparisons will be tautological.
EqualityOnly = true;
- } else { // OtherSigned && ConstantSigned
- llvm_unreachable("Two signed types converted to unsigned types.");
}
}