diff --git a/llvm/lib/DebugInfo/DWARFUnit.h b/llvm/lib/DebugInfo/DWARFUnit.h index ca105be00d64..e8205be13f49 100644 --- a/llvm/lib/DebugInfo/DWARFUnit.h +++ b/llvm/lib/DebugInfo/DWARFUnit.h @@ -36,13 +36,14 @@ public: /// same section this Unit originated from. virtual DWARFUnit *getUnitForOffset(uint32_t Offset) const = 0; - virtual ~DWARFUnitSectionBase() {} +protected: + ~DWARFUnitSectionBase() {} }; /// Concrete instance of DWARFUnitSection, specialized for one Unit type. template -class DWARFUnitSection : public SmallVector, 1>, - public DWARFUnitSectionBase { +class DWARFUnitSection final : public SmallVector, 1>, + public DWARFUnitSectionBase { struct UnitOffsetComparator { bool operator()(const std::unique_ptr &LHS,