[lld] r205057 - [MachO] Remove "virtual" and add "override".
Rui Ueyama
ruiu at google.com
Fri Mar 28 14:36:34 PDT 2014
Author: ruiu
Date: Fri Mar 28 16:36:33 2014
New Revision: 205057
URL: http://llvm.org/viewvc/llvm-project?rev=205057&view=rev
Log:
[MachO] Remove "virtual" and add "override".
Modified:
lld/trunk/lib/ReaderWriter/MachO/Atoms.h
lld/trunk/lib/ReaderWriter/MachO/GOTPass.hpp
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFile.h
lld/trunk/lib/ReaderWriter/MachO/ReferenceKinds.h
lld/trunk/lib/ReaderWriter/MachO/StubAtoms.hpp
lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp
lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
lld/trunk/lib/ReaderWriter/MachO/StubsPass.hpp
Modified: lld/trunk/lib/ReaderWriter/MachO/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/Atoms.h?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/Atoms.h Fri Mar 28 16:36:33 2014
@@ -21,15 +21,15 @@ public:
const ArrayRef<uint8_t> content, Scope scope)
: SimpleDefinedAtom(f), _name(name), _content(content), _scope(scope) {}
- virtual uint64_t size() const { return rawContent().size(); }
+ uint64_t size() const override { return rawContent().size(); }
- virtual ContentType contentType() const { return DefinedAtom::typeCode; }
+ ContentType contentType() const override { return DefinedAtom::typeCode; }
- virtual StringRef name() const { return _name; }
+ StringRef name() const override { return _name; }
- virtual Scope scope() const { return _scope; }
+ Scope scope() const override { return _scope; }
- virtual ArrayRef<uint8_t> rawContent() const { return _content; }
+ ArrayRef<uint8_t> rawContent() const override { return _content; }
private:
const StringRef _name;
Modified: lld/trunk/lib/ReaderWriter/MachO/GOTPass.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/GOTPass.hpp?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/GOTPass.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/GOTPass.hpp Fri Mar 28 16:36:33 2014
@@ -25,19 +25,19 @@ namespace mach_o {
class GOTPass : public lld::GOTPass {
public:
- virtual bool noTextRelocs() {
+ bool noTextRelocs() override {
return true;
}
- virtual bool isGOTAccess(const Reference &, bool &canBypassGOT) {
+ bool isGOTAccess(const Reference &, bool &canBypassGOT) override {
return false;
}
- virtual void updateReferenceToGOT(const Reference*, bool targetIsNowGOT) {
+ void updateReferenceToGOT(const Reference*, bool targetIsNowGOT) override {
}
- virtual const DefinedAtom* makeGOTEntry(const Atom&) {
+ const DefinedAtom* makeGOTEntry(const Atom&) override {
return nullptr;
}
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFile.h?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFile.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFile.h Fri Mar 28 16:36:33 2014
@@ -278,10 +278,9 @@ normalizedFromAtoms(const lld::File &ato
/// Class for interfacing mach-o yaml files into generic yaml parsing
class MachOYamlIOTaggedDocumentHandler : public YamlIOTaggedDocumentHandler {
- bool handledDocTag(llvm::yaml::IO &io, const lld::File *&file) const;
+ bool handledDocTag(llvm::yaml::IO &io, const lld::File *&file) const override;
};
-
} // namespace mach_o
} // namespace lld
Modified: lld/trunk/lib/ReaderWriter/MachO/ReferenceKinds.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ReferenceKinds.h?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ReferenceKinds.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ReferenceKinds.h Fri Mar 28 16:36:33 2014
@@ -78,30 +78,29 @@ public:
static const Registry::KindStrings kindStrings[];
virtual ~KindHandler_x86_64();
- virtual bool isCallSite(const Reference &);
- virtual bool isPointer(const Reference &);
- virtual bool isLazyImmediate(const Reference &);
- virtual bool isLazyTarget(const Reference &);
+ bool isCallSite(const Reference &) override;
+ bool isPointer(const Reference &) override;
+ bool isLazyImmediate(const Reference &) override;
+ bool isLazyTarget(const Reference &) override;
virtual void applyFixup(Reference::KindNamespace ns, Reference::KindArch arch,
Reference::KindValue kindValue, uint64_t addend,
uint8_t *location, uint64_t fixupAddress,
- uint64_t targetAddress);
+ uint64_t targetAddress) override;
};
-
class KindHandler_x86 : public KindHandler {
public:
static const Registry::KindStrings kindStrings[];
virtual ~KindHandler_x86();
- virtual bool isCallSite(const Reference &);
- virtual bool isPointer(const Reference &);
- virtual bool isLazyImmediate(const Reference &);
- virtual bool isLazyTarget(const Reference &);
+ bool isCallSite(const Reference &) override;
+ bool isPointer(const Reference &) override;
+ bool isLazyImmediate(const Reference &) override;
+ bool isLazyTarget(const Reference &) override;
virtual void applyFixup(Reference::KindNamespace ns, Reference::KindArch arch,
Reference::KindValue kindValue, uint64_t addend,
uint8_t *location, uint64_t fixupAddress,
- uint64_t targetAddress);
+ uint64_t targetAddress) override;
};
class KindHandler_arm : public KindHandler {
@@ -109,18 +108,16 @@ public:
static const Registry::KindStrings kindStrings[];
virtual ~KindHandler_arm();
- virtual bool isCallSite(const Reference &);
- virtual bool isPointer(const Reference &);
- virtual bool isLazyImmediate(const Reference &);
- virtual bool isLazyTarget(const Reference &);
- virtual void applyFixup(Reference::KindNamespace ns, Reference::KindArch arch,
- Reference::KindValue kindValue, uint64_t addend,
- uint8_t *location, uint64_t fixupAddress,
- uint64_t targetAddress);
+ bool isCallSite(const Reference &) override;
+ bool isPointer(const Reference &) override;
+ bool isLazyImmediate(const Reference &) override;
+ bool isLazyTarget(const Reference &) override;
+ void applyFixup(Reference::KindNamespace ns, Reference::KindArch arch,
+ Reference::KindValue kindValue, uint64_t addend,
+ uint8_t *location, uint64_t fixupAddress,
+ uint64_t targetAddress) override;
};
-
-
} // namespace mach_o
} // namespace lld
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms.hpp?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms.hpp Fri Mar 28 16:36:33 2014
@@ -34,23 +34,23 @@ public:
StubBinderAtom(const File &f) : _file(f) {
}
- virtual const File& file() const {
+ const File& file() const override {
return _file;
}
- virtual StringRef name() const {
+ StringRef name() const override {
return StringRef("dyld_stub_binder");
}
- virtual StringRef loadName() const {
+ StringRef loadName() const override {
return StringRef("/usr/lib/libSystem.B.dylib");
}
- virtual bool canBeNullAtRuntime() const {
+ bool canBeNullAtRuntime() const override {
return false;
}
- virtual Type type() const {
+ Type type() const override {
return Type::Unknown;
}
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp Fri Mar 28 16:36:33 2014
@@ -36,19 +36,19 @@ public:
&lazyPointer, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeStub;
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 6;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permR_X;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t instructions[] =
{ 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00 }; // jmp *lazyPointer
assert(sizeof(instructions) == this->size());
@@ -73,19 +73,19 @@ public:
&binder, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeStubHelper;
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 12;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permR_X;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t instructions[] =
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushl $dyld_ImageLoaderCache
0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *_fast_lazy_bind
@@ -111,19 +111,19 @@ public:
&helperCommon, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeStubHelper;
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 10;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permR_X;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t instructions[] =
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset
0xE9, 0x00, 0x00, 0x00, 0x00 }; // jmp helperhelper
@@ -148,23 +148,23 @@ public:
&shlib, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeLazyPointer;
}
- virtual Alignment alignment() const {
+ Alignment alignment() const override {
return Alignment(2);
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 4;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permRW_;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x00 };
return makeArrayRef(bytes);
}
@@ -186,23 +186,23 @@ public:
&shlib, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeGOT;
}
- virtual Alignment alignment() const {
+ Alignment alignment() const override {
return Alignment(2);
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 4;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permRW_;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x0 };
return makeArrayRef(bytes);
}
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp Fri Mar 28 16:36:33 2014
@@ -37,19 +37,19 @@ public:
&lazyPointer, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeStub;
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 6;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permR_X;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t instructions[] =
{ 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00 }; // jmp *lazyPointer
assert(sizeof(instructions) == this->size());
@@ -73,19 +73,19 @@ public:
&binder, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeStubHelper;
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 16;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permR_X;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t instructions[] =
{ 0x4C, 0x8D, 0x1D, 0x00, 0x00, 0x00, 0x00, // leaq cache(%rip),%r11
0x41, 0x53, // push %r11
@@ -111,19 +111,19 @@ public:
&helperCommon, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeStubHelper;
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 10;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permR_X;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t instructions[] =
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset
0xE9, 0x00, 0x00, 0x00, 0x00 }; // jmp helperhelper
@@ -148,23 +148,23 @@ public:
LLD_X86_64_RELOC_LAZY_TARGET, 0, &shlib, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeLazyPointer;
}
- virtual Alignment alignment() const {
+ Alignment alignment() const override {
return Alignment(3);
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 8;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permRW_;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t bytes[] =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
return makeArrayRef(bytes);
@@ -186,23 +186,23 @@ public:
&shlib, 0);
}
- virtual ContentType contentType() const {
+ ContentType contentType() const override {
return DefinedAtom::typeGOT;
}
- virtual Alignment alignment() const {
+ Alignment alignment() const override {
return Alignment(3);
}
- virtual uint64_t size() const {
+ uint64_t size() const override {
return 8;
}
- virtual ContentPermissions permissions() const {
+ ContentPermissions permissions() const override {
return DefinedAtom::permRW_;
}
- virtual ArrayRef<uint8_t> rawContent() const {
+ ArrayRef<uint8_t> rawContent() const override {
static const uint8_t bytes[] =
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
return makeArrayRef(bytes);
Modified: lld/trunk/lib/ReaderWriter/MachO/StubsPass.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubsPass.hpp?rev=205057&r1=205056&r2=205057&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubsPass.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubsPass.hpp Fri Mar 28 16:36:33 2014
@@ -37,15 +37,15 @@ public:
, _helperBinderAtom(nullptr) {
}
- virtual bool noTextRelocs() {
+ bool noTextRelocs() override {
return true;
}
- virtual bool isCallSite(const Reference &ref) {
+ bool isCallSite(const Reference &ref) override {
return _kindHandler.isCallSite(ref);
}
- virtual const DefinedAtom* getStub(const Atom& target) {
+ const DefinedAtom* getStub(const Atom& target) override {
auto pos = _targetToStub.find(&target);
if ( pos != _targetToStub.end() ) {
// Reuse an existing stub.
@@ -121,7 +121,7 @@ public:
}
- virtual void addStubAtoms(MutableFile &mergedFile) {
+ void addStubAtoms(MutableFile &mergedFile) override {
// Exit early if no stubs needed.
if (_targetToStub.empty())
return;
More information about the llvm-commits
mailing list