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