Path: blob/main/contrib/llvm-project/compiler-rt/lib/orc/common.h
39566 views
//===- common.h - Common utilities for the ORC runtime ----------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file is a part of the ORC runtime support library.9//10//===----------------------------------------------------------------------===//1112#ifndef ORC_RT_COMMON_H13#define ORC_RT_COMMON_H1415#include "compiler.h"16#include "orc_rt/c_api.h"17#include <type_traits>1819/// This macro should be used to define tags that will be associated with20/// handlers in the JIT process, and call can be used to define tags f21#define ORC_RT_JIT_DISPATCH_TAG(X) \22extern "C" char X; \23char X = 0;2425/// Opaque struct for external symbols.26struct __orc_rt_Opaque {};2728/// Error reporting function.29extern "C" void __orc_rt_log_error(const char *ErrMsg);3031/// Context object for dispatching calls to the JIT object.32///33/// This is declared for use by the runtime, but should be implemented in the34/// executor or provided by a definition added to the JIT before the runtime35/// is loaded.36ORC_RT_IMPORT __orc_rt_Opaque __orc_rt_jit_dispatch_ctx ORC_RT_WEAK_IMPORT;3738/// For dispatching calls to the JIT object.39///40/// This is declared for use by the runtime, but should be implemented in the41/// executor or provided by a definition added to the JIT before the runtime42/// is loaded.43ORC_RT_IMPORT orc_rt_CWrapperFunctionResult44__orc_rt_jit_dispatch(__orc_rt_Opaque *DispatchCtx, const void *FnTag,45const char *Data, size_t Size) ORC_RT_WEAK_IMPORT;4647#endif // ORC_RT_COMMON_H484950