diff options
author | Stephen Hines <srhines@google.com> | 2014-12-01 14:51:49 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-12-02 16:08:10 -0800 |
commit | 37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch) | |
tree | 8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /examples/Kaleidoscope/Chapter6 | |
parent | d2327b22152ced7bc46dc629fc908959e8a52d03 (diff) | |
download | external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2 |
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'examples/Kaleidoscope/Chapter6')
-rw-r--r-- | examples/Kaleidoscope/Chapter6/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter6/Makefile | 2 | ||||
-rw-r--r-- | examples/Kaleidoscope/Chapter6/toy.cpp | 9 |
3 files changed, 7 insertions, 6 deletions
diff --git a/examples/Kaleidoscope/Chapter6/CMakeLists.txt b/examples/Kaleidoscope/Chapter6/CMakeLists.txt index 669c7eb..d36f030 100644 --- a/examples/Kaleidoscope/Chapter6/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter6/CMakeLists.txt @@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS Core ExecutionEngine InstCombine - JIT + MC ScalarOpts Support nativecodegen diff --git a/examples/Kaleidoscope/Chapter6/Makefile b/examples/Kaleidoscope/Chapter6/Makefile index a5fbcbd..8f47ea0 100644 --- a/examples/Kaleidoscope/Chapter6/Makefile +++ b/examples/Kaleidoscope/Chapter6/Makefile @@ -10,6 +10,6 @@ LEVEL = ../../.. TOOLNAME = Kaleidoscope-Ch6 EXAMPLE_TOOL = 1 -LINK_COMPONENTS := core jit native +LINK_COMPONENTS := core mcjit native include $(LEVEL)/Makefile.common diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index 5a3bd2e..06da9ac 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -1,6 +1,5 @@ #include "llvm/Analysis/Passes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" -#include "llvm/ExecutionEngine/JIT.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/IRBuilder.h" @@ -935,11 +934,13 @@ int main() { getNextToken(); // Make the module, which holds all the code. - TheModule = new Module("my cool jit", Context); + std::unique_ptr<Module> Owner = make_unique<Module>("my cool jit", Context); + TheModule = Owner.get(); // Create the JIT. This takes ownership of the module. std::string ErrStr; - TheExecutionEngine = EngineBuilder(TheModule).setErrorStr(&ErrStr).create(); + TheExecutionEngine = + EngineBuilder(std::move(Owner)).setErrorStr(&ErrStr).create(); if (!TheExecutionEngine) { fprintf(stderr, "Could not create ExecutionEngine: %s\n", ErrStr.c_str()); exit(1); @@ -950,7 +951,7 @@ int main() { // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. TheModule->setDataLayout(TheExecutionEngine->getDataLayout()); - OurFPM.add(new DataLayoutPass(TheModule)); + OurFPM.add(new DataLayoutPass()); // Provide basic AliasAnalysis support for GVN. OurFPM.add(createBasicAliasAnalysisPass()); // Do simple "peephole" optimizations and bit-twiddling optzns. |