From: Lang Hames Date: Mon, 19 Jul 2021 23:06:39 +0000 (+1000) Subject: [ORC-RT] Introduce a ORC_RT_JIT_DISPATCH_TAG macro. X-Git-Tag: llvmorg-14-init~971 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8afa4c40cb863bb12a61e593171c7aca8eb39a07;p=platform%2Fupstream%2Fllvm.git [ORC-RT] Introduce a ORC_RT_JIT_DISPATCH_TAG macro. This macro can be used to define tag variables for use with jit-dispatch. --- diff --git a/compiler-rt/lib/orc/common.h b/compiler-rt/lib/orc/common.h index 5038425..54e613e 100644 --- a/compiler-rt/lib/orc/common.h +++ b/compiler-rt/lib/orc/common.h @@ -17,6 +17,12 @@ #include "compiler.h" #include +/// This macro should be used to define tags that will be associated with +/// handlers in the JIT process, and call can be used to define tags f +#define ORC_RT_JIT_DISPATCH_TAG(X) \ +extern "C" char X; \ +char X = 0; + /// Opaque struct for external symbols. struct __orc_rt_Opaque {}; diff --git a/compiler-rt/lib/orc/macho_platform.cpp b/compiler-rt/lib/orc/macho_platform.cpp index c9792f3..8a3f8d9 100644 --- a/compiler-rt/lib/orc/macho_platform.cpp +++ b/compiler-rt/lib/orc/macho_platform.cpp @@ -25,14 +25,9 @@ using namespace __orc_rt; using namespace __orc_rt::macho; // Declare function tags for functions in the JIT process. -extern "C" char __orc_rt_macho_get_initializers_tag; -char __orc_rt_macho_get_initializers_tag = 0; - -extern "C" char __orc_rt_macho_get_deinitializers_tag; -char __orc_rt_macho_get_deinitializers_tag = 0; - -extern "C" char __orc_rt_macho_symbol_lookup_tag; -char __orc_rt_macho_symbol_lookup_tag = 0; +ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_get_initializers_tag) +ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_get_deinitializers_tag) +ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_symbol_lookup_tag) // eh-frame registration functions. // We expect these to be available for all processes.