From e8fa7c079e6737c3b73e283c926e978b5c2dcc82 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 3 Apr 2014 18:25:36 +0000 Subject: [PATCH] Remove "virtual" and add "override". Seems clang-modernize couldn't add "override" to nested classes, so doing it by hand. Also removed unused virtual member function that is not overriding anything, that seems to have been added by mistake. llvm-svn: 205552 --- lld/include/lld/Core/File.h | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lld/include/lld/Core/File.h b/lld/include/lld/Core/File.h index 45dbbfef903f..e32e58e48905 100644 --- a/lld/include/lld/Core/File.h +++ b/lld/include/lld/Core/File.h @@ -164,29 +164,29 @@ protected: template class atom_collection_vector : public atom_collection { public: - virtual atom_iterator begin() const { + atom_iterator begin() const override { auto *it = _atoms.empty() ? nullptr : reinterpret_cast(_atoms.data()); return atom_iterator(*this, it); } - virtual atom_iterator end() const{ + atom_iterator end() const override { auto *it = _atoms.empty() ? nullptr : reinterpret_cast( _atoms.data() + _atoms.size()); return atom_iterator(*this, it); } - virtual const T *deref(const void *it) const { - return *reinterpret_cast(it); + const T *deref(const void *it) const override { + return *reinterpret_cast(it); } - virtual void next(const void *&it) const { - const T *const *p = reinterpret_cast(it); + void next(const void *&it) const override { + const T *const *p = reinterpret_cast(it); ++p; it = reinterpret_cast(p); } - virtual uint64_t size() const { return _atoms.size(); } + uint64_t size() const override { return _atoms.size(); } std::vector _atoms; }; @@ -196,21 +196,17 @@ protected: template class atom_collection_empty : public atom_collection { public: - virtual atom_iterator begin() const { + atom_iterator begin() const override { return atom_iterator(*this, nullptr); } - virtual atom_iterator end() const{ + atom_iterator end() const override { return atom_iterator(*this, nullptr); } - virtual const T *deref(const void *it) const { + const T *deref(const void *it) const override { llvm_unreachable("empty collection should never be accessed"); } - virtual void next(const void *&it) const { - } - virtual void push_back(const T *element) { - llvm_unreachable("empty collection should never be grown"); - } - virtual uint64_t size() const { return 0; } + void next(const void *&it) const override {} + uint64_t size() const override { return 0; } }; static atom_collection_empty _noDefinedAtoms;