<div dir="ltr">Thank you for doing this. We should do this to the entire source tree to keep up with the LLVM coding convention.. I'll do.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 6, 2014 at 2:29 AM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: atanasyan<br>
Date: Thu Mar 6 04:29:45 2014<br>
New Revision: 203102<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=203102&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=203102&view=rev</a><br>
Log:<br>
[Mips] Replace "virtual" by "override" in member function declarations<br>
where it is appropriate.<br>
<br>
Modified:<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h Thu Mar 6 04:29:45 2014<br>
@@ -28,11 +28,11 @@ public:<br>
<br>
protected:<br>
// Add any runtime files and their atoms to the output<br>
- virtual bool createImplicitFiles(std::vector<std::unique_ptr<File>> &);<br>
+ bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;<br>
<br>
- virtual void finalizeDefaultAtomValues();<br>
+ void finalizeDefaultAtomValues() override;<br>
<br>
- virtual error_code setELFHeader() {<br>
+ error_code setELFHeader() override {<br>
DynamicLibraryWriter<ELFT>::setELFHeader();<br>
MipsELFWriter<ELFT>::setELFHeader(*this->_elfHeader);<br>
return error_code::success();<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicTable.h Thu Mar 6 04:29:45 2014<br>
@@ -27,7 +27,7 @@ public:<br>
DefaultLayout<MipsELFType>::ORDER_DYNAMIC),<br>
_mipsTargetLayout(layout) {}<br>
<br>
- virtual void createDefaultEntries() {<br>
+ void createDefaultEntries() override {<br>
DynamicTable<MipsELFType>::createDefaultEntries();<br>
<br>
typename DynamicTable<MipsELFType>::Elf_Dyn dyn;<br>
@@ -69,7 +69,7 @@ public:<br>
_dt_pltgot = this->addEntry(dyn);<br>
}<br>
<br>
- virtual void updateDynamicTable() {<br>
+ void updateDynamicTable() override {<br>
DynamicTable<MipsELFType>::updateDynamicTable();<br>
<br>
// Assign the minimum segment address to the DT_MIPS_BASE_ADDRESS tag.<br>
@@ -89,7 +89,7 @@ public:<br>
_mipsTargetLayout.findOutputSection(".got")->virtualAddr();<br>
}<br>
<br>
- virtual int64_t getGotPltTag() { return DT_MIPS_PLTGOT; }<br>
+ int64_t getGotPltTag() override { return DT_MIPS_PLTGOT; }<br>
<br>
private:<br>
std::size_t _dt_symtabno;<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h Thu Mar 6 04:29:45 2014<br>
@@ -27,14 +27,14 @@ public:<br>
MipsTargetLayout<ELFT> &layout);<br>
<br>
protected:<br>
- virtual void buildDynamicSymbolTable(const File &file);<br>
+ void buildDynamicSymbolTable(const File &file) override;<br>
<br>
// Add any runtime files and their atoms to the output<br>
- virtual bool createImplicitFiles(std::vector<std::unique_ptr<File>> &);<br>
+ bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;<br>
<br>
- virtual void finalizeDefaultAtomValues();<br>
+ void finalizeDefaultAtomValues() override;<br>
<br>
- virtual error_code setELFHeader() {<br>
+ error_code setELFHeader() override {<br>
ExecutableWriter<ELFT>::setELFHeader();<br>
MipsELFWriter<ELFT>::setELFHeader(*this->_elfHeader);<br>
return error_code::success();<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h Thu Mar 6 04:29:45 2014<br>
@@ -40,15 +40,15 @@ public:<br>
const MipsTargetLayout<Mips32ElELFType> &getTargetLayout() const;<br>
<br>
// ELFLinkingContext<br>
- virtual bool isLittleEndian() const;<br>
- virtual uint64_t getBaseAddress() const;<br>
- virtual StringRef entrySymbolName() const;<br>
- virtual StringRef getDefaultInterpreter() const;<br>
- virtual void addPasses(PassManager &pm);<br>
- virtual bool isRelaOutputFormat() const { return false; }<br>
- virtual bool isDynamicRelocation(const DefinedAtom &,<br>
- const Reference &r) const;<br>
- virtual bool isPLTRelocation(const DefinedAtom &, const Reference &r) const;<br>
+ bool isLittleEndian() const override;<br>
+ uint64_t getBaseAddress() const override;<br>
+ StringRef entrySymbolName() const override;<br>
+ StringRef getDefaultInterpreter() const override;<br>
+ void addPasses(PassManager &pm) override;<br>
+ bool isRelaOutputFormat() const override { return false; }<br>
+ bool isDynamicRelocation(const DefinedAtom &,<br>
+ const Reference &r) const override;<br>
+ bool isPLTRelocation(const DefinedAtom &, const Reference &r) const override;<br>
};<br>
<br>
} // elf<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h Thu Mar 6 04:29:45 2014<br>
@@ -25,9 +25,9 @@ public:<br>
<br>
~MipsTargetRelocationHandler();<br>
<br>
- virtual error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,<br>
- const lld::AtomLayout &,<br>
- const Reference &) const;<br>
+ error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,<br>
+ const lld::AtomLayout &,<br>
+ const Reference &) const override;<br>
<br>
private:<br>
typedef std::vector<const Reference *> PairedRelocationsT;<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Thu Mar 6 04:29:45 2014<br>
@@ -49,7 +49,7 @@ class MipsGOTAtom : public GOTAtom {<br>
public:<br>
MipsGOTAtom(const File &f) : GOTAtom(f, ".got") {}<br>
<br>
- virtual Alignment alignment() const { return Alignment(2); }<br>
+ Alignment alignment() const override { return Alignment(2); }<br>
};<br>
<br>
/// \brief MIPS GOT entry initialized by zero.<br>
@@ -57,7 +57,7 @@ class GOT0Atom : public MipsGOTAtom {<br>
public:<br>
GOT0Atom(const File &f) : MipsGOTAtom(f) {}<br>
<br>
- virtual ArrayRef<uint8_t> rawContent() const {<br>
+ ArrayRef<uint8_t> rawContent() const override {<br>
return llvm::makeArrayRef(mipsGot0AtomContent);<br>
}<br>
};<br>
@@ -67,7 +67,7 @@ class GOTModulePointerAtom : public Mips<br>
public:<br>
GOTModulePointerAtom(const File &f) : MipsGOTAtom(f) {}<br>
<br>
- virtual ArrayRef<uint8_t> rawContent() const {<br>
+ ArrayRef<uint8_t> rawContent() const override {<br>
return llvm::makeArrayRef(mipsGotModulePointerAtomContent);<br>
}<br>
};<br>
@@ -76,7 +76,7 @@ class PLT0Atom : public PLTAtom {<br>
public:<br>
PLT0Atom(const File &f) : PLTAtom(f, ".plt") {}<br>
<br>
- virtual ArrayRef<uint8_t> rawContent() const {<br>
+ ArrayRef<uint8_t> rawContent() const override {<br>
return llvm::makeArrayRef(mipsPlt0AtomContent);<br>
}<br>
};<br>
@@ -85,7 +85,7 @@ class PLTAAtom : public PLTAtom {<br>
public:<br>
PLTAAtom(const File &f) : PLTAtom(f, ".plt") {}<br>
<br>
- virtual ArrayRef<uint8_t> rawContent() const {<br>
+ ArrayRef<uint8_t> rawContent() const override {<br>
return llvm::makeArrayRef(mipsPltAAtomContent);<br>
}<br>
};<br>
@@ -95,9 +95,9 @@ class GOTPLTAtom : public GOTAtom {<br>
public:<br>
GOTPLTAtom(const File &f) : GOTAtom(f, ".got.plt") {}<br>
<br>
- virtual Alignment alignment() const { return Alignment(2); }<br>
+ Alignment alignment() const override { return Alignment(2); }<br>
<br>
- virtual ArrayRef<uint8_t> rawContent() const {<br>
+ ArrayRef<uint8_t> rawContent() const override {<br>
return llvm::makeArrayRef(mipsGot0AtomContent);<br>
}<br>
};<br>
@@ -120,7 +120,7 @@ public:<br>
_localGotVector.push_back(new (_file._alloc) GOTModulePointerAtom(_file));<br>
}<br>
<br>
- virtual void perform(std::unique_ptr<MutableFile> &mf) {<br>
+ void perform(std::unique_ptr<MutableFile> &mf) override {<br>
// Process all references.<br>
for (const auto &atom : mf->defined())<br>
for (const auto &ref : *atom)<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h Thu Mar 6 04:29:45 2014<br>
@@ -49,7 +49,7 @@ public:<br>
return ia == _posMap.end() && ib != _posMap.end();<br>
}<br>
<br>
- virtual const lld::AtomLayout &appendAtom(const Atom *atom) {<br>
+ const lld::AtomLayout &appendAtom(const Atom *atom) override {<br>
const DefinedAtom *da = dyn_cast<DefinedAtom>(atom);<br>
<br>
const Atom *ta = nullptr;<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h?rev=203102&r1=203101&r2=203102&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h?rev=203102&r1=203101&r2=203102&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h Thu Mar 6 04:29:45 2014<br>
@@ -29,10 +29,10 @@ public:<br>
<br>
const MipsGOTSection<ELFType> &getGOTSection() const { return *_gotSection; }<br>
<br>
- virtual AtomSection<ELFType> *<br>
+ AtomSection<ELFType> *<br>
createSection(StringRef name, int32_t type,<br>
DefinedAtom::ContentPermissions permissions,<br>
- Layout::SectionOrder order) {<br>
+ Layout::SectionOrder order) override {<br>
if (type == DefinedAtom::typeGOT && name == ".got")<br>
return _gotSection;<br>
return DefaultLayout<ELFType>::createSection(name, type, permissions,<br>
@@ -72,17 +72,17 @@ class MipsTargetHandler final<br>
public:<br>
MipsTargetHandler(MipsLinkingContext &context);<br>
<br>
- virtual MipsTargetLayout<Mips32ElELFType> &getTargetLayout() {<br>
+ MipsTargetLayout<Mips32ElELFType> &getTargetLayout() override {<br>
return *(_mipsTargetLayout.get());<br>
}<br>
<br>
- virtual const MipsTargetRelocationHandler &getRelocationHandler() const {<br>
+ const MipsTargetRelocationHandler &getRelocationHandler() const override {<br>
return *(_mipsRelocationHandler.get());<br>
}<br>
<br>
- virtual std::unique_ptr<Writer> getWriter();<br>
+ std::unique_ptr<Writer> getWriter() override;<br>
<br>
- virtual void registerRelocationNames(Registry ®istry);<br>
+ void registerRelocationNames(Registry ®istry) override ;<br>
<br>
private:<br>
static const Registry::KindStrings kindStrings[];<br>
@@ -101,7 +101,7 @@ public:<br>
DefaultLayout<Mips32ElELFType>::ORDER_DYNAMIC_SYMBOLS),<br>
_mipsTargetLayout(layout) {}<br>
<br>
- virtual void sortSymbols() {<br>
+ void sortSymbols() override {<br>
std::stable_sort(_symbolTable.begin(), _symbolTable.end(),<br>
[this](const SymbolEntry &A, const SymbolEntry &B) {<br>
if (A._symbol.getBinding() != STB_GLOBAL &&<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>