From 51ae7e86221ac2d25276c20d6dbdde82eae1e5da Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 7 Mar 2015 16:01:13 +0000 Subject: [PATCH] Remove redundant empty destructors. Both File and Atom have virtual destructors. We don't need to repeat that in derived classes. llvm-svn: 231568 --- lld/include/lld/Core/AbsoluteAtom.h | 1 - lld/include/lld/Core/ArchiveLibraryFile.h | 2 -- lld/include/lld/Core/DefinedAtom.h | 6 ------ lld/include/lld/Core/SharedLibraryAtom.h | 1 - lld/include/lld/Core/SharedLibraryFile.h | 2 -- lld/include/lld/Core/UndefinedAtom.h | 1 - 6 files changed, 13 deletions(-) diff --git a/lld/include/lld/Core/AbsoluteAtom.h b/lld/include/lld/Core/AbsoluteAtom.h index 772b5ab6e953..ed25297cea81 100644 --- a/lld/include/lld/Core/AbsoluteAtom.h +++ b/lld/include/lld/Core/AbsoluteAtom.h @@ -36,7 +36,6 @@ public: protected: AbsoluteAtom() : Atom(definitionAbsolute) {} - virtual ~AbsoluteAtom() {} }; } // namespace lld diff --git a/lld/include/lld/Core/ArchiveLibraryFile.h b/lld/include/lld/Core/ArchiveLibraryFile.h index 980d66e32d87..ff379d4f3ecf 100644 --- a/lld/include/lld/Core/ArchiveLibraryFile.h +++ b/lld/include/lld/Core/ArchiveLibraryFile.h @@ -50,8 +50,6 @@ public: return std::set(); } - virtual ~ArchiveLibraryFile() {} - protected: /// only subclasses of ArchiveLibraryFile can be instantiated ArchiveLibraryFile(StringRef path) : File(path, kindArchiveLibrary) {} diff --git a/lld/include/lld/Core/DefinedAtom.h b/lld/include/lld/Core/DefinedAtom.h index 78f4ac3ede5e..65d0cf8de5f3 100644 --- a/lld/include/lld/Core/DefinedAtom.h +++ b/lld/include/lld/Core/DefinedAtom.h @@ -365,12 +365,6 @@ protected: // constructor. DefinedAtom() : Atom(definitionRegular) { } - // The memory for DefinedAtom objects is always managed by the owning File - // object. Therefore, no one but the owning File object should call delete on - // an Atom. In fact, some File objects may bulk allocate an array of Atoms, - // so they cannot be individually deleted by anyone. - virtual ~DefinedAtom() {} - /// \brief Returns a pointer to the Reference object that the abstract /// iterator "points" to. virtual const Reference *derefIterator(const void *iter) const = 0; diff --git a/lld/include/lld/Core/SharedLibraryAtom.h b/lld/include/lld/Core/SharedLibraryAtom.h index fae9bc5b1685..1b0c37c41138 100644 --- a/lld/include/lld/Core/SharedLibraryAtom.h +++ b/lld/include/lld/Core/SharedLibraryAtom.h @@ -46,7 +46,6 @@ public: protected: SharedLibraryAtom() : Atom(definitionSharedLibrary) {} - virtual ~SharedLibraryAtom() {} }; } // namespace lld diff --git a/lld/include/lld/Core/SharedLibraryFile.h b/lld/include/lld/Core/SharedLibraryFile.h index c261d87756d5..2f84624287d8 100644 --- a/lld/include/lld/Core/SharedLibraryFile.h +++ b/lld/include/lld/Core/SharedLibraryFile.h @@ -20,8 +20,6 @@ namespace lld { /// class SharedLibraryFile : public File { public: - virtual ~SharedLibraryFile() {} - static bool classof(const File *f) { return f->kind() == kindSharedLibrary; } diff --git a/lld/include/lld/Core/UndefinedAtom.h b/lld/include/lld/Core/UndefinedAtom.h index 7c6224160fe0..7a835a4ebaa8 100644 --- a/lld/include/lld/Core/UndefinedAtom.h +++ b/lld/include/lld/Core/UndefinedAtom.h @@ -67,7 +67,6 @@ public: protected: UndefinedAtom() : Atom(definitionUndefined) {} - virtual ~UndefinedAtom() {} }; } // namespace lld -- GitLab