LoadedObjectInfo was depending on the implicit copy ctor in the presence
of a user-declared dtor. Default (and protect) it in the base class and
make the devired classes final to avoid any risk of a public API that
would enable slicing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244112
91177308-0d34-0410-b5e6-
96231b3b80d8
/// 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;
};
template <typename Derived> struct LoadedObjectInfoHelper : LoadedObjectInfo {
+ protected:
+ LoadedObjectInfoHelper(const LoadedObjectInfoHelper &) = default;
+ LoadedObjectInfoHelper() = default;
+
+ public:
LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld,
LoadedObjectInfo::ObjSectionToIDMap ObjSecToIDMap)
: LoadedObjectInfo(RTDyld, std::move(ObjSecToIDMap)) {}
namespace {
-class LoadedCOFFObjectInfo
+class LoadedCOFFObjectInfo final
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedCOFFObjectInfo> {
public:
LoadedCOFFObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
sym->st_value = static_cast<addr_type>(Addr);
}
-class LoadedELFObjectInfo
+class LoadedELFObjectInfo final
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedELFObjectInfo> {
public:
LoadedELFObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
namespace {
-class LoadedMachOObjectInfo
+class LoadedMachOObjectInfo final
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedMachOObjectInfo> {
public:
LoadedMachOObjectInfo(RuntimeDyldImpl &RTDyld,