summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-06-11 05:47:04 +0000
committerLang Hames <lhames@gmail.com>2016-06-11 05:47:04 +0000
commitdf424f76e50dd7fb42a6a4949b3c2c892cf8a797 (patch)
treefc14415059df596c462f64554f84009d2bc7ce59 /examples
parentff7edbe38c28426980827e63ba2e528fd44da1e1 (diff)
[MCJIT] Update MCJIT and get the fibonacci example working again.
MCJIT will now set the DataLayout on a module when it is added to the JIT, rather than waiting until it is codegen'd, and the runFunction method will finalize the module containing the function to be run before running it. The fibonacci example has been updated to include and link against MCJIT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/Fibonacci/CMakeLists.txt1
-rw-r--r--examples/Fibonacci/fibonacci.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/examples/Fibonacci/CMakeLists.txt b/examples/Fibonacci/CMakeLists.txt
index 087ccdd7d84..e294a252375 100644
--- a/examples/Fibonacci/CMakeLists.txt
+++ b/examples/Fibonacci/CMakeLists.txt
@@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS
ExecutionEngine
Interpreter
MC
+ MCJIT
Support
nativecodegen
)
diff --git a/examples/Fibonacci/fibonacci.cpp b/examples/Fibonacci/fibonacci.cpp
index 01f6d01fb19..16e52bf0409 100644
--- a/examples/Fibonacci/fibonacci.cpp
+++ b/examples/Fibonacci/fibonacci.cpp
@@ -27,6 +27,7 @@
#include "llvm/IR/Verifier.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"
@@ -103,6 +104,7 @@ int main(int argc, char **argv) {
int n = argc > 1 ? atol(argv[1]) : 24;
InitializeNativeTarget();
+ InitializeNativeTargetAsmPrinter();
LLVMContext Context;
// Create some module to put our function into it.