summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-03-08 07:51:20 +0000
committerCraig Topper <craig.topper@gmail.com>2014-03-08 07:51:20 +0000
commit838cb749dceb62a35d1966833f1a577cd61938ad (patch)
tree661caadb12e0f78a0e462d01fecf0f728a8114da /lib/ExecutionEngine/RuntimeDyld
parent1829d9d29031917d17cd12add6ed91eaee02686b (diff)
downloadllvm-838cb749dceb62a35d1966833f1a577cd61938ad.tar.gz
llvm-838cb749dceb62a35d1966833f1a577cd61938ad.tar.bz2
llvm-838cb749dceb62a35d1966833f1a577cd61938ad.tar.xz
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203344 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp4
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h38
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp12
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h32
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h24
5 files changed, 51 insertions, 59 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp b/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
index 5878e59283..d5587b34a5 100644
--- a/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp
@@ -84,12 +84,12 @@ public:
/// Creates an entry in the JIT registry for the buffer @p Object,
/// which must contain an object file in executable memory with any
/// debug information for the debugger.
- void registerObject(const ObjectBuffer &Object);
+ void registerObject(const ObjectBuffer &Object) override;
/// Removes the internal registration of @p Object, and
/// frees associated resources.
/// Returns true if @p Object was found in ObjectBufferMap.
- bool deregisterObject(const ObjectBuffer &Object);
+ bool deregisterObject(const ObjectBuffer &Object) override;
private:
/// Deregister the debug info for the given object file from the debugger
diff --git a/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h b/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
index f647b87f59..3693c6932f 100644
--- a/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
+++ b/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
@@ -27,7 +27,7 @@ namespace object {
class ObjectImageCommon : public ObjectImage {
ObjectImageCommon(); // = delete
ObjectImageCommon(const ObjectImageCommon &other); // = delete
- virtual void anchor();
+ void anchor() override;
protected:
object::ObjectFile *ObjFile;
@@ -51,33 +51,33 @@ public:
: ObjectImage(NULL), ObjFile(Input) {}
virtual ~ObjectImageCommon() { delete ObjFile; }
- virtual object::symbol_iterator begin_symbols() const
- { return ObjFile->symbol_begin(); }
- virtual object::symbol_iterator end_symbols() const
- { return ObjFile->symbol_end(); }
+ object::symbol_iterator begin_symbols() const override
+ { return ObjFile->symbol_begin(); }
+ object::symbol_iterator end_symbols() const override
+ { return ObjFile->symbol_end(); }
- virtual object::section_iterator begin_sections() const
- { return ObjFile->section_begin(); }
- virtual object::section_iterator end_sections() const
- { return ObjFile->section_end(); }
+ object::section_iterator begin_sections() const override
+ { return ObjFile->section_begin(); }
+ object::section_iterator end_sections() const override
+ { return ObjFile->section_end(); }
- virtual /* Triple::ArchType */ unsigned getArch() const
- { return ObjFile->getArch(); }
+ /* Triple::ArchType */ unsigned getArch() const override
+ { return ObjFile->getArch(); }
- virtual StringRef getData() const { return ObjFile->getData(); }
+ StringRef getData() const override { return ObjFile->getData(); }
- virtual object::ObjectFile* getObjectFile() const { return ObjFile; }
+ object::ObjectFile* getObjectFile() const override { return ObjFile; }
// Subclasses can override these methods to update the image with loaded
// addresses for sections and common symbols
- virtual void updateSectionAddress(const object::SectionRef &Sec,
- uint64_t Addr) {}
- virtual void updateSymbolAddress(const object::SymbolRef &Sym, uint64_t Addr)
- {}
+ void updateSectionAddress(const object::SectionRef &Sec,
+ uint64_t Addr) override {}
+ void updateSymbolAddress(const object::SymbolRef &Sym,
+ uint64_t Addr) override {}
// Subclasses can override these methods to provide JIT debugging support
- virtual void registerWithDebugger() {}
- virtual void deregisterWithDebugger() {}
+ void registerWithDebugger() override {}
+ void deregisterWithDebugger() override {}
};
} // end namespace llvm
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
index 6ca7fd38d2..0a593e60f2 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -94,23 +94,19 @@ class ELFObjectImage : public ObjectImageCommon {
// Subclasses can override these methods to update the image with loaded
// addresses for sections and common symbols
- virtual void updateSectionAddress(const SectionRef &Sec, uint64_t Addr)
- {
+ void updateSectionAddress(const SectionRef &Sec, uint64_t Addr) override {
DyldObj->updateSectionAddress(Sec, Addr);
}
- virtual void updateSymbolAddress(const SymbolRef &Sym, uint64_t Addr)
- {
+ void updateSymbolAddress(const SymbolRef &Sym, uint64_t Addr) override {
DyldObj->updateSymbolAddress(Sym, Addr);
}
- virtual void registerWithDebugger()
- {
+ void registerWithDebugger() override {
JITRegistrar::getGDBRegistrar().registerObject(*Buffer);
Registered = true;
}
- virtual void deregisterWithDebugger()
- {
+ void deregisterWithDebugger() override {
JITRegistrar::getGDBRegistrar().deregisterObject(*Buffer);
}
};
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
index 2ed2957d96..707940ec33 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
@@ -82,7 +82,7 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
uint32_t Type,
int64_t Addend);
- unsigned getMaxStubSize() {
+ unsigned getMaxStubSize() override {
if (Arch == Triple::aarch64)
return 20; // movz; movk; movk; movk; br
if (Arch == Triple::arm || Arch == Triple::thumb)
@@ -99,7 +99,7 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
return 0;
}
- unsigned getStubAlignment() {
+ unsigned getStubAlignment() override {
if (Arch == Triple::systemz)
return 8;
else
@@ -114,7 +114,7 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
uint64_t findGOTEntry(uint64_t LoadAddr, uint64_t Offset);
size_t getGOTEntrySize();
- virtual void updateGOTEntries(StringRef Name, uint64_t Addr);
+ void updateGOTEntries(StringRef Name, uint64_t Addr) override;
// Relocation entries for symbols whose position-independent offset is
// updated in a global offset table.
@@ -132,20 +132,18 @@ public:
RuntimeDyldELF(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm)
{}
- virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value);
- virtual void processRelocationRef(unsigned SectionID,
- RelocationRef RelI,
- ObjectImage &Obj,
- ObjSectionToIDMap &ObjSectionToID,
- const SymbolTableMap &Symbols,
- StubMap &Stubs);
- virtual bool isCompatibleFormat(const ObjectBuffer *Buffer) const;
- virtual bool isCompatibleFile(const object::ObjectFile *Buffer) const;
- virtual ObjectImage *createObjectImage(ObjectBuffer *InputBuffer);
- virtual ObjectImage *createObjectImageFromFile(object::ObjectFile *Obj);
- virtual void registerEHFrames();
- virtual void deregisterEHFrames();
- virtual void finalizeLoad(ObjSectionToIDMap &SectionMap);
+ void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
+ void processRelocationRef(unsigned SectionID, RelocationRef RelI,
+ ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID,
+ const SymbolTableMap &Symbols,
+ StubMap &Stubs) override;
+ bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
+ bool isCompatibleFile(const object::ObjectFile *Buffer) const override;
+ ObjectImage *createObjectImage(ObjectBuffer *InputBuffer) override;
+ ObjectImage *createObjectImageFromFile(object::ObjectFile *Obj) override;
+ void registerEHFrames() override;
+ void deregisterEHFrames() override;
+ void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
virtual ~RuntimeDyldELF();
};
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
index d42e2972aa..bddf37958f 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
@@ -55,7 +55,7 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
bool isPCRel,
unsigned Size);
- unsigned getMaxStubSize() {
+ unsigned getMaxStubSize() override {
if (Arch == Triple::arm || Arch == Triple::thumb)
return 8; // 32-bit instruction and 32-bit address
else if (Arch == Triple::x86_64)
@@ -64,7 +64,7 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
return 0;
}
- unsigned getStubAlignment() {
+ unsigned getStubAlignment() override {
return 1;
}
@@ -86,17 +86,15 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
public:
RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
- virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value);
- virtual void processRelocationRef(unsigned SectionID,
- RelocationRef RelI,
- ObjectImage &Obj,
- ObjSectionToIDMap &ObjSectionToID,
- const SymbolTableMap &Symbols,
- StubMap &Stubs);
- virtual bool isCompatibleFormat(const ObjectBuffer *Buffer) const;
- virtual bool isCompatibleFile(const object::ObjectFile *Obj) const;
- virtual void registerEHFrames();
- virtual void finalizeLoad(ObjSectionToIDMap &SectionMap);
+ void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
+ void processRelocationRef(unsigned SectionID, RelocationRef RelI,
+ ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID,
+ const SymbolTableMap &Symbols,
+ StubMap &Stubs) override;
+ bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
+ bool isCompatibleFile(const object::ObjectFile *Obj) const override;
+ void registerEHFrames() override;
+ void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
};
} // end namespace llvm