15
15
#include " clang/AST/Decl.h"
16
16
#include " clang/AST/DeclGroup.h"
17
17
#include " clang/AST/Mangle.h"
18
+ #include " clang/Basic/Version.h"
19
+ #include " clang/Config/config.h"
18
20
#include " clang/Frontend/CompilerInstance.h"
19
21
#include " clang/Frontend/TextDiagnosticPrinter.h"
20
22
#include " clang/Interpreter/Interpreter.h"
21
23
#include " clang/Interpreter/RemoteJITUtils.h"
22
24
#include " clang/Interpreter/Value.h"
23
25
#include " clang/Sema/Lookup.h"
24
26
#include " clang/Sema/Sema.h"
25
- #include " llvm/TargetParser/Host.h"
26
27
#include " llvm/Support/Error.h"
28
+ #include " llvm/TargetParser/Host.h"
27
29
28
30
#include " gmock/gmock.h"
29
31
#include " gtest/gtest.h"
@@ -82,18 +84,15 @@ static std::string getOrcRuntimePath() {
82
84
llvm::sys::path::remove_filename (RuntimePath); // Remove "clang"
83
85
llvm::sys::path::remove_filename (RuntimePath); // Remove "tools"
84
86
85
- llvm::sys::path::append (RuntimePath, " lib" , " clang" , " 20" , " lib" );
87
+ llvm::sys::path::append (RuntimePath, CLANG_INSTALL_LIBDIR_BASENAME, " clang" ,
88
+ CLANG_VERSION_MAJOR_STRING, " lib" );
86
89
87
- // Add platform-specific runtime library
88
90
llvm::Triple SystemTriple (llvm::sys::getProcessTriple ());
89
- if (SystemTriple.isOSDarwin ()) {
91
+ if (SystemTriple.isOSBinFormatMachO ()) {
90
92
llvm::sys::path::append (RuntimePath, " darwin" , " liborc_rt_osx.a" );
91
- } else if (SystemTriple.isOSLinux ()) {
93
+ } else if (SystemTriple.isOSBinFormatELF ()) {
92
94
llvm::sys::path::append (RuntimePath, " x86_64-unknown-linux-gnu" ,
93
95
" liborc_rt.a" );
94
- } else {
95
- // Add other platforms as needed
96
- llvm::sys::path::append (RuntimePath, " liborc_rt.a" );
97
96
}
98
97
99
98
return RuntimePath.str ().str ();
@@ -118,15 +117,14 @@ createInterpreterWithRemoteExecution(const Args &ExtraArgs = {},
118
117
119
118
if ((SystemTriple.isOSBinFormatELF () || SystemTriple.isOSBinFormatMachO ())) {
120
119
std::string OOPExecutor = getExecutorPath ();
121
- std::cout << " Executor Path: " << OOPExecutor << " \n " ;
122
120
if (!llvm::sys::fs::exists (OOPExecutor)) {
123
121
std::cout << " Executor path does not exist: " << OOPExecutor << std::endl;
124
122
return nullptr ;
125
123
}
126
124
127
125
std::string OrcRuntimePath = getOrcRuntimePath ();
128
126
129
- if (!llvm::sys::fs::exists (OrcRuntimePath)) {
127
+ if (!llvm::sys::fs::exists (OrcRuntimePath)) {
130
128
std::cout << " ORC runtime path does not exist: " << OrcRuntimePath
131
129
<< std::endl;
132
130
}
@@ -151,10 +149,6 @@ createInterpreterWithRemoteExecution(const Args &ExtraArgs = {},
151
149
setvbuf (stdout, nullptr , _IONBF, 0 );
152
150
setvbuf (stderr, nullptr , _IONBF, 0 );
153
151
}));
154
- OrcRuntimePath = getOrcRuntimePath ();
155
-
156
- std::cout << " Orc Runtime Path: " << OrcRuntimePath << " \n " ;
157
-
158
152
if (EPC) {
159
153
CB.SetTargetTriple (EPC->getTargetTriple ().getTriple ());
160
154
JB = ExitOnError (clang::Interpreter::createLLJITBuilder (std::move (EPC),
0 commit comments