Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Reapply part of r237975, "Fix Clang -Wmissing-override warning", exce…
Browse files Browse the repository at this point in the history
…pt for DIContext.h, to apease g++-4.7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238012 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed May 22, 2015
1 parent c189633 commit 2510383
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
11 changes: 10 additions & 1 deletion include/llvm/ExecutionEngine/RuntimeDyld.h
Expand Up @@ -62,7 +62,7 @@ class RuntimeDyld {
unsigned EndIdx)
: RTDyld(RTDyld), BeginIdx(BeginIdx), EndIdx(EndIdx) { }

virtual ~LoadedObjectInfo() {}
virtual ~LoadedObjectInfo() = default;

virtual object::OwningBinary<object::ObjectFile>
getObjectForDebug(const object::ObjectFile &Obj) const = 0;
Expand All @@ -76,6 +76,15 @@ class RuntimeDyld {
unsigned BeginIdx, EndIdx;
};

template <typename Derived> struct LoadedObjectInfoHelper : LoadedObjectInfo {
LoadedObjectInfoHelper(RuntimeDyldImpl &RTDyld, unsigned BeginIdx,
unsigned EndIdx)
: LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {}
llvm::LoadedObjectInfo *clone() const override {
return new Derived(static_cast<const Derived &>(*this));
}
};

/// \brief Memory Management.
class MemoryManager {
public:
Expand Down
7 changes: 3 additions & 4 deletions lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
Expand Up @@ -24,18 +24,17 @@ using namespace llvm::object;

namespace {

class LoadedCOFFObjectInfo : public RuntimeDyld::LoadedObjectInfo {
class LoadedCOFFObjectInfo
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedCOFFObjectInfo> {
public:
LoadedCOFFObjectInfo(RuntimeDyldImpl &RTDyld, unsigned BeginIdx,
unsigned EndIdx)
: RuntimeDyld::LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {}
: LoadedObjectInfoHelper(RTDyld, BeginIdx, EndIdx) {}

OwningBinary<ObjectFile>
getObjectForDebug(const ObjectFile &Obj) const override {
return OwningBinary<ObjectFile>();
}

RuntimeDyld::LoadedObjectInfo *clone() const { return new LoadedCOFFObjectInfo(*this); }
};
}

Expand Down
7 changes: 3 additions & 4 deletions lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
Expand Up @@ -104,16 +104,15 @@ void DyldELFObject<ELFT>::updateSymbolAddress(const SymbolRef &SymRef,
sym->st_value = static_cast<addr_type>(Addr);
}

class LoadedELFObjectInfo : public RuntimeDyld::LoadedObjectInfo {
class LoadedELFObjectInfo
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedELFObjectInfo> {
public:
LoadedELFObjectInfo(RuntimeDyldImpl &RTDyld, unsigned BeginIdx,
unsigned EndIdx)
: RuntimeDyld::LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {}
: LoadedObjectInfoHelper(RTDyld, BeginIdx, EndIdx) {}

OwningBinary<ObjectFile>
getObjectForDebug(const ObjectFile &Obj) const override;

RuntimeDyld::LoadedObjectInfo *clone() const { return new LoadedELFObjectInfo(*this); }
};

template <typename ELFT>
Expand Down
7 changes: 3 additions & 4 deletions lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
Expand Up @@ -26,18 +26,17 @@ using namespace llvm::object;

namespace {

class LoadedMachOObjectInfo : public RuntimeDyld::LoadedObjectInfo {
class LoadedMachOObjectInfo
: public RuntimeDyld::LoadedObjectInfoHelper<LoadedMachOObjectInfo> {
public:
LoadedMachOObjectInfo(RuntimeDyldImpl &RTDyld, unsigned BeginIdx,
unsigned EndIdx)
: RuntimeDyld::LoadedObjectInfo(RTDyld, BeginIdx, EndIdx) {}
: LoadedObjectInfoHelper(RTDyld, BeginIdx, EndIdx) {}

OwningBinary<ObjectFile>
getObjectForDebug(const ObjectFile &Obj) const override {
return OwningBinary<ObjectFile>();
}

RuntimeDyld::LoadedObjectInfo *clone() const { return new LoadedMachOObjectInfo(*this); }
};

}
Expand Down

0 comments on commit 2510383

Please sign in to comment.