فهرست منبع

Remove empty non-virtual destructors or mark them =default when non-public

These add no value but can make a class non-trivially copyable. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234689 91177308-0d34-0410-b5e6-96231b3b80d8
Benjamin Kramer 10 سال پیش
والد
کامیت
33fe0182f3

+ 1 - 1
include/clang/AST/RecordLayout.h

@@ -159,7 +159,7 @@ private:
                   const BaseOffsetsMapTy& BaseOffsets,
                   const BaseOffsetsMapTy& BaseOffsets,
                   const VBaseOffsetsMapTy& VBaseOffsets);
                   const VBaseOffsetsMapTy& VBaseOffsets);
 
 
-  ~ASTRecordLayout() {}
+  ~ASTRecordLayout() = default;
 
 
   void Destroy(ASTContext &Ctx);
   void Destroy(ASTContext &Ctx);
   
   

+ 1 - 1
include/clang/ASTMatchers/Dynamic/VariantValue.h

@@ -111,7 +111,7 @@ class VariantMatcher {
                               ArrayRef<VariantMatcher> InnerMatchers) const;
                               ArrayRef<VariantMatcher> InnerMatchers) const;
 
 
   protected:
   protected:
-    ~MatcherOps() {}
+    ~MatcherOps() = default;
 
 
   private:
   private:
     ast_type_traits::ASTNodeKind NodeKind;
     ast_type_traits::ASTNodeKind NodeKind;

+ 0 - 2
include/clang/Analysis/Analyses/LiveVariables.h

@@ -44,8 +44,6 @@ public:
                    llvm::ImmutableSet<const VarDecl *> LiveDecls)
                    llvm::ImmutableSet<const VarDecl *> LiveDecls)
       : liveStmts(LiveStmts), liveDecls(LiveDecls) {}
       : liveStmts(LiveStmts), liveDecls(LiveDecls) {}
 
 
-    ~LivenessValues() {}
-    
     bool isLive(const Stmt *S) const;
     bool isLive(const Stmt *S) const;
     bool isLive(const VarDecl *D) const;
     bool isLive(const VarDecl *D) const;
     
     

+ 0 - 1
include/clang/Analysis/CFG.h

@@ -493,7 +493,6 @@ public:
     : Elements(C), Label(nullptr), Terminator(nullptr), LoopTarget(nullptr), 
     : Elements(C), Label(nullptr), Terminator(nullptr), LoopTarget(nullptr), 
       BlockID(blockid), Preds(C, 1), Succs(C, 1), HasNoReturnElement(false),
       BlockID(blockid), Preds(C, 1), Succs(C, 1), HasNoReturnElement(false),
       Parent(parent) {}
       Parent(parent) {}
-  ~CFGBlock() {}
 
 
   // Statement iterators
   // Statement iterators
   typedef ElementList::iterator                      iterator;
   typedef ElementList::iterator                      iterator;

+ 0 - 5
include/clang/Basic/SourceManagerInternals.h

@@ -88,17 +88,12 @@ class LineTableInfo {
   /// at which they occur in the file).
   /// at which they occur in the file).
   std::map<FileID, std::vector<LineEntry> > LineEntries;
   std::map<FileID, std::vector<LineEntry> > LineEntries;
 public:
 public:
-  LineTableInfo() {
-  }
-
   void clear() {
   void clear() {
     FilenameIDs.clear();
     FilenameIDs.clear();
     FilenamesByID.clear();
     FilenamesByID.clear();
     LineEntries.clear();
     LineEntries.clear();
   }
   }
 
 
-  ~LineTableInfo() {}
-
   unsigned getLineTableFilenameID(StringRef Str);
   unsigned getLineTableFilenameID(StringRef Str);
   const char *getFilename(unsigned ID) const {
   const char *getFilename(unsigned ID) const {
     assert(ID < FilenamesByID.size() && "Invalid FilenameID");
     assert(ID < FilenamesByID.size() && "Invalid FilenameID");

+ 2 - 1
include/clang/Lex/MacroArgs.h

@@ -56,7 +56,8 @@ class MacroArgs {
   MacroArgs(unsigned NumToks, bool varargsElided)
   MacroArgs(unsigned NumToks, bool varargsElided)
     : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
     : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
       ArgCache(nullptr) {}
       ArgCache(nullptr) {}
-  ~MacroArgs() {}
+  ~MacroArgs() = default;
+
 public:
 public:
   /// MacroArgs ctor function - Create a new MacroArgs object with the specified
   /// MacroArgs ctor function - Create a new MacroArgs object with the specified
   /// macro and argument info.
   /// macro and argument info.

+ 1 - 1
include/clang/Lex/MacroInfo.h

@@ -109,7 +109,7 @@ class MacroInfo {
 
 
   // Only the Preprocessor gets to create and destroy these.
   // Only the Preprocessor gets to create and destroy these.
   MacroInfo(SourceLocation DefLoc);
   MacroInfo(SourceLocation DefLoc);
-  ~MacroInfo() {}
+  ~MacroInfo() = default;
 
 
 public:
 public:
   /// \brief Return the location that the macro was defined at.
   /// \brief Return the location that the macro was defined at.

+ 1 - 1
include/clang/Sema/CodeCompleteConsumer.h

@@ -449,7 +449,7 @@ private:
                        const char **Annotations, unsigned NumAnnotations,
                        const char **Annotations, unsigned NumAnnotations,
                        StringRef ParentName,
                        StringRef ParentName,
                        const char *BriefComment);
                        const char *BriefComment);
-  ~CodeCompletionString() { }
+  ~CodeCompletionString() = default;
 
 
   friend class CodeCompletionBuilder;
   friend class CodeCompletionBuilder;
   friend class CodeCompletionResult;
   friend class CodeCompletionResult;

+ 0 - 1
include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h

@@ -106,7 +106,6 @@ private:
 
 
 public:
 public:
   EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
   EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
-  ~EnvironmentManager() {}
 
 
   Environment getInitialEnvironment() {
   Environment getInitialEnvironment() {
     return Environment(F.getEmptyMap());
     return Environment(F.getEmptyMap());

+ 0 - 2
include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h

@@ -127,8 +127,6 @@ public:
     : Location(loc), State(state), Succs(IsSink) {
     : Location(loc), State(state), Succs(IsSink) {
     assert(isSink() == IsSink);
     assert(isSink() == IsSink);
   }
   }
-  
-  ~ExplodedNode() {}
 
 
   /// getLocation - Returns the edge associated with the given node.
   /// getLocation - Returns the edge associated with the given node.
   ProgramPoint getLocation() const { return Location; }
   ProgramPoint getLocation() const { return Location; }

+ 0 - 2
include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h

@@ -589,8 +589,6 @@ public:
    : LCtx(Ctx), Loc(s), SymMgr(symmgr),
    : LCtx(Ctx), Loc(s), SymMgr(symmgr),
      reapedStore(nullptr, storeMgr) {}
      reapedStore(nullptr, storeMgr) {}
 
 
-  ~SymbolReaper() {}
-
   const LocationContext *getLocationContext() const { return LCtx; }
   const LocationContext *getLocationContext() const { return LCtx; }
 
 
   bool isLive(SymbolRef sym);
   bool isLive(SymbolRef sym);

+ 0 - 3
lib/CodeGen/CGObjCMac.cpp

@@ -486,7 +486,6 @@ public:
   }
   }
 
 
   ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm);
   ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm);
-  ~ObjCCommonTypesHelper(){}
 };
 };
 
 
 /// ObjCTypesHelper - Helper class that encapsulates lazy
 /// ObjCTypesHelper - Helper class that encapsulates lazy
@@ -595,7 +594,6 @@ public:
 
 
 public:
 public:
   ObjCTypesHelper(CodeGen::CodeGenModule &cgm);
   ObjCTypesHelper(CodeGen::CodeGenModule &cgm);
-  ~ObjCTypesHelper() {}
 };
 };
 
 
 /// ObjCNonFragileABITypesHelper - will have all types needed by objective-c's
 /// ObjCNonFragileABITypesHelper - will have all types needed by objective-c's
@@ -733,7 +731,6 @@ public:
   llvm::Type *EHTypePtrTy;
   llvm::Type *EHTypePtrTy;
   
   
   ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm);
   ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm);
-  ~ObjCNonFragileABITypesHelper(){}
 };
 };
 
 
 class CGObjCCommonMac : public CodeGen::CGObjCRuntime {
 class CGObjCCommonMac : public CodeGen::CGObjCRuntime {

+ 0 - 2
lib/Index/SimpleFormatContext.h

@@ -44,8 +44,6 @@ public:
     Diagnostics->setClient(new IgnoringDiagConsumer, true);
     Diagnostics->setClient(new IgnoringDiagConsumer, true);
   }
   }
 
 
-  ~SimpleFormatContext() { }
-
   FileID createInMemoryFile(StringRef Name, StringRef Content) {
   FileID createInMemoryFile(StringRef Name, StringRef Content) {
     std::unique_ptr<llvm::MemoryBuffer> Source =
     std::unique_ptr<llvm::MemoryBuffer> Source =
         llvm::MemoryBuffer::getMemBuffer(Content);
         llvm::MemoryBuffer::getMemBuffer(Content);

+ 2 - 2
lib/Rewrite/RewriteRope.cpp

@@ -89,9 +89,9 @@ namespace {
     bool IsLeaf;
     bool IsLeaf;
 
 
     RopePieceBTreeNode(bool isLeaf) : Size(0), IsLeaf(isLeaf) {}
     RopePieceBTreeNode(bool isLeaf) : Size(0), IsLeaf(isLeaf) {}
-    ~RopePieceBTreeNode() {}
-  public:
+    ~RopePieceBTreeNode() = default;
 
 
+  public:
     bool isLeaf() const { return IsLeaf; }
     bool isLeaf() const { return IsLeaf; }
     unsigned size() const { return Size; }
     unsigned size() const { return Size; }
 
 

+ 0 - 8
utils/TableGen/NeonEmitter.cpp

@@ -1563,8 +1563,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
   // See the documentation in arm_neon.td for a description of these operators.
   // See the documentation in arm_neon.td for a description of these operators.
   class LowHalf : public SetTheory::Operator {
   class LowHalf : public SetTheory::Operator {
   public:
   public:
-    void anchor() override {}
-    ~LowHalf() override {}
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
                ArrayRef<SMLoc> Loc) override {
                ArrayRef<SMLoc> Loc) override {
       SetTheory::RecSet Elts2;
       SetTheory::RecSet Elts2;
@@ -1574,8 +1572,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
   };
   };
   class HighHalf : public SetTheory::Operator {
   class HighHalf : public SetTheory::Operator {
   public:
   public:
-    void anchor() override {}
-    ~HighHalf() override {}
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
                ArrayRef<SMLoc> Loc) override {
                ArrayRef<SMLoc> Loc) override {
       SetTheory::RecSet Elts2;
       SetTheory::RecSet Elts2;
@@ -1588,8 +1584,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
 
 
   public:
   public:
     Rev(unsigned ElementSize) : ElementSize(ElementSize) {}
     Rev(unsigned ElementSize) : ElementSize(ElementSize) {}
-    void anchor() override {}
-    ~Rev() override {}
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
                ArrayRef<SMLoc> Loc) override {
                ArrayRef<SMLoc> Loc) override {
       SetTheory::RecSet Elts2;
       SetTheory::RecSet Elts2;
@@ -1613,8 +1607,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
 
 
   public:
   public:
     MaskExpander(unsigned N) : N(N) {}
     MaskExpander(unsigned N) : N(N) {}
-    void anchor() override {}
-    ~MaskExpander() override {}
     void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) override {
     void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) override {
       unsigned Addend = 0;
       unsigned Addend = 0;
       if (R->getName() == "mask0")
       if (R->getName() == "mask0")