| 1 | //===- coff_platform.per_jd.cpp -------------------------------------------===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file contains code that will be loaded per each JITDylib. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | #include "compiler.h" |
| 13 | |
| 14 | ORC_RT_INTERFACE void __orc_rt_coff_per_jd_marker() {} |
| 15 | |
| 16 | typedef int (*OnExitFunction)(void); |
| 17 | typedef void (*AtExitFunction)(void); |
| 18 | |
| 19 | extern "C"void *__ImageBase; |
| 20 | ORC_RT_INTERFACE OnExitFunction __orc_rt_coff_onexit(void *Header, |
| 21 | OnExitFunction Func); |
| 22 | ORC_RT_INTERFACE int __orc_rt_coff_atexit(void *Header, AtExitFunction Func); |
| 23 | |
| 24 | ORC_RT_INTERFACE OnExitFunction |
| 25 | __orc_rt_coff_onexit_per_jd(OnExitFunction Func) { |
| 26 | return __orc_rt_coff_onexit(Header: &__ImageBase, Func); |
| 27 | } |
| 28 | |
| 29 | ORC_RT_INTERFACE int __orc_rt_coff_atexit_per_jd(AtExitFunction Func) { |
| 30 | return __orc_rt_coff_atexit(Header: &__ImageBase, Func); |
| 31 | } |
| 32 |
