32 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// This file contains code that will be loaded per each JITDylib.10//11//===----------------------------------------------------------------------===//12#include "compiler.h"13 14ORC_RT_INTERFACE void __orc_rt_coff_per_jd_marker() {}15 16typedef int (*OnExitFunction)(void);17typedef void (*AtExitFunction)(void);18 19extern "C" void *__ImageBase;20ORC_RT_INTERFACE OnExitFunction __orc_rt_coff_onexit(void *Header,21 OnExitFunction Func);22ORC_RT_INTERFACE int __orc_rt_coff_atexit(void *Header, AtExitFunction Func);23 24ORC_RT_INTERFACE OnExitFunction25__orc_rt_coff_onexit_per_jd(OnExitFunction Func) {26 return __orc_rt_coff_onexit(&__ImageBase, Func);27}28 29ORC_RT_INTERFACE int __orc_rt_coff_atexit_per_jd(AtExitFunction Func) {30 return __orc_rt_coff_atexit(&__ImageBase, Func);31}32