Use a private compilerrt_abort() define instead of calling abort directly.
- Fiddling with abort directly is annoying given the way we use system includes, although it would be nice to fix this so we could make sure calling abort directly is verboten.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@100014 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/absvdi2.c b/lib/absvdi2.c
index 396802c..919afd1 100644
--- a/lib/absvdi2.c
+++ b/lib/absvdi2.c
@@ -24,7 +24,7 @@
{
const int N = (int)(sizeof(di_int) * CHAR_BIT);
if (a == ((di_int)1 << (N-1)))
- abort();
+ compilerrt_abort();
const di_int t = a >> (N - 1);
return (a ^ t) - t;
}
diff --git a/lib/absvsi2.c b/lib/absvsi2.c
index 0c08bf0..a2c8e3f 100644
--- a/lib/absvsi2.c
+++ b/lib/absvsi2.c
@@ -24,7 +24,7 @@
{
const int N = (int)(sizeof(si_int) * CHAR_BIT);
if (a == (1 << (N-1)))
- abort();
+ compilerrt_abort();
const si_int t = a >> (N - 1);
return (a ^ t) - t;
}
diff --git a/lib/absvti2.c b/lib/absvti2.c
index c71275e..0978122 100644
--- a/lib/absvti2.c
+++ b/lib/absvti2.c
@@ -26,7 +26,7 @@
{
const int N = (int)(sizeof(ti_int) * CHAR_BIT);
if (a == ((ti_int)1 << (N-1)))
- abort();
+ compilerrt_abort();
const ti_int s = a >> (N - 1);
return (a ^ s) - s;
}
diff --git a/lib/addvdi3.c b/lib/addvdi3.c
index 8b885f5..53ab102 100644
--- a/lib/addvdi3.c
+++ b/lib/addvdi3.c
@@ -26,12 +26,12 @@
if (b >= 0)
{
if (s < a)
- abort();
+ compilerrt_abort();
}
else
{
if (s >= a)
- abort();
+ compilerrt_abort();
}
return s;
}
diff --git a/lib/addvsi3.c b/lib/addvsi3.c
index 603c680..22cd315 100644
--- a/lib/addvsi3.c
+++ b/lib/addvsi3.c
@@ -26,12 +26,12 @@
if (b >= 0)
{
if (s < a)
- abort();
+ compilerrt_abort();
}
else
{
if (s >= a)
- abort();
+ compilerrt_abort();
}
return s;
}
diff --git a/lib/addvti3.c b/lib/addvti3.c
index afc3e3b..3df1a74 100644
--- a/lib/addvti3.c
+++ b/lib/addvti3.c
@@ -28,12 +28,12 @@
if (b >= 0)
{
if (s < a)
- abort();
+ compilerrt_abort();
}
else
{
if (s >= a)
- abort();
+ compilerrt_abort();
}
return s;
}
diff --git a/lib/clear_cache.c b/lib/clear_cache.c
index 1456823..ddc48bc 100644
--- a/lib/clear_cache.c
+++ b/lib/clear_cache.c
@@ -33,7 +33,7 @@
/* On Darwin, sys_icache_invalidate() provides this functionality */
sys_icache_invalidate(start, end-start);
#else
- abort();
+ compilerrt_abort();
#endif
#endif
}
diff --git a/lib/eprintf.c b/lib/eprintf.c
index 8d9ce32..786fe6a 100644
--- a/lib/eprintf.c
+++ b/lib/eprintf.c
@@ -10,6 +10,7 @@
+#include "int_lib.h"
#include <stdio.h>
#include <stdlib.h>
@@ -28,5 +29,5 @@
{
fprintf(stderr, format, assertion_expression, line, file);
fflush(stderr);
- abort();
+ compilerrt_abort();
}
diff --git a/lib/gcc_personality_v0.c b/lib/gcc_personality_v0.c
index b0d93b8..862b605 100644
--- a/lib/gcc_personality_v0.c
+++ b/lib/gcc_personality_v0.c
@@ -142,7 +142,7 @@
case DW_EH_PE_sleb128:
default:
/* not supported */
- abort();
+ compilerrt_abort();
break;
}
@@ -160,7 +160,7 @@
case DW_EH_PE_aligned:
default:
/* not supported */
- abort();
+ compilerrt_abort();
break;
}
diff --git a/lib/int_lib.h b/lib/int_lib.h
index f37d500..f6c2dd4 100644
--- a/lib/int_lib.h
+++ b/lib/int_lib.h
@@ -23,6 +23,8 @@
#include "endianness.h"
#include <math.h>
+#define compilerrt_abort() abort()
+
#if !defined(INFINITY) && defined(HUGE_VAL)
#define INFINITY HUGE_VAL
#endif /* INFINITY */
diff --git a/lib/mulvdi3.c b/lib/mulvdi3.c
index ebb7769..295ae18 100644
--- a/lib/mulvdi3.c
+++ b/lib/mulvdi3.c
@@ -29,13 +29,13 @@
{
if (b == 0 || b == 1)
return a * b;
- abort();
+ compilerrt_abort();
}
if (b == MIN)
{
if (a == 0 || a == 1)
return a * b;
- abort();
+ compilerrt_abort();
}
di_int sa = a >> (N - 1);
di_int abs_a = (a ^ sa) - sa;
@@ -46,12 +46,12 @@
if (sa == sb)
{
if (abs_a > MAX / abs_b)
- abort();
+ compilerrt_abort();
}
else
{
if (abs_a > MIN / -abs_b)
- abort();
+ compilerrt_abort();
}
return a * b;
}
diff --git a/lib/mulvsi3.c b/lib/mulvsi3.c
index 9edeee2..b4a509b 100644
--- a/lib/mulvsi3.c
+++ b/lib/mulvsi3.c
@@ -29,13 +29,13 @@
{
if (b == 0 || b == 1)
return a * b;
- abort();
+ compilerrt_abort();
}
if (b == MIN)
{
if (a == 0 || a == 1)
return a * b;
- abort();
+ compilerrt_abort();
}
si_int sa = a >> (N - 1);
si_int abs_a = (a ^ sa) - sa;
@@ -46,12 +46,12 @@
if (sa == sb)
{
if (abs_a > MAX / abs_b)
- abort();
+ compilerrt_abort();
}
else
{
if (abs_a > MIN / -abs_b)
- abort();
+ compilerrt_abort();
}
return a * b;
}
diff --git a/lib/mulvti3.c b/lib/mulvti3.c
index 080cd63..778222e 100644
--- a/lib/mulvti3.c
+++ b/lib/mulvti3.c
@@ -31,13 +31,13 @@
{
if (b == 0 || b == 1)
return a * b;
- abort();
+ compilerrt_abort();
}
if (b == MIN)
{
if (a == 0 || a == 1)
return a * b;
- abort();
+ compilerrt_abort();
}
ti_int sa = a >> (N - 1);
ti_int abs_a = (a ^ sa) - sa;
@@ -48,12 +48,12 @@
if (sa == sb)
{
if (abs_a > MAX / abs_b)
- abort();
+ compilerrt_abort();
}
else
{
if (abs_a > MIN / -abs_b)
- abort();
+ compilerrt_abort();
}
return a * b;
}
diff --git a/lib/negvdi2.c b/lib/negvdi2.c
index df8a698..0baf377 100644
--- a/lib/negvdi2.c
+++ b/lib/negvdi2.c
@@ -24,6 +24,6 @@
{
const di_int MIN = (di_int)1 << ((int)(sizeof(di_int) * CHAR_BIT)-1);
if (a == MIN)
- abort();
+ compilerrt_abort();
return -a;
}
diff --git a/lib/negvsi2.c b/lib/negvsi2.c
index a7fbbbd..e5a36a5 100644
--- a/lib/negvsi2.c
+++ b/lib/negvsi2.c
@@ -24,6 +24,6 @@
{
const si_int MIN = (si_int)1 << ((int)(sizeof(si_int) * CHAR_BIT)-1);
if (a == MIN)
- abort();
+ compilerrt_abort();
return -a;
}
diff --git a/lib/negvti2.c b/lib/negvti2.c
index df44935..d56e1e3 100644
--- a/lib/negvti2.c
+++ b/lib/negvti2.c
@@ -26,7 +26,7 @@
{
const ti_int MIN = (ti_int)1 << ((int)(sizeof(ti_int) * CHAR_BIT)-1);
if (a == MIN)
- abort();
+ compilerrt_abort();
return -a;
}
diff --git a/lib/subvdi3.c b/lib/subvdi3.c
index 0261a5d..e4926b8 100644
--- a/lib/subvdi3.c
+++ b/lib/subvdi3.c
@@ -26,12 +26,12 @@
if (b >= 0)
{
if (s > a)
- abort();
+ compilerrt_abort();
}
else
{
if (s <= a)
- abort();
+ compilerrt_abort();
}
return s;
}
diff --git a/lib/subvsi3.c b/lib/subvsi3.c
index 3acb40d..ce39c81 100644
--- a/lib/subvsi3.c
+++ b/lib/subvsi3.c
@@ -26,12 +26,12 @@
if (b >= 0)
{
if (s > a)
- abort();
+ compilerrt_abort();
}
else
{
if (s <= a)
- abort();
+ compilerrt_abort();
}
return s;
}
diff --git a/lib/subvti3.c b/lib/subvti3.c
index 2446410..55b7925 100644
--- a/lib/subvti3.c
+++ b/lib/subvti3.c
@@ -28,12 +28,12 @@
if (b >= 0)
{
if (s > a)
- abort();
+ compilerrt_abort();
}
else
{
if (s <= a)
- abort();
+ compilerrt_abort();
}
return s;
}
diff --git a/lib/trampoline_setup.c b/lib/trampoline_setup.c
index d62e36b..551d4d0 100644
--- a/lib/trampoline_setup.c
+++ b/lib/trampoline_setup.c
@@ -28,7 +28,7 @@
/* should never happen, but if compiler did not allocate */
/* enough space on stack for the trampoline, abort */
if ( trampSizeAllocated < 40 )
- abort();
+ compilerrt_abort();
/* create trampoline */
trampOnStack[0] = 0x7c0802a6; /* mflr r0 */