Give structs with virtual methods a virtual destructor.
authorNick Lewycky <nicholas@mxc.ca>
Thu, 15 Sep 2011 03:41:51 +0000 (03:41 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Thu, 15 Sep 2011 03:41:51 +0000 (03:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139776 91177308-0d34-0410-b5e6-96231b3b80d8

lib/DebugInfo/DWARFDebugLine.cpp
lib/DebugInfo/DWARFDebugLine.h

index d2ebc384d901a4e35552bc876ac8ec1cce0f8d71..c2fb111ebcf7ef72ec69c3814ed06d3cf03583b7 100644 (file)
@@ -91,6 +91,8 @@ void DWARFDebugLine::LineTable::dump(raw_ostream &OS) const {
   }
 }
 
+DWARFDebugLine::State::~State() {}
+
 void DWARFDebugLine::State::appendRowToMatrix(uint32_t offset) {
   ++row;  // Increase the row number.
   LineTable::appendRow(*this);
@@ -117,6 +119,8 @@ void DWARFDebugLine::parse(const DataExtractor debug_line_data) {
   }
 }
 
+DWARFDebugLine::DumpingState::~DumpingState() {}
+
 void DWARFDebugLine::DumpingState::finalize(uint32_t offset) {
   LineTable::dump(OS);
 }
index 459bb5f723f3bd5a1a82c8d5d0b7cfd76e71469d..e50c4a9e74daf478a93ae31536bff08e65ddbee3 100644 (file)
@@ -148,6 +148,7 @@ public:
     };
 
     State() : row(0) {}
+    virtual ~State();
 
     virtual void appendRowToMatrix(uint32_t offset);
     virtual void finalize(uint32_t offset) { row = DoneParsingLineTable; }
@@ -160,6 +161,7 @@ public:
 
   struct DumpingState : public State {
     DumpingState(raw_ostream &OS) : OS(OS) {}
+    virtual ~DumpingState();
     virtual void finalize(uint32_t offset);
   private:
     raw_ostream &OS;