|
@@ -18,7 +18,6 @@
|
|
#include "clang/Frontend/TextDiagnosticPrinter.h"
|
|
#include "clang/Frontend/TextDiagnosticPrinter.h"
|
|
#include "llvm/ADT/SmallString.h"
|
|
#include "llvm/ADT/SmallString.h"
|
|
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
|
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
|
-#include "llvm/ExecutionEngine/JIT.h"
|
|
|
|
#include "llvm/IR/Module.h"
|
|
#include "llvm/IR/Module.h"
|
|
#include "llvm/Support/FileSystem.h"
|
|
#include "llvm/Support/FileSystem.h"
|
|
#include "llvm/Support/Host.h"
|
|
#include "llvm/Support/Host.h"
|
|
@@ -43,11 +42,12 @@ std::string GetExecutablePath(const char *Argv0) {
|
|
}
|
|
}
|
|
|
|
|
|
static int Execute(llvm::Module *Mod, char * const *envp) {
|
|
static int Execute(llvm::Module *Mod, char * const *envp) {
|
|
- llvm::InitializeNativeTarget();
|
|
|
|
|
|
+ // To JIT instead of interpreting, call llvm::InitializeNativeTarget() here
|
|
|
|
+ // and pass ForceInterpreter=false to ExecutionEngine::create().
|
|
|
|
|
|
std::string Error;
|
|
std::string Error;
|
|
std::unique_ptr<llvm::ExecutionEngine> EE(
|
|
std::unique_ptr<llvm::ExecutionEngine> EE(
|
|
- llvm::ExecutionEngine::createJIT(Mod, &Error));
|
|
|
|
|
|
+ llvm::ExecutionEngine::create(Mod, /*ForceInterpreter*/ true, &Error));
|
|
if (!EE) {
|
|
if (!EE) {
|
|
llvm::errs() << "unable to make execution engine: " << Error << "\n";
|
|
llvm::errs() << "unable to make execution engine: " << Error << "\n";
|
|
return 255;
|
|
return 255;
|