Index: clang/lib/Interpreter/IncrementalExecutor.h =================================================================== --- clang/lib/Interpreter/IncrementalExecutor.h +++ clang/lib/Interpreter/IncrementalExecutor.h @@ -14,6 +14,7 @@ #define LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Triple.h" #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h" #include @@ -34,7 +35,8 @@ llvm::orc::ThreadSafeContext &TSCtx; public: - IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, llvm::Error &Err); + IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, llvm::Error &Err, + const llvm::Triple &Triple); ~IncrementalExecutor(); llvm::Error addModule(std::unique_ptr M); Index: clang/lib/Interpreter/IncrementalExecutor.cpp =================================================================== --- clang/lib/Interpreter/IncrementalExecutor.cpp +++ clang/lib/Interpreter/IncrementalExecutor.cpp @@ -26,12 +26,14 @@ namespace clang { IncrementalExecutor::IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, - llvm::Error &Err) + llvm::Error &Err, + const llvm::Triple &Triple) : TSCtx(TSC) { using namespace llvm::orc; llvm::ErrorAsOutParameter EAO(&Err); - if (auto JitOrErr = LLJITBuilder().create()) + auto JTMB = JITTargetMachineBuilder(Triple); + if (auto JitOrErr = LLJITBuilder().setJITTargetMachineBuilder(JTMB).create()) Jit = std::move(*JitOrErr); else { Err = JitOrErr.takeError(); Index: clang/lib/Interpreter/Interpreter.cpp =================================================================== --- clang/lib/Interpreter/Interpreter.cpp +++ clang/lib/Interpreter/Interpreter.cpp @@ -16,6 +16,7 @@ #include "IncrementalExecutor.h" #include "IncrementalParser.h" +#include "clang/AST/ASTContext.h" #include "clang/Basic/TargetInfo.h" #include "clang/CodeGen/ModuleBuilder.h" #include "clang/CodeGen/ObjectFilePCHContainerOperations.h" @@ -204,8 +205,11 @@ llvm::Error Interpreter::Execute(Transaction &T) { assert(T.TheModule); if (!IncrExecutor) { + const llvm::Triple &Triple = + getCompilerInstance()->getASTContext().getTargetInfo().getTriple(); llvm::Error Err = llvm::Error::success(); - IncrExecutor = std::make_unique(*TSCtx, Err); + IncrExecutor = std::make_unique(*TSCtx, Err, Triple); + if (Err) return Err; }