From 37ed9c199ca639565f6ce88105f9e39e898d82d0 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 1 Dec 2014 14:51:49 -0800 Subject: Update aosp/master LLVM for rebase to r222494. Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d --- examples/Kaleidoscope/Chapter5/CMakeLists.txt | 2 +- examples/Kaleidoscope/Chapter5/Makefile | 2 +- examples/Kaleidoscope/Chapter5/toy.cpp | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'examples/Kaleidoscope/Chapter5') diff --git a/examples/Kaleidoscope/Chapter5/CMakeLists.txt b/examples/Kaleidoscope/Chapter5/CMakeLists.txt index c7d0276..1912ddc 100644 --- a/examples/Kaleidoscope/Chapter5/CMakeLists.txt +++ b/examples/Kaleidoscope/Chapter5/CMakeLists.txt @@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS Core ExecutionEngine InstCombine - JIT + MC ScalarOpts Support nativecodegen diff --git a/examples/Kaleidoscope/Chapter5/Makefile b/examples/Kaleidoscope/Chapter5/Makefile index d1f5e20..d780967 100644 --- a/examples/Kaleidoscope/Chapter5/Makefile +++ b/examples/Kaleidoscope/Chapter5/Makefile @@ -10,6 +10,6 @@ LEVEL = ../../.. TOOLNAME = Kaleidoscope-Ch5 EXAMPLE_TOOL = 1 -LINK_COMPONENTS := core jit native +LINK_COMPONENTS := core mcjit native include $(LEVEL)/Makefile.common diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp index a31b5b4..4929a20 100644 --- a/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/Chapter5/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" @@ -817,11 +816,13 @@ int main() { getNextToken(); // Make the module, which holds all the code. - TheModule = new Module("my cool jit", Context); + std::unique_ptr Owner = make_unique("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); @@ -832,7 +833,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. -- cgit v1.1