summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_handlers.cc
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-31 06:16:47 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-31 06:16:47 +0000
commit9202515bf430858117d117d98136a865feb1a281 (patch)
treed1bc91b1ec5367dc7c44d08c1d1c68859a1f53f8 /lib/ubsan/ubsan_handlers.cc
parent7ba7f0d7f2df4a55e376b0477fc3268a82588bf3 (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.cc13
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) {