Skip to content

Commit 8afa4c4

Browse files
committed
[ORC-RT] Introduce a ORC_RT_JIT_DISPATCH_TAG macro.
This macro can be used to define tag variables for use with jit-dispatch.
1 parent ebec955 commit 8afa4c4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

compiler-rt/lib/orc/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
#include "compiler.h"
1818
#include <type_traits>
1919

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+
extern "C" char X; \
24+
char X = 0;
25+
2026
/// Opaque struct for external symbols.
2127
struct __orc_rt_Opaque {};
2228

compiler-rt/lib/orc/macho_platform.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@ using namespace __orc_rt;
2525
using namespace __orc_rt::macho;
2626

2727
// Declare function tags for functions in the JIT process.
28-
extern "C" char __orc_rt_macho_get_initializers_tag;
29-
char __orc_rt_macho_get_initializers_tag = 0;
30-
31-
extern "C" char __orc_rt_macho_get_deinitializers_tag;
32-
char __orc_rt_macho_get_deinitializers_tag = 0;
33-
34-
extern "C" char __orc_rt_macho_symbol_lookup_tag;
35-
char __orc_rt_macho_symbol_lookup_tag = 0;
28+
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_get_initializers_tag)
29+
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_get_deinitializers_tag)
30+
ORC_RT_JIT_DISPATCH_TAG(__orc_rt_macho_symbol_lookup_tag)
3631

3732
// eh-frame registration functions.
3833
// We expect these to be available for all processes.

0 commit comments

Comments
 (0)