[examples] Fix "Target does not support MC emission!" in HowToUseJIT example.

Patch by Shivam Gupta. Thanks Shivam!

Differential Revision: https://reviews.llvm.org/D92280
This commit is contained in:
Lang Hames 2021-01-24 21:52:23 +11:00
parent a78d45f1a3
commit f8db80b74e
2 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,8 @@ set(LLVM_LINK_COMPONENTS
Core
ExecutionEngine
Interpreter
MC
MCJIT
Support
nativecodegen
)

View File

@ -36,6 +36,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"
@ -59,6 +60,7 @@ using namespace llvm;
int main() {
InitializeNativeTarget();
LLVMInitializeNativeAsmPrinter();
LLVMContext Context;