diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-06-18 05:13:11 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-06-18 05:13:11 +0000 |
commit | cf36016a0b31e591d27f5ddab86efb73a59a24e8 (patch) | |
tree | a98d7e47435ccab94d3feb8dfba781174511bf00 | |
parent | 2a30d7889fc54c8a74d73b79be3dd030bac41b06 (diff) | |
download | bcm5719-llvm-cf36016a0b31e591d27f5ddab86efb73a59a24e8.tar.gz bcm5719-llvm-cf36016a0b31e591d27f5ddab86efb73a59a24e8.zip |
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
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 869296ad842..adc4c4a04b2 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -5370,7 +5370,9 @@ static void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E, 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 @@ static void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E, // 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."); } } |