From d09c631f071640130c0c91f8f8c219ea31a23f32 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 23 Jan 2015 22:25:47 +0000 Subject: [PATCH] Fix the MSVC build with the new Orc JIT APIs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226949 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h | 8 +++++++- lib/ExecutionEngine/Orc/OrcMCJITReplacement.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h index ff358007a72..568f1051669 100644 --- a/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h +++ b/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h @@ -32,11 +32,17 @@ protected: /// had been provided by this instance. Higher level layers are responsible /// for taking any action required to handle the missing symbols. class LinkedObjectSet { + LinkedObjectSet(const LinkedObjectSet&) LLVM_DELETED_FUNCTION; + void operator=(const LinkedObjectSet&) LLVM_DELETED_FUNCTION; public: LinkedObjectSet(std::unique_ptr MM) : MM(std::move(MM)), RTDyld(llvm::make_unique(&*this->MM)), State(Raw) {} + // MSVC 2012 cannot infer a move constructor, so write it out longhand. + LinkedObjectSet(LinkedObjectSet &&O) + : MM(std::move(O.MM)), RTDyld(std::move(O.RTDyld)), State(O.State) {} + std::unique_ptr addObject(const object::ObjectFile &Obj) { return RTDyld->loadObject(Obj); @@ -74,7 +80,7 @@ protected: public: /// @brief Handle to a set of loaded objects. - typedef typename LinkedObjectSetListT::iterator ObjSetHandleT; + typedef LinkedObjectSetListT::iterator ObjSetHandleT; }; /// @brief Default (no-op) action to perform when loading objects. diff --git a/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h index aea58575629..03289ed70b1 100644 --- a/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h +++ b/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h @@ -129,7 +129,7 @@ public: setDataLayout(this->TM->getSubtargetImpl()->getDataLayout()); } - void addModule(std::unique_ptr M) { + void addModule(std::unique_ptr M) override { // If this module doesn't have a DataLayout attached then attach the // default. @@ -258,7 +258,7 @@ private: const ObjListT &Objects, const LoadedObjInfoListT &Infos) const { M.UnfinalizedSections[H] = std::move(M.SectionsAllocatedSinceLastLoad); - M.SectionsAllocatedSinceLastLoad = {}; + M.SectionsAllocatedSinceLastLoad = SectionAddrSet{}; assert(Objects.size() == Infos.size() && "Incorrect number of Infos for Objects."); for (unsigned I = 0; I < Objects.size(); ++I)