mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
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. llvm-svn: 244112
This commit is contained in:
parent
1c21053d08
commit
38e693eea1
@ -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;
|
||||
|
||||
|
@ -79,6 +79,11 @@ public:
|
||||
};
|
||||
|
||||
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)) {}
|
||||
|
@ -24,7 +24,7 @@ using namespace llvm::object;
|
||||
|
||||
namespace {
|
||||
|
||||
class LoadedCOFFObjectInfo
|
||||
class LoadedCOFFObjectInfo final
|
||||
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedCOFFObjectInfo> {
|
||||
public:
|
||||
LoadedCOFFObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
|
||||
|
@ -104,7 +104,7 @@ void DyldELFObject<ELFT>::updateSymbolAddress(const SymbolRef &SymRef,
|
||||
sym->st_value = static_cast<addr_type>(Addr);
|
||||
}
|
||||
|
||||
class LoadedELFObjectInfo
|
||||
class LoadedELFObjectInfo final
|
||||
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedELFObjectInfo> {
|
||||
public:
|
||||
LoadedELFObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
|
||||
|
@ -26,7 +26,7 @@ using namespace llvm::object;
|
||||
|
||||
namespace {
|
||||
|
||||
class LoadedMachOObjectInfo
|
||||
class LoadedMachOObjectInfo final
|
||||
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedMachOObjectInfo> {
|
||||
public:
|
||||
LoadedMachOObjectInfo(RuntimeDyldImpl &RTDyld,
|
||||
|
Loading…
Reference in New Issue
Block a user