Add upcall_rust_personality
This just wraps __gxx_personality_v0 with our upcall naming convention Issue #236
This commit is contained in:
parent
f1e348ce6a
commit
9f4b4d89ce
@ -37,7 +37,8 @@ type upcalls =
|
||||
log_type: ValueRef,
|
||||
dynastack_mark: ValueRef,
|
||||
dynastack_alloc: ValueRef,
|
||||
dynastack_free: ValueRef};
|
||||
dynastack_free: ValueRef,
|
||||
rust_personality: ValueRef};
|
||||
|
||||
fn declare_upcalls(_tn: type_names, tydesc_type: TypeRef,
|
||||
taskptr_type: TypeRef, llmod: ModuleRef) -> @upcalls {
|
||||
@ -89,7 +90,9 @@ fn declare_upcalls(_tn: type_names, tydesc_type: TypeRef,
|
||||
dynastack_alloc:
|
||||
d("dynastack_alloc_2", [T_size_t(), T_ptr(tydesc_type)],
|
||||
T_ptr(T_i8())),
|
||||
dynastack_free: d("dynastack_free", [T_ptr(T_i8())], T_void())};
|
||||
dynastack_free: d("dynastack_free", [T_ptr(T_i8())], T_void()),
|
||||
rust_personality: dr("rust_personality", [], T_i32())
|
||||
};
|
||||
}
|
||||
//
|
||||
// Local Variables:
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "rust_gc.h"
|
||||
#include "rust_internal.h"
|
||||
#include "rust_upcall.h"
|
||||
#include <stdint.h>
|
||||
#include <unwind.h>
|
||||
|
||||
// Upcalls.
|
||||
|
||||
@ -190,6 +192,26 @@ upcall_dynastack_free(rust_task *task, void *ptr) {
|
||||
return task->dynastack.free(ptr);
|
||||
}
|
||||
|
||||
extern "C" _Unwind_Reason_Code
|
||||
__gxx_personality_v0(int version,
|
||||
_Unwind_Action actions,
|
||||
uint64_t exception_class,
|
||||
_Unwind_Exception *ue_header,
|
||||
_Unwind_Context *context);
|
||||
|
||||
extern "C" _Unwind_Reason_Code
|
||||
upcall_rust_personality(int version,
|
||||
_Unwind_Action actions,
|
||||
uint64_t exception_class,
|
||||
_Unwind_Exception *ue_header,
|
||||
_Unwind_Context *context) {
|
||||
return __gxx_personality_v0(version,
|
||||
actions,
|
||||
exception_class,
|
||||
ue_header,
|
||||
context);
|
||||
}
|
||||
|
||||
//
|
||||
// Local Variables:
|
||||
// mode: C++
|
||||
|
@ -78,5 +78,6 @@ upcall_vec_grow
|
||||
upcall_vec_push
|
||||
upcall_log_type
|
||||
upcall_malloc
|
||||
upcall_rust_personality
|
||||
upcall_shared_malloc
|
||||
upcall_shared_free
|
||||
|
Loading…
x
Reference in New Issue
Block a user