Skip to content

Commit 94baef0

Browse files
committed
Improve offset initialization in getExecutionEngine
1 parent 8e064dc commit 94baef0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/Interpreter/Compatibility.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,23 @@ inline llvm::orc::LLJIT* getExecutionEngine(cling::Interpreter& I) {
117117
return I.getExecutionEngine();
118118
#endif
119119

120+
unsigned m_ExecutorOffset = 0;
121+
120122
#if CLANG_VERSION_MAJOR == 13
121123
#ifdef __APPLE__
122-
const unsigned m_ExecutorOffset = 62;
124+
m_ExecutorOffset = 62;
123125
#else
124-
const unsigned m_ExecutorOffset = 72;
126+
m_ExecutorOffset = 72;
125127
#endif // __APPLE__
126128
#endif
127129

128130
// Note: The offsets changed in Cling based on LLVM 16 with the introduction of
129131
// a thread safe context - llvm::orc::ThreadSafeContext
130132
#if CLANG_VERSION_MAJOR == 16
131133
#ifdef __APPLE__
132-
const unsigned m_ExecutorOffset = 68;
134+
m_ExecutorOffset = 68;
133135
#else
134-
const unsigned m_ExecutorOffset = 78;
136+
m_ExecutorOffset = 78;
135137
#endif // __APPLE__
136138
#endif
137139

0 commit comments

Comments
 (0)