diff options
Diffstat (limited to 'examples')
4 files changed, 12 insertions, 12 deletions
diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h index b6323b8963b..679d72e2050 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h @@ -51,7 +51,7 @@ private: IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; using OptimizeFunction = - std::function<std::shared_ptr<Module>(std::shared_ptr<Module>)>; + std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>; IRTransformLayer<decltype(CompileLayer), OptimizeFunction> OptimizeLayer; @@ -77,7 +77,7 @@ public: std::make_shared<SectionMemoryManager>(), Resolver}; }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), - OptimizeLayer(CompileLayer, [this](std::shared_ptr<Module> M) { + OptimizeLayer(CompileLayer, [this](std::unique_ptr<Module> M) { return optimizeModule(std::move(M)); }) { llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr); @@ -104,7 +104,7 @@ public: } private: - std::shared_ptr<Module> optimizeModule(std::shared_ptr<Module> M) { + std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) { // Create a function pass manager. auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h index d6d31870002..cca82293018 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h @@ -55,7 +55,7 @@ private: IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; using OptimizeFunction = - std::function<std::shared_ptr<Module>(std::shared_ptr<Module>)>; + std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>; IRTransformLayer<decltype(CompileLayer), OptimizeFunction> OptimizeLayer; @@ -73,7 +73,7 @@ public: }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, - [this](std::shared_ptr<Module> M) { + [this](std::unique_ptr<Module> M) { return optimizeModule(std::move(M)); }), CompileCallbackManager( @@ -127,7 +127,7 @@ public: } private: - std::shared_ptr<Module> optimizeModule(std::shared_ptr<Module> M) { + std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) { // Create a function pass manager. auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h index f3878918065..6378dd61e29 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h @@ -81,7 +81,7 @@ private: IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; using OptimizeFunction = - std::function<std::shared_ptr<Module>(std::shared_ptr<Module>)>; + std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>; IRTransformLayer<decltype(CompileLayer), OptimizeFunction> OptimizeLayer; @@ -113,7 +113,7 @@ public: }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, - [this](std::shared_ptr<Module> M) { + [this](std::unique_ptr<Module> M) { return optimizeModule(std::move(M)); }), CompileCallbackMgr( @@ -207,7 +207,7 @@ private: return MangledNameStream.str(); } - std::shared_ptr<Module> optimizeModule(std::shared_ptr<Module> M) { + std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) { // Create a function pass manager. auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get()); diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h b/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h index 46638c1f720..acb4090b5eb 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h @@ -86,7 +86,7 @@ private: IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; using OptimizeFunction = - std::function<std::shared_ptr<Module>(std::shared_ptr<Module>)>; + std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>; IRTransformLayer<decltype(CompileLayer), OptimizeFunction> OptimizeLayer; @@ -121,7 +121,7 @@ public: }), CompileLayer(ObjectLayer, SimpleCompiler(*TM)), OptimizeLayer(CompileLayer, - [this](std::shared_ptr<Module> M) { + [this](std::unique_ptr<Module> M) { return optimizeModule(std::move(M)); }), Remote(Remote) { @@ -223,7 +223,7 @@ private: return MangledNameStream.str(); } - std::shared_ptr<Module> optimizeModule(std::shared_ptr<Module> M) { + std::unique_ptr<Module> optimizeModule(std::unique_ptr<Module> M) { // Create a function pass manager. auto FPM = llvm::make_unique<legacy::FunctionPassManager>(M.get()); |