diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-12-31 06:16:47 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-12-31 06:16:47 +0000 |
commit | 9202515bf430858117d117d98136a865feb1a281 (patch) | |
tree | d1bc91b1ec5367dc7c44d08c1d1c68859a1f53f8 /lib/ubsan/ubsan_handlers.cc | |
parent | 7ba7f0d7f2df4a55e376b0477fc3268a82588bf3 (diff) |
Revert r171273 which doesn't actually compile.
Original commit message:
[ubsan] Don't suggest casting to unsigned for unsigned unary minus overflow.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/ubsan_handlers.cc')
-rw-r--r-- | lib/ubsan/ubsan_handlers.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/ubsan/ubsan_handlers.cc b/lib/ubsan/ubsan_handlers.cc index 562a90308..5e73c04ee 100644 --- a/lib/ubsan/ubsan_handlers.cc +++ b/lib/ubsan/ubsan_handlers.cc @@ -103,15 +103,10 @@ void __ubsan::__ubsan_handle_mul_overflow_abort(OverflowData *Data, void __ubsan::__ubsan_handle_negate_overflow(OverflowData *Data, ValueHandle OldVal) { - if (Data->Type.isSignedIntegerTy()) - Diag(Loc, DL_Error, - "negation of %0 cannot be represented in type %1; " - "cast to an unsigned type to negate this value to itself") - << Value(Data->Type, OldVal) << Data->Type; - else - Diag(Loc, DL_Error, - "negation of %0 cannot be represented in type %1") - << Value(Data->Type, OldVal) << Data->Type; + Diag(Data->Loc, DL_Error, + "negation of %0 cannot be represented in type %1; " + "cast to an unsigned type to negate this value to itself") + << Value(Data->Type, OldVal) << Data->Type; } void __ubsan::__ubsan_handle_negate_overflow_abort(OverflowData *Data, ValueHandle OldVal) { |