[Orc] Use '= default' for move constructor/assignment as per dblaikie's review.
[oota-llvm.git] / include / llvm / ExecutionEngine / Orc / CompileOnDemandLayer.h
index 62647680aa6d921baba920a265866472c2a1640e..a72805d2af9633b634f301eecc2fd7e53534ee1f 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/ExecutionEngine/SectionMemoryManager.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include <list>
+#include <memory>
 #include <set>
 
 #include "llvm/Support/Debug.h"
@@ -43,7 +44,7 @@ class CompileOnDemandLayer {
 private:
 
   template <typename MaterializerFtor>
-  class LambdaMaterializer : public ValueMaterializer {
+  class LambdaMaterializer final : public ValueMaterializer {
   public:
     LambdaMaterializer(MaterializerFtor M) : M(std::move(M)) {}
     Value* materializeValueFor(Value *V) final {
@@ -57,7 +58,7 @@ private:
   LambdaMaterializer<MaterializerFtor>
   createLambdaMaterializer(MaterializerFtor M) {
     return LambdaMaterializer<MaterializerFtor>(std::move(M));
-  };
+  }
 
   typedef typename BaseLayerT::ModuleSetHandleT BaseLayerModuleSetHandleT;
 
@@ -66,6 +67,14 @@ private:
     std::set<const Function*> StubsToClone;
     std::unique_ptr<IndirectStubsMgrT> StubsMgr;
 
+    LogicalModuleResources() {}
+
+    // Explicit move constructor to make MSVC happy.
+    LogicalModuleResources(LogicalModuleResources &&Other) = default;
+
+    // Explicit move assignment to make MSVC happy.
+    LogicalModuleResources& operator=(LogicalModuleResources &&Other) = default;
+
     JITSymbol findSymbol(StringRef Name, bool ExportedSymbolsOnly) {
       if (Name.endswith("$stub_ptr") && !ExportedSymbolsOnly) {
         assert(!ExportedSymbolsOnly && "Stubs are never exported");
@@ -232,7 +241,7 @@ private:
     // Initializers may refer to functions declared (but not defined) in this
     // module. Build a materializer to clone decls on demand.
     auto Materializer = createLambdaMaterializer(
-      [&GVsM, &LMResources](Value *V) -> Value* {
+      [this, &GVsM, &LMResources](Value *V) -> Value* {
         if (auto *F = dyn_cast<Function>(V)) {
           // Decls in the original module just get cloned.
           if (F->isDeclaration())