[llvm-libc] Fix missing virtual destructor
authorGuillaume Chatelet <gchatelet@google.com>
Mon, 6 Jan 2020 12:31:45 +0000 (13:31 +0100)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 6 Jan 2020 16:42:05 +0000 (17:42 +0100)
Summary: This patch adds a virtual destructor to the Command class.

Reviewers: sivachandra

Subscribers: mgorny, MaskRay, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D72253

libc/utils/HdrGen/CMakeLists.txt
libc/utils/HdrGen/Command.cpp [new file with mode: 0644]
libc/utils/HdrGen/Command.h

index 95b9a89..d72223e 100644 (file)
@@ -1,5 +1,6 @@
 add_tablegen(libc-hdrgen llvm-libc
   Command.h
+  Command.cpp
   Generator.cpp
   Generator.h
   IncludeFileCommand.cpp
diff --git a/libc/utils/HdrGen/Command.cpp b/libc/utils/HdrGen/Command.cpp
new file mode 100644 (file)
index 0000000..81c6830
--- /dev/null
@@ -0,0 +1,15 @@
+//===-------- Base class for header generation commands ---------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Command.h"
+
+namespace llvm_libc {
+
+Command::~Command() {}
+
+} // namespace llvm_libc
index 759e431..302b40c 100644 (file)
@@ -42,6 +42,8 @@ public:
     }
   };
 
+  virtual ~Command();
+
   virtual void run(llvm::raw_ostream &OS, const ArgVector &Args,
                    llvm::StringRef StdHeader, llvm::RecordKeeper &Records,
                    const ErrorReporter &Reporter) const = 0;