llvm.org GIT mirror llvm / 0eeb59d
BrainF example: fixing segfault caused by outdated code with missing MCJIT dependency Differential Revision: https://reviews.llvm.org/D26280 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289857 91177308-0d34-0410-b5e6-96231b3b80d8 Boris Ulasevich 2 years ago
2 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2828 #include "llvm/Bitcode/BitcodeWriter.h"
2929 #include "llvm/ExecutionEngine/ExecutionEngine.h"
3030 #include "llvm/ExecutionEngine/GenericValue.h"
31 #include "llvm/ExecutionEngine/MCJIT.h"
3132 #include "llvm/IR/BasicBlock.h"
3233 #include "llvm/IR/Constants.h"
3334 #include "llvm/IR/DerivedTypes.h"
152153 //Write it out
153154 if (JIT) {
154155 InitializeNativeTarget();
156 InitializeNativeTargetAsmPrinter();
155157
156158 outs() << "------- Running JIT -------\n";
157159 Module &M = *Mod;
158160 ExecutionEngine *ee = EngineBuilder(std::move(Mod)).create();
161 if (!ee) {
162 errs() << "Error: execution engine creation failed.\n";
163 abort();
164 }
159165 std::vector args;
160166 Function *brainf_func = M.getFunction("brainf");
161167 GenericValue gv = ee->runFunction(brainf_func, args);
22 Core
33 ExecutionEngine
44 MC
5 MCJIT
56 Support
67 nativecodegen
78 )