File tree 2 files changed +5
-2
lines changed
clang/examples/clang-interpreter 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
set (LLVM_LINK_COMPONENTS
2
2
Core
3
3
ExecutionEngine
4
- JIT
4
+ MCJIT
5
5
Support
6
6
native
7
7
)
Original file line number Diff line number Diff line change 18
18
#include " clang/Frontend/TextDiagnosticPrinter.h"
19
19
#include " llvm/ADT/SmallString.h"
20
20
#include " llvm/ExecutionEngine/ExecutionEngine.h"
21
- #include " llvm/ExecutionEngine/JIT .h"
21
+ #include " llvm/ExecutionEngine/MCJIT .h"
22
22
#include " llvm/IR/Module.h"
23
23
#include " llvm/Support/FileSystem.h"
24
24
#include " llvm/Support/Host.h"
@@ -45,13 +45,15 @@ std::string GetExecutablePath(const char *Argv0) {
45
45
static llvm::ExecutionEngine *createExecutionEngine (llvm::Module *M,
46
46
std::string *ErrorStr) {
47
47
llvm::EngineBuilder EB = llvm::EngineBuilder (M)
48
+ .setUseMCJIT (true )
48
49
.setEngineKind (llvm::EngineKind::Either)
49
50
.setErrorStr (ErrorStr);
50
51
return EB.create ();
51
52
}
52
53
53
54
static int Execute (llvm::Module *Mod, char * const *envp) {
54
55
llvm::InitializeNativeTarget ();
56
+ llvm::InitializeNativeTargetAsmPrinter ();
55
57
56
58
std::string Error;
57
59
std::unique_ptr<llvm::ExecutionEngine> EE (createExecutionEngine (Mod, &Error));
@@ -70,6 +72,7 @@ static int Execute(llvm::Module *Mod, char * const *envp) {
70
72
std::vector<std::string> Args;
71
73
Args.push_back (Mod->getModuleIdentifier ());
72
74
75
+ EE->finalizeObject ();
73
76
return EE->runFunctionAsMain (EntryFn, Args, envp);
74
77
}
75
78
You can’t perform that action at this time.
0 commit comments