[libc-commits] [PATCH] D72253: [llvm-libc] Fix missing virtual destructor

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jan 6 04:34:12 PST 2020


gchatelet created this revision.
gchatelet added a reviewer: sivachandra.
Herald added subscribers: libc-commits, MaskRay, mgorny.
Herald added a project: libc-project.

This patch adds a virtual destructor to the Command class.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72253

Files:
  libc/utils/HdrGen/CMakeLists.txt
  libc/utils/HdrGen/Command.cpp
  libc/utils/HdrGen/Command.h


Index: libc/utils/HdrGen/Command.h
===================================================================
--- libc/utils/HdrGen/Command.h
+++ libc/utils/HdrGen/Command.h
@@ -42,6 +42,8 @@
     }
   };
 
+  virtual ~Command() = 0;
+
   virtual void run(llvm::raw_ostream &OS, const ArgVector &Args,
                    llvm::StringRef StdHeader, llvm::RecordKeeper &Records,
                    const ErrorReporter &Reporter) const = 0;
Index: libc/utils/HdrGen/Command.cpp
===================================================================
--- /dev/null
+++ libc/utils/HdrGen/Command.cpp
@@ -0,0 +1,7 @@
+#include "Command.h"
+
+namespace llvm_libc {
+
+Command::~Command() {}
+
+} // namespace llvm_libc
\ No newline at end of file
Index: libc/utils/HdrGen/CMakeLists.txt
===================================================================
--- libc/utils/HdrGen/CMakeLists.txt
+++ libc/utils/HdrGen/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_tablegen(libc-hdrgen llvm-libc
   Command.h
+  Command.cpp
   Generator.cpp
   Generator.h
   IncludeFileCommand.cpp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72253.236324.patch
Type: text/x-patch
Size: 1051 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200106/fc233d15/attachment.bin>


More information about the libc-commits mailing list