From 50ff35b458dc4f8b0002b9fa8e8a8d157b7acb49 Mon Sep 17 00:00:00 2001 From: xgupta Date: Thu, 4 Feb 2021 22:44:02 +0530 Subject: [PATCH] [examples] Fix Target does not support MC emission in ParallelJIT --- examples/ParallelJIT/CMakeLists.txt | 1 + examples/ParallelJIT/ParallelJIT.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/examples/ParallelJIT/CMakeLists.txt b/examples/ParallelJIT/CMakeLists.txt index c42dfc85c14..f4489f3ff1c 100644 --- a/examples/ParallelJIT/CMakeLists.txt +++ b/examples/ParallelJIT/CMakeLists.txt @@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS ExecutionEngine Interpreter MC + MCJIT Support nativecodegen ) diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp index 64784622076..7da105d201b 100644 --- a/examples/ParallelJIT/ParallelJIT.cpp +++ b/examples/ParallelJIT/ParallelJIT.cpp @@ -22,6 +22,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/GenericValue.h" +#include "llvm/ExecutionEngine/MCJIT.h" #include "llvm/IR/Argument.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" @@ -256,6 +257,7 @@ void* callFunc( void* param ) int main() { InitializeNativeTarget(); + LLVMInitializeNativeAsmPrinter(); LLVMContext Context; // Create some module to put our function into it.