diff options
author | Lang Hames <lhames@gmail.com> | 2016-06-11 05:47:04 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-06-11 05:47:04 +0000 |
commit | 717eacfcf4b47bb1013a4c316a22a0e45091b1f0 (patch) | |
tree | b71e288d80569fb0572d724dc44670c96d85589f /llvm/examples/Fibonacci/fibonacci.cpp | |
parent | 1256cc818b9227e4ff2b17f60c47e04aa21b6f5b (diff) | |
download | bcm5719-llvm-717eacfcf4b47bb1013a4c316a22a0e45091b1f0.tar.gz bcm5719-llvm-717eacfcf4b47bb1013a4c316a22a0e45091b1f0.zip |
[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.
llvm-svn: 272455
Diffstat (limited to 'llvm/examples/Fibonacci/fibonacci.cpp')
-rw-r--r-- | llvm/examples/Fibonacci/fibonacci.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/examples/Fibonacci/fibonacci.cpp b/llvm/examples/Fibonacci/fibonacci.cpp index 01f6d01fb19..16e52bf0409 100644 --- a/llvm/examples/Fibonacci/fibonacci.cpp +++ b/llvm/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. |