Skip to content

Commit e073717

Browse files
authored
[libc++abi] Rename abort_message to __abort_message (#111413)
This is an internal API and the name should reflect that. This is a reland of #108887.
1 parent 4605ba0 commit e073717

11 files changed

+25
-25
lines changed

libcxxabi/src/abort_message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# define _LIBCXXABI_USE_CRASHREPORTER_CLIENT
2727
#endif
2828

29-
void abort_message(const char* format, ...)
29+
void __abort_message(const char* format, ...)
3030
{
3131
// Write message to stderr. We do this before formatting into a
3232
// variable-size buffer so that we still get some information if

libcxxabi/src/abort_message.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
#include "cxxabi.h"
1313

1414
extern "C" _LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void
15-
abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
15+
__abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
1616

1717
#ifndef _LIBCXXABI_ASSERT
1818
# define _LIBCXXABI_ASSERT(expr, msg) \
1919
do { \
2020
if (!(expr)) { \
2121
char const* __msg = (msg); \
22-
::abort_message("%s:%d: %s", __FILE__, __LINE__, __msg); \
22+
::__abort_message("%s:%d: %s", __FILE__, __LINE__, __msg); \
2323
} \
2424
} while (false)
2525

libcxxabi/src/cxa_default_handlers.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ static void demangling_terminate_handler()
3030

3131
// If there is no uncaught exception, just note that we're terminating
3232
if (!globals)
33-
abort_message("terminating");
33+
__abort_message("terminating");
3434

3535
__cxa_exception* exception_header = globals->caughtExceptions;
3636
if (!exception_header)
37-
abort_message("terminating");
37+
__abort_message("terminating");
3838

3939
_Unwind_Exception* unwind_exception =
4040
reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1;
4141

4242
// If we're terminating due to a foreign exception
4343
if (!__isOurExceptionClass(unwind_exception))
44-
abort_message("terminating due to %s foreign exception", cause);
44+
__abort_message("terminating due to %s foreign exception", cause);
4545

4646
void* thrown_object =
4747
__getExceptionClass(unwind_exception) == kOurDependentExceptionClass ?
@@ -67,19 +67,19 @@ static void demangling_terminate_handler()
6767
{
6868
// Include the what() message from the exception
6969
const std::exception* e = static_cast<const std::exception*>(thrown_object);
70-
abort_message("terminating due to %s exception of type %s: %s", cause, name, e->what());
70+
__abort_message("terminating due to %s exception of type %s: %s", cause, name, e->what());
7171
}
7272
else
7373
{
7474
// Else just note that we're terminating due to an exception
75-
abort_message("terminating due to %s exception of type %s", cause, name);
75+
__abort_message("terminating due to %s exception of type %s", cause, name);
7676
}
7777
}
7878
#else // !_LIBCXXABI_NO_EXCEPTIONS
7979
__attribute__((noreturn))
8080
static void demangling_terminate_handler()
8181
{
82-
abort_message("terminating");
82+
__abort_message("terminating");
8383
}
8484
#endif // !_LIBCXXABI_NO_EXCEPTIONS
8585

libcxxabi/src/cxa_exception_storage.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ namespace {
6161
void _LIBCPP_TLS_DESTRUCTOR_CC destruct_(void *p) {
6262
__free_with_fallback(p);
6363
if (0 != std::__libcpp_tls_set(key_, NULL))
64-
abort_message("cannot zero out thread value for __cxa_get_globals()");
64+
__abort_message("cannot zero out thread value for __cxa_get_globals()");
6565
}
6666

6767
void construct_() {
6868
if (0 != std::__libcpp_tls_create(&key_, destruct_))
69-
abort_message("cannot create thread specific key for __cxa_get_globals()");
69+
__abort_message("cannot create thread specific key for __cxa_get_globals()");
7070
}
7171
} // namespace
7272

@@ -80,9 +80,9 @@ extern "C" {
8080
retVal = static_cast<__cxa_eh_globals*>(
8181
__calloc_with_fallback(1, sizeof(__cxa_eh_globals)));
8282
if (NULL == retVal)
83-
abort_message("cannot allocate __cxa_eh_globals");
83+
__abort_message("cannot allocate __cxa_eh_globals");
8484
if (0 != std::__libcpp_tls_set(key_, retVal))
85-
abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
85+
__abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
8686
}
8787
return retVal;
8888
}
@@ -94,7 +94,7 @@ extern "C" {
9494
__cxa_eh_globals *__cxa_get_globals_fast() {
9595
// First time through, create the key.
9696
if (0 != std::__libcpp_execute_once(&flag_, construct_))
97-
abort_message("execute once failure in __cxa_get_globals_fast()");
97+
__abort_message("execute once failure in __cxa_get_globals_fast()");
9898
return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
9999
}
100100
} // extern "C"

libcxxabi/src/cxa_guard_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
// the former.
9292
#ifdef BUILDING_CXA_GUARD
9393
# include "abort_message.h"
94-
# define ABORT_WITH_MESSAGE(...) ::abort_message(__VA_ARGS__)
94+
# define ABORT_WITH_MESSAGE(...) ::__abort_message(__VA_ARGS__)
9595
#elif defined(TESTING_CXA_GUARD)
9696
# define ABORT_WITH_MESSAGE(...) ::abort()
9797
#else

libcxxabi/src/cxa_handlers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ __unexpected(unexpected_handler func)
3333
{
3434
func();
3535
// unexpected handler should not return
36-
abort_message("unexpected_handler unexpectedly returned");
36+
__abort_message("unexpected_handler unexpectedly returned");
3737
}
3838

3939
__attribute__((noreturn))
@@ -58,13 +58,13 @@ __terminate(terminate_handler func) noexcept
5858
#endif // _LIBCXXABI_NO_EXCEPTIONS
5959
func();
6060
// handler should not return
61-
abort_message("terminate_handler unexpectedly returned");
61+
__abort_message("terminate_handler unexpectedly returned");
6262
#ifndef _LIBCXXABI_NO_EXCEPTIONS
6363
}
6464
catch (...)
6565
{
6666
// handler should not throw exception
67-
abort_message("terminate_handler unexpectedly threw an exception");
67+
__abort_message("terminate_handler unexpectedly threw an exception");
6868
}
6969
#endif // _LIBCXXABI_NO_EXCEPTIONS
7070
}

libcxxabi/src/cxa_thread_atexit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace {
8989
// __cxa_thread_atexit() may be called arbitrarily late (for example, from
9090
// global destructors or atexit() handlers).
9191
if (std::__libcpp_tls_create(&dtors_key, run_dtors) != 0) {
92-
abort_message("std::__libcpp_tls_create() failed in __cxa_thread_atexit()");
92+
__abort_message("std::__libcpp_tls_create() failed in __cxa_thread_atexit()");
9393
}
9494
}
9595

libcxxabi/src/cxa_vector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void throw_bad_array_new_length() {
121121
#ifndef _LIBCXXABI_NO_EXCEPTIONS
122122
throw std::bad_array_new_length();
123123
#else
124-
abort_message("__cxa_vec_new failed to allocate memory");
124+
__abort_message("__cxa_vec_new failed to allocate memory");
125125
#endif
126126
}
127127

libcxxabi/src/cxa_virtual.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ namespace __cxxabiv1 {
1313
extern "C" {
1414
_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
1515
void __cxa_pure_virtual(void) {
16-
abort_message("Pure virtual function called!");
16+
__abort_message("Pure virtual function called!");
1717
}
1818

1919
_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
2020
void __cxa_deleted_virtual(void) {
21-
abort_message("Deleted virtual function called!");
21+
__abort_message("Deleted virtual function called!");
2222
}
2323
} // extern "C"
2424
} // abi

libcxxabi/src/demangle/DemangleConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// build systems to override this value.
1616
// https://libcxx.llvm.org/UsingLibcxx.html#enabling-the-safe-libc-mode
1717
#ifndef _LIBCPP_VERBOSE_ABORT
18-
#define _LIBCPP_VERBOSE_ABORT(...) abort_message(__VA_ARGS__)
18+
#define _LIBCPP_VERBOSE_ABORT(...) __abort_message(__VA_ARGS__)
1919
#include "../abort_message.h"
2020
#endif
2121

libcxxabi/src/stdlib_new_delete.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ inline void __throw_bad_alloc_shim() {
3232
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
3333
throw std::bad_alloc();
3434
#else
35-
abort_message("bad_alloc was thrown in -fno-exceptions mode");
35+
__abort_message("bad_alloc was thrown in -fno-exceptions mode");
3636
#endif
3737
}
3838

3939
#define _LIBCPP_ASSERT_SHIM(expr, str) \
4040
do { \
4141
if (!expr) \
42-
abort_message(str); \
42+
__abort_message(str); \
4343
} while (false)
4444

4545
// ------------------ BEGIN COPY ------------------

0 commit comments

Comments
 (0)