[libc-commits] [libc] 3e1f3b1 - [llvm-libc] Fix missing virtual destructor

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Mon Jan 6 08:42:38 PST 2020


Author: Guillaume Chatelet
Date: 2020-01-06T17:42:05+01:00
New Revision: 3e1f3b164cc0b4be486eebf24cca79c9f9c8c1f7

URL: https://github.com/llvm/llvm-project/commit/3e1f3b164cc0b4be486eebf24cca79c9f9c8c1f7
DIFF: https://github.com/llvm/llvm-project/commit/3e1f3b164cc0b4be486eebf24cca79c9f9c8c1f7.diff

LOG: [llvm-libc] Fix missing virtual destructor

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

Added: 
    libc/utils/HdrGen/Command.cpp

Modified: 
    libc/utils/HdrGen/CMakeLists.txt
    libc/utils/HdrGen/Command.h

Removed: 
    


################################################################################
diff  --git a/libc/utils/HdrGen/CMakeLists.txt b/libc/utils/HdrGen/CMakeLists.txt
index 95b9a8952eb4..d72223e4192b 100644
--- a/libc/utils/HdrGen/CMakeLists.txt
+++ b/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

diff  --git a/libc/utils/HdrGen/Command.cpp b/libc/utils/HdrGen/Command.cpp
new file mode 100644
index 000000000000..81c68301a6de
--- /dev/null
+++ b/libc/utils/HdrGen/Command.cpp
@@ -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

diff  --git a/libc/utils/HdrGen/Command.h b/libc/utils/HdrGen/Command.h
index 759e4315ff9b..302b40ca6cb3 100644
--- a/libc/utils/HdrGen/Command.h
+++ b/libc/utils/HdrGen/Command.h
@@ -42,6 +42,8 @@ class Command {
     }
   };
 
+  virtual ~Command();
+
   virtual void run(llvm::raw_ostream &OS, const ArgVector &Args,
                    llvm::StringRef StdHeader, llvm::RecordKeeper &Records,
                    const ErrorReporter &Reporter) const = 0;


        


More information about the libc-commits mailing list