brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 70d9a59 Raw
49 lines · c
1//===- common.h - Common utilities for the ORC runtime ----------*- C++ -*-===//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 is a part of the ORC runtime support library.10//11//===----------------------------------------------------------------------===//12 13#ifndef ORC_RT_COMMON_H14#define ORC_RT_COMMON_H15 16#include "compiler.h"17#include "orc_rt/c_api.h"18#include <type_traits>19 20/// This macro should be used to define tags that will be associated with21/// handlers in the JIT process, and call can be used to define tags f22#define ORC_RT_JIT_DISPATCH_TAG(X)                                             \23  ORC_RT_INTERFACE char X;                                                     \24  char X = 0;25 26/// Opaque struct for external symbols.27struct __orc_rt_Opaque {};28 29/// Error reporting function.30extern "C" void __orc_rt_log_error(const char *ErrMsg);31 32/// Context object for dispatching calls to the JIT object.33///34/// This is declared for use by the runtime, but should be implemented in the35/// executor or provided by a definition added to the JIT before the runtime36/// is loaded.37ORC_RT_IMPORT __orc_rt_Opaque __orc_rt_jit_dispatch_ctx ORC_RT_WEAK_IMPORT;38 39/// For dispatching calls to the JIT object.40///41/// This is declared for use by the runtime, but should be implemented in the42/// executor or provided by a definition added to the JIT before the runtime43/// is loaded.44ORC_RT_IMPORT orc_rt_WrapperFunctionResult45__orc_rt_jit_dispatch(__orc_rt_Opaque *DispatchCtx, const void *FnTag,46                      const char *Data, size_t Size) ORC_RT_WEAK_IMPORT;47 48#endif // ORC_RT_COMMON_H49