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