diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index bdfd6683f80..fa927d9d6bd 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -140,6 +140,10 @@ private: /// to be used by the DIContext implementations when applying relocations /// on the fly. class LoadedObjectInfo { +protected: + LoadedObjectInfo(const LoadedObjectInfo &) = default; + LoadedObjectInfo() = default; + public: virtual ~LoadedObjectInfo() = default; diff --git a/include/llvm/ExecutionEngine/RuntimeDyld.h b/include/llvm/ExecutionEngine/RuntimeDyld.h index 17c5fbd5649..7aaee150566 100644 --- a/include/llvm/ExecutionEngine/RuntimeDyld.h +++ b/include/llvm/ExecutionEngine/RuntimeDyld.h @@ -79,6 +79,11 @@ public: }; template struct LoadedObjectInfoHelper : LoadedObjectInfo { + protected: + LoadedObjectInfoHelper(const LoadedObjectInfoHelper &) = default; + LoadedObjectInfoHelper() = default; + + public: LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, LoadedObjectInfo::ObjSectionToIDMap ObjSecToIDMap) : LoadedObjectInfo(RTDyld, std::move(ObjSecToIDMap)) {} diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp index e2979a6140f..338724dd8f4 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp @@ -24,7 +24,7 @@ using namespace llvm::object; namespace { -class LoadedCOFFObjectInfo +class LoadedCOFFObjectInfo final : public RuntimeDyld::LoadedObjectInfoHelper { public: LoadedCOFFObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index dfa52fbea75..a93c3d3098c 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -104,7 +104,7 @@ void DyldELFObject::updateSymbolAddress(const SymbolRef &SymRef, sym->st_value = static_cast(Addr); } -class LoadedELFObjectInfo +class LoadedELFObjectInfo final : public RuntimeDyld::LoadedObjectInfoHelper { public: LoadedELFObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp index c9bd11a1e1d..7601ba26f90 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp @@ -26,7 +26,7 @@ using namespace llvm::object; namespace { -class LoadedMachOObjectInfo +class LoadedMachOObjectInfo final : public RuntimeDyld::LoadedObjectInfoHelper { public: LoadedMachOObjectInfo(RuntimeDyldImpl &RTDyld,