1 //===- common.h - Common utilities for the ORC runtime ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file is a part of the ORC runtime support library.
11 //===----------------------------------------------------------------------===//
13 #ifndef ORC_RT_COMMON_H
14 #define ORC_RT_COMMON_H
17 #include "orc_rt/c_api.h"
18 #include <type_traits>
20 /// This macro should be used to define tags that will be associated with
21 /// handlers in the JIT process, and call can be used to define tags f
22 #define ORC_RT_JIT_DISPATCH_TAG(X) \
23 ORC_RT_INTERFACE char X; \
26 /// Opaque struct for external symbols.
27 struct __orc_rt_Opaque
{};
29 /// Error reporting function.
30 extern "C" void __orc_rt_log_error(const char *ErrMsg
);
32 /// Context object for dispatching calls to the JIT object.
34 /// This is declared for use by the runtime, but should be implemented in the
35 /// executor or provided by a definition added to the JIT before the runtime
37 ORC_RT_IMPORT __orc_rt_Opaque __orc_rt_jit_dispatch_ctx ORC_RT_WEAK_IMPORT
;
39 /// For dispatching calls to the JIT object.
41 /// This is declared for use by the runtime, but should be implemented in the
42 /// executor or provided by a definition added to the JIT before the runtime
44 ORC_RT_IMPORT orc_rt_CWrapperFunctionResult
45 __orc_rt_jit_dispatch(__orc_rt_Opaque
*DispatchCtx
, const void *FnTag
,
46 const char *Data
, size_t Size
) ORC_RT_WEAK_IMPORT
;
48 #endif // ORC_RT_COMMON_H