]> granicus.if.org Git - clang/commitdiff
Remove empty non-virtual destructors or mark them =default when non-public
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 11 Apr 2015 15:58:30 +0000 (15:58 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 11 Apr 2015 15:58:30 +0000 (15:58 +0000)
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

15 files changed:
include/clang/AST/RecordLayout.h
include/clang/ASTMatchers/Dynamic/VariantValue.h
include/clang/Analysis/Analyses/LiveVariables.h
include/clang/Analysis/CFG.h
include/clang/Basic/SourceManagerInternals.h
include/clang/Lex/MacroArgs.h
include/clang/Lex/MacroInfo.h
include/clang/Sema/CodeCompleteConsumer.h
include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
lib/CodeGen/CGObjCMac.cpp
lib/Index/SimpleFormatContext.h
lib/Rewrite/RewriteRope.cpp
utils/TableGen/NeonEmitter.cpp

index f9240f2b48a3329cf20c723f5b8fa2c700d864c4..667f23520eb78e14ff120a13f4941162f693ec83 100644 (file)
@@ -159,7 +159,7 @@ private:
                   const BaseOffsetsMapTy& BaseOffsets,
                   const VBaseOffsetsMapTy& VBaseOffsets);
 
-  ~ASTRecordLayout() {}
+  ~ASTRecordLayout() = default;
 
   void Destroy(ASTContext &Ctx);
   
index bf69e170889ad16a6f572df2407a4c9a15a43c0a..78aa9dc82a982c4fab3289c41c8fc871d3d3f442 100644 (file)
@@ -111,7 +111,7 @@ class VariantMatcher {
                               ArrayRef<VariantMatcher> InnerMatchers) const;
 
   protected:
-    ~MatcherOps() {}
+    ~MatcherOps() = default;
 
   private:
     ast_type_traits::ASTNodeKind NodeKind;
index 7d1109143599fa3c152a1fd70b1ddf9b01d1dc00..e17f73a61f8195534068b966b87fe254132241fc 100644 (file)
@@ -44,8 +44,6 @@ public:
                    llvm::ImmutableSet<const VarDecl *> LiveDecls)
       : liveStmts(LiveStmts), liveDecls(LiveDecls) {}
 
-    ~LivenessValues() {}
-    
     bool isLive(const Stmt *S) const;
     bool isLive(const VarDecl *D) const;
     
index 3fddbb90fe91484ab0efbc460dc934acc11e7b79..e7f6383626392f0697731fe101bc0a00596e566f 100644 (file)
@@ -493,7 +493,6 @@ public:
     : Elements(C), Label(nullptr), Terminator(nullptr), LoopTarget(nullptr), 
       BlockID(blockid), Preds(C, 1), Succs(C, 1), HasNoReturnElement(false),
       Parent(parent) {}
-  ~CFGBlock() {}
 
   // Statement iterators
   typedef ElementList::iterator                      iterator;
index f31d604244d05d0926fbb7ec7e2b2701826c7c18..27dea9f84b5ac3bf7dd119ad2fde02a7a90b3d53 100644 (file)
@@ -88,17 +88,12 @@ class LineTableInfo {
   /// at which they occur in the file).
   std::map<FileID, std::vector<LineEntry> > LineEntries;
 public:
-  LineTableInfo() {
-  }
-
   void clear() {
     FilenameIDs.clear();
     FilenamesByID.clear();
     LineEntries.clear();
   }
 
-  ~LineTableInfo() {}
-
   unsigned getLineTableFilenameID(StringRef Str);
   const char *getFilename(unsigned ID) const {
     assert(ID < FilenamesByID.size() && "Invalid FilenameID");
index d858ec2b42927d95fd70a48d6b7ce45b5e8bd58f..243b143f7af6e17ac3a5fc99f3ba391ed04ef25d 100644 (file)
@@ -56,7 +56,8 @@ class MacroArgs {
   MacroArgs(unsigned NumToks, bool varargsElided)
     : NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
       ArgCache(nullptr) {}
-  ~MacroArgs() {}
+  ~MacroArgs() = default;
+
 public:
   /// MacroArgs ctor function - Create a new MacroArgs object with the specified
   /// macro and argument info.
index 8a113cbbe7a2a9b21acd1eecca9cbfe8a0424cda..253e6625866f3004f6cffd73e6f5f97e8e5e162f 100644 (file)
@@ -109,7 +109,7 @@ class MacroInfo {
 
   // Only the Preprocessor gets to create and destroy these.
   MacroInfo(SourceLocation DefLoc);
-  ~MacroInfo() {}
+  ~MacroInfo() = default;
 
 public:
   /// \brief Return the location that the macro was defined at.
index d24a925dd889642c74875ce863882fa38d9f7199..de65c43c76b20954bc0361692a7886b4e4186dcb 100644 (file)
@@ -449,7 +449,7 @@ private:
                        const char **Annotations, unsigned NumAnnotations,
                        StringRef ParentName,
                        const char *BriefComment);
-  ~CodeCompletionString() { }
+  ~CodeCompletionString() = default;
 
   friend class CodeCompletionBuilder;
   friend class CodeCompletionResult;
index ba9715b38f3f25f125a10e061605115c576153e7..cc3779d743f2b5c18304891a20ecf4c3c38dcc99 100644 (file)
@@ -106,7 +106,6 @@ private:
 
 public:
   EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
-  ~EnvironmentManager() {}
 
   Environment getInitialEnvironment() {
     return Environment(F.getEmptyMap());
index c4eabb8c2acee18e335a81551864d4acfcf7a073..cfb1b921e9a425e08c90ac994363b2651eba3fb0 100644 (file)
@@ -127,8 +127,6 @@ public:
     : Location(loc), State(state), Succs(IsSink) {
     assert(isSink() == IsSink);
   }
-  
-  ~ExplodedNode() {}
 
   /// getLocation - Returns the edge associated with the given node.
   ProgramPoint getLocation() const { return Location; }
index 357fc32c7dd4335945570ca23a57807929b923ce..1ca96a2231478491575b18e278e9b9f21811000c 100644 (file)
@@ -589,8 +589,6 @@ public:
    : LCtx(Ctx), Loc(s), SymMgr(symmgr),
      reapedStore(nullptr, storeMgr) {}
 
-  ~SymbolReaper() {}
-
   const LocationContext *getLocationContext() const { return LCtx; }
 
   bool isLive(SymbolRef sym);
index 587731db8b80205752f2f256132cfa6a1850a47f..a45446a7065a327209a48300e1349062a97c70cc 100644 (file)
@@ -486,7 +486,6 @@ public:
   }
 
   ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm);
-  ~ObjCCommonTypesHelper(){}
 };
 
 /// ObjCTypesHelper - Helper class that encapsulates lazy
@@ -595,7 +594,6 @@ public:
 
 public:
   ObjCTypesHelper(CodeGen::CodeGenModule &cgm);
-  ~ObjCTypesHelper() {}
 };
 
 /// ObjCNonFragileABITypesHelper - will have all types needed by objective-c's
@@ -733,7 +731,6 @@ public:
   llvm::Type *EHTypePtrTy;
   
   ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm);
-  ~ObjCNonFragileABITypesHelper(){}
 };
 
 class CGObjCCommonMac : public CodeGen::CGObjCRuntime {
index 080a4ad04ddf8ac3facc243562dc93fff186c4bc..b884214989597b7c613a756d08afad39ba347405 100644 (file)
@@ -44,8 +44,6 @@ public:
     Diagnostics->setClient(new IgnoringDiagConsumer, true);
   }
 
-  ~SimpleFormatContext() { }
-
   FileID createInMemoryFile(StringRef Name, StringRef Content) {
     std::unique_ptr<llvm::MemoryBuffer> Source =
         llvm::MemoryBuffer::getMemBuffer(Content);
index 1c82ee4a67ec776f392b77032b550df33dc500a1..451ad07e4e84b526b0d36915efc9b216e097c3e9 100644 (file)
@@ -89,9 +89,9 @@ namespace {
     bool IsLeaf;
 
     RopePieceBTreeNode(bool isLeaf) : Size(0), IsLeaf(isLeaf) {}
-    ~RopePieceBTreeNode() {}
-  public:
+    ~RopePieceBTreeNode() = default;
 
+  public:
     bool isLeaf() const { return IsLeaf; }
     unsigned size() const { return Size; }
 
index d46785d1937abeeb9311477f685aa3e003362367..2a857a87ef1ea42a0a7287890be00917ecd22b92 100644 (file)
@@ -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.
   class LowHalf : public SetTheory::Operator {
   public:
-    void anchor() override {}
-    ~LowHalf() override {}
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
                ArrayRef<SMLoc> Loc) override {
       SetTheory::RecSet Elts2;
@@ -1574,8 +1572,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
   };
   class HighHalf : public SetTheory::Operator {
   public:
-    void anchor() override {}
-    ~HighHalf() override {}
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
                ArrayRef<SMLoc> Loc) override {
       SetTheory::RecSet Elts2;
@@ -1588,8 +1584,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
 
   public:
     Rev(unsigned ElementSize) : ElementSize(ElementSize) {}
-    void anchor() override {}
-    ~Rev() override {}
     void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
                ArrayRef<SMLoc> Loc) override {
       SetTheory::RecSet Elts2;
@@ -1613,8 +1607,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
 
   public:
     MaskExpander(unsigned N) : N(N) {}
-    void anchor() override {}
-    ~MaskExpander() override {}
     void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) override {
       unsigned Addend = 0;
       if (R->getName() == "mask0")