[PATCH] D121993: Mark derived destructors as `override`

Antonio Frighetto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 18 04:33:50 PDT 2022


antoniofrighetto created this revision.
Herald added subscribers: rogfer01, javed.absar.
Herald added a project: All.
antoniofrighetto requested review of this revision.
Herald added subscribers: llvm-commits, vkmr.
Herald added a project: LLVM.

Derived destructors can be marked as `override`, in order to prevent possible compilation failures of projects depending on those headers (when compiled with flags `-Wall, -Wsuggest-destructor-override, -Winconsistent-missing-destructor-override`). Also, mark `SCEVPredicate` base destructor as `virtual`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121993

Files:
  llvm/include/llvm/Analysis/ScalarEvolution.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
  llvm/include/llvm/IR/IRBuilder.h


Index: llvm/include/llvm/IR/IRBuilder.h
===================================================================
--- llvm/include/llvm/IR/IRBuilder.h
+++ llvm/include/llvm/IR/IRBuilder.h
@@ -77,7 +77,7 @@
   std::function<void(Instruction *)> Callback;
 
 public:
-  virtual ~IRBuilderCallbackInserter();
+  virtual ~IRBuilderCallbackInserter() override;
 
   IRBuilderCallbackInserter(std::function<void(Instruction *)> Callback)
       : Callback(std::move(Callback)) {}
Index: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -118,7 +118,7 @@
                    WithColor::defaultErrorHandler,
                std::function<void(Error)> WarningHandler =
                    WithColor::defaultWarningHandler);
-  ~DWARFContext();
+  ~DWARFContext() override;
 
   DWARFContext(DWARFContext &) = delete;
   DWARFContext &operator=(DWARFContext &) = delete;
Index: llvm/include/llvm/Analysis/ScalarEvolution.h
===================================================================
--- llvm/include/llvm/Analysis/ScalarEvolution.h
+++ llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -224,7 +224,7 @@
 
 protected:
   SCEVPredicateKind Kind;
-  ~SCEVPredicate() = default;
+  virtual ~SCEVPredicate() = default;
   SCEVPredicate(const SCEVPredicate &) = default;
   SCEVPredicate &operator=(const SCEVPredicate &) = default;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121993.416460.patch
Type: text/x-patch
Size: 1495 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220318/7cd263a0/attachment.bin>


More information about the llvm-commits mailing list