#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include <list>
+#include <memory>
#include <set>
#include "llvm/Support/Debug.h"
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 {
LambdaMaterializer<MaterializerFtor>
createLambdaMaterializer(MaterializerFtor M) {
return LambdaMaterializer<MaterializerFtor>(std::move(M));
- };
+ }
typedef typename BaseLayerT::ModuleSetHandleT BaseLayerModuleSetHandleT;
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");
// 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())