[lld] r231568 - Remove redundant empty destructors.

Rui Ueyama ruiu at google.com
Sat Mar 7 08:01:14 PST 2015


Author: ruiu
Date: Sat Mar  7 10:01:13 2015
New Revision: 231568

URL: http://llvm.org/viewvc/llvm-project?rev=231568&view=rev
Log:
Remove redundant empty destructors.

Both File and Atom have virtual destructors. We don't need to repeat
that in derived classes.

Modified:
    lld/trunk/include/lld/Core/AbsoluteAtom.h
    lld/trunk/include/lld/Core/ArchiveLibraryFile.h
    lld/trunk/include/lld/Core/DefinedAtom.h
    lld/trunk/include/lld/Core/SharedLibraryAtom.h
    lld/trunk/include/lld/Core/SharedLibraryFile.h
    lld/trunk/include/lld/Core/UndefinedAtom.h

Modified: lld/trunk/include/lld/Core/AbsoluteAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/AbsoluteAtom.h?rev=231568&r1=231567&r2=231568&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/AbsoluteAtom.h (original)
+++ lld/trunk/include/lld/Core/AbsoluteAtom.h Sat Mar  7 10:01:13 2015
@@ -36,7 +36,6 @@ public:
 
 protected:
   AbsoluteAtom() : Atom(definitionAbsolute) {}
-  virtual ~AbsoluteAtom() {}
 };
 
 } // namespace lld

Modified: lld/trunk/include/lld/Core/ArchiveLibraryFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/ArchiveLibraryFile.h?rev=231568&r1=231567&r2=231568&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/ArchiveLibraryFile.h (original)
+++ lld/trunk/include/lld/Core/ArchiveLibraryFile.h Sat Mar  7 10:01:13 2015
@@ -50,8 +50,6 @@ public:
     return std::set<StringRef>();
   }
 
-  virtual ~ArchiveLibraryFile() {}
-
 protected:
   /// only subclasses of ArchiveLibraryFile can be instantiated
   ArchiveLibraryFile(StringRef path) : File(path, kindArchiveLibrary) {}

Modified: lld/trunk/include/lld/Core/DefinedAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/DefinedAtom.h?rev=231568&r1=231567&r2=231568&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/DefinedAtom.h (original)
+++ lld/trunk/include/lld/Core/DefinedAtom.h Sat Mar  7 10:01:13 2015
@@ -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;

Modified: lld/trunk/include/lld/Core/SharedLibraryAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/SharedLibraryAtom.h?rev=231568&r1=231567&r2=231568&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/SharedLibraryAtom.h (original)
+++ lld/trunk/include/lld/Core/SharedLibraryAtom.h Sat Mar  7 10:01:13 2015
@@ -46,7 +46,6 @@ public:
 
 protected:
   SharedLibraryAtom() : Atom(definitionSharedLibrary) {}
-  virtual ~SharedLibraryAtom() {}
 };
 
 } // namespace lld

Modified: lld/trunk/include/lld/Core/SharedLibraryFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/SharedLibraryFile.h?rev=231568&r1=231567&r2=231568&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/SharedLibraryFile.h (original)
+++ lld/trunk/include/lld/Core/SharedLibraryFile.h Sat Mar  7 10:01:13 2015
@@ -20,8 +20,6 @@ namespace lld {
 ///
 class SharedLibraryFile : public File {
 public:
-  virtual ~SharedLibraryFile() {}
-
   static bool classof(const File *f) {
     return f->kind() == kindSharedLibrary;
   }

Modified: lld/trunk/include/lld/Core/UndefinedAtom.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/UndefinedAtom.h?rev=231568&r1=231567&r2=231568&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/UndefinedAtom.h (original)
+++ lld/trunk/include/lld/Core/UndefinedAtom.h Sat Mar  7 10:01:13 2015
@@ -67,7 +67,6 @@ public:
 
 protected:
   UndefinedAtom() : Atom(definitionUndefined) {}
-  virtual ~UndefinedAtom() {}
 };
 
 } // namespace lld





More information about the llvm-commits mailing list