Commit 7d1c6f28 authored by Andrew Hsieh's avatar Andrew Hsieh Committed by Gerrit Code Review
Browse files

Merge "gabi++: Introduced _GABIXX_HIDDEN macro."

parents f0d8fa08 ce2be28f
......@@ -46,6 +46,10 @@
# define _GABIXX_NOEXCEPT_(x) /* nothing */
#endif
// Use _GABIXX_HIDDEN to declare internal functions of GAbi++ that should
// never be exposed to client code.
#define _GABIXX_HIDDEN __attribute__((__visibility__("hidden")))
// Use _GABIXX_ALWAYS_INLINE to declare a function that shall always be
// inlined. Note that the always_inline doesn't make a function inline
// per se.
......
......@@ -43,7 +43,8 @@ namespace {
return exc == __gxx_exception_class;
}
void defaultExceptionCleanupFunc(_Unwind_Reason_Code reason, _Unwind_Exception* exc) {
void defaultExceptionCleanupFunc(_Unwind_Reason_Code reason,
_Unwind_Exception* exc) {
__cxa_free_exception(exc+1);
}
......@@ -87,7 +88,8 @@ namespace {
obj = malloc(sizeof(__cxa_eh_globals));
if (!obj) {
// Shouldn't happen, but better be safe than sorry.
__gabixx::__fatal_error("Can't allocate thread-specific C++ runtime info block.");
__gabixx::__fatal_error(
"Can't allocate thread-specific C++ runtime info block.");
}
memset(obj, 0, sizeof(__cxa_eh_globals));
pthread_setspecific(__cxa_thread_key, obj);
......
......@@ -317,14 +317,15 @@ struct __cxa_eh_globals {
namespace __gabixx {
// Default terminate handler.
_GABIXX_NORETURN void __default_terminate(void);
_GABIXX_NORETURN void __default_terminate(void) _GABIXX_HIDDEN;
// Call |handler| and if it returns, call __default_terminate.
_GABIXX_NORETURN void __terminate(std::terminate_handler handler);
_GABIXX_NORETURN void __terminate(std::terminate_handler handler)
_GABIXX_HIDDEN;
// Print a fatal error message to the log+stderr, then call
// std::terminate().
_GABIXX_NORETURN void __fatal_error(const char* message);
_GABIXX_NORETURN void __fatal_error(const char* message) _GABIXX_HIDDEN;
} // __gabixx
......
......@@ -43,6 +43,7 @@
#include <cstdint>
#include <unwind.h>
#include <gabixx_config.h>
namespace __cxxabiv1 {
......@@ -78,10 +79,10 @@ namespace __cxxabiv1 {
// _URC_HANDLER_FOUND
};
uintptr_t readULEB128(const uint8_t** data);
intptr_t readSLEB128(const uint8_t** data);
uintptr_t readULEB128(const uint8_t** data) _GABIXX_HIDDEN;
intptr_t readSLEB128(const uint8_t** data) _GABIXX_HIDDEN;
uintptr_t readEncodedPointer(const uint8_t** data,
uint8_t encoding);
uint8_t encoding) _GABIXX_HIDDEN;
} // namespace __cxxabiv1
......
......@@ -36,10 +36,10 @@
// Target-independent helper functions
namespace __cxxabiv1 {
void call_terminate(_Unwind_Exception* unwind_exception);
void call_terminate(_Unwind_Exception* unwind_exception) _GABIXX_HIDDEN;
#if __arm__
uint32_t decodeRelocTarget2 (uint32_t ptr);
uint32_t decodeRelocTarget2 (uint32_t ptr) _GABIXX_HIDDEN;
#endif
// An exception spec acts like a catch handler, but in reverse.
......@@ -50,33 +50,38 @@ namespace __cxxabiv1 {
uint8_t ttypeEncoding,
const std::type_info* excpType,
void* adjustedPtr,
_Unwind_Exception* unwind_exception);
_Unwind_Exception* unwind_exception)
_GABIXX_HIDDEN;
void setRegisters(_Unwind_Exception* unwind_exception,
_Unwind_Context* context,
const ScanResultInternal& results);
const ScanResultInternal& results) _GABIXX_HIDDEN;
_Unwind_Reason_Code continueUnwinding(_Unwind_Exception *ex,
_Unwind_Context *context);
_Unwind_Context *context)
_GABIXX_HIDDEN;
void saveDataToBarrierCache(_Unwind_Exception* exc,
_Unwind_Context* ctx,
const ScanResultInternal& results);
const ScanResultInternal& results)
_GABIXX_HIDDEN;
void loadDataFromBarrierCache(_Unwind_Exception* exc,
ScanResultInternal& results);
ScanResultInternal& results)
_GABIXX_HIDDEN;
void prepareBeginCleanup(_Unwind_Exception* exc);
void prepareBeginCleanup(_Unwind_Exception* exc) _GABIXX_HIDDEN;
void saveUnexpectedDataToBarrierCache(_Unwind_Exception* exc,
_Unwind_Context* ctx,
const ScanResultInternal& results);
const ScanResultInternal& results)
_GABIXX_HIDDEN;
void scanEHTable(ScanResultInternal& results,
_Unwind_Action actions,
bool native_exception,
_Unwind_Exception* unwind_exception,
_Unwind_Context* context);
_Unwind_Context* context) _GABIXX_HIDDEN;
// Make it easier to adapt to Itanium PR
#ifdef __arm__
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment