[lld] r280916 - [ELF] - Add virtual destructor to LinkerScriptBase class. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 02:59:13 PDT 2016


Author: grimar
Date: Thu Sep  8 04:59:13 2016
New Revision: 280916

URL: http://llvm.org/viewvc/llvm-project?rev=280916&view=rev
Log:
[ELF] - Add virtual destructor to LinkerScriptBase class. NFC.

Absence of it caused a clang warning:
warning: 'lld::elf::LinkerScriptBase' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]

At fact we don't need it here because do not destroy this object by
base pointer.

Modified:
    lld/trunk/ELF/LinkerScript.h

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=280916&r1=280915&r2=280916&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Thu Sep  8 04:59:13 2016
@@ -125,6 +125,7 @@ struct PhdrsCommand {
 
 class LinkerScriptBase {
 public:
+  virtual ~LinkerScriptBase() = default;
   virtual uint64_t getOutputSectionAddress(StringRef Name) = 0;
   virtual uint64_t getOutputSectionSize(StringRef Name) = 0;
   virtual uint64_t getOutputSectionAlign(StringRef Name) = 0;




More information about the llvm-commits mailing list