Skip to content

Commit 8017237

Browse files
committed
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. llvm-svn: 234689
1 parent dd0ff85 commit 8017237

File tree

15 files changed

+8
-33
lines changed

15 files changed

+8
-33
lines changed

clang/include/clang/AST/RecordLayout.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class ASTRecordLayout {
159159
const BaseOffsetsMapTy& BaseOffsets,
160160
const VBaseOffsetsMapTy& VBaseOffsets);
161161

162-
~ASTRecordLayout() {}
162+
~ASTRecordLayout() = default;
163163

164164
void Destroy(ASTContext &Ctx);
165165

clang/include/clang/ASTMatchers/Dynamic/VariantValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class VariantMatcher {
111111
ArrayRef<VariantMatcher> InnerMatchers) const;
112112

113113
protected:
114-
~MatcherOps() {}
114+
~MatcherOps() = default;
115115

116116
private:
117117
ast_type_traits::ASTNodeKind NodeKind;

clang/include/clang/Analysis/Analyses/LiveVariables.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class LiveVariables : public ManagedAnalysis {
4444
llvm::ImmutableSet<const VarDecl *> LiveDecls)
4545
: liveStmts(LiveStmts), liveDecls(LiveDecls) {}
4646

47-
~LivenessValues() {}
48-
4947
bool isLive(const Stmt *S) const;
5048
bool isLive(const VarDecl *D) const;
5149

clang/include/clang/Analysis/CFG.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ class CFGBlock {
493493
: Elements(C), Label(nullptr), Terminator(nullptr), LoopTarget(nullptr),
494494
BlockID(blockid), Preds(C, 1), Succs(C, 1), HasNoReturnElement(false),
495495
Parent(parent) {}
496-
~CFGBlock() {}
497496

498497
// Statement iterators
499498
typedef ElementList::iterator iterator;

clang/include/clang/Basic/SourceManagerInternals.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,12 @@ class LineTableInfo {
8888
/// at which they occur in the file).
8989
std::map<FileID, std::vector<LineEntry> > LineEntries;
9090
public:
91-
LineTableInfo() {
92-
}
93-
9491
void clear() {
9592
FilenameIDs.clear();
9693
FilenamesByID.clear();
9794
LineEntries.clear();
9895
}
9996

100-
~LineTableInfo() {}
101-
10297
unsigned getLineTableFilenameID(StringRef Str);
10398
const char *getFilename(unsigned ID) const {
10499
assert(ID < FilenamesByID.size() && "Invalid FilenameID");

clang/include/clang/Lex/MacroArgs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class MacroArgs {
5656
MacroArgs(unsigned NumToks, bool varargsElided)
5757
: NumUnexpArgTokens(NumToks), VarargsElided(varargsElided),
5858
ArgCache(nullptr) {}
59-
~MacroArgs() {}
59+
~MacroArgs() = default;
60+
6061
public:
6162
/// MacroArgs ctor function - Create a new MacroArgs object with the specified
6263
/// macro and argument info.

clang/include/clang/Lex/MacroInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class MacroInfo {
109109

110110
// Only the Preprocessor gets to create and destroy these.
111111
MacroInfo(SourceLocation DefLoc);
112-
~MacroInfo() {}
112+
~MacroInfo() = default;
113113

114114
public:
115115
/// \brief Return the location that the macro was defined at.

clang/include/clang/Sema/CodeCompleteConsumer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ class CodeCompletionString {
449449
const char **Annotations, unsigned NumAnnotations,
450450
StringRef ParentName,
451451
const char *BriefComment);
452-
~CodeCompletionString() { }
452+
~CodeCompletionString() = default;
453453

454454
friend class CodeCompletionBuilder;
455455
friend class CodeCompletionResult;

clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class EnvironmentManager {
106106

107107
public:
108108
EnvironmentManager(llvm::BumpPtrAllocator& Allocator) : F(Allocator) {}
109-
~EnvironmentManager() {}
110109

111110
Environment getInitialEnvironment() {
112111
return Environment(F.getEmptyMap());

clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ class ExplodedNode : public llvm::FoldingSetNode {
127127
: Location(loc), State(state), Succs(IsSink) {
128128
assert(isSink() == IsSink);
129129
}
130-
131-
~ExplodedNode() {}
132130

133131
/// getLocation - Returns the edge associated with the given node.
134132
ProgramPoint getLocation() const { return Location; }

clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,6 @@ class SymbolReaper {
589589
: LCtx(Ctx), Loc(s), SymMgr(symmgr),
590590
reapedStore(nullptr, storeMgr) {}
591591

592-
~SymbolReaper() {}
593-
594592
const LocationContext *getLocationContext() const { return LCtx; }
595593

596594
bool isLive(SymbolRef sym);

clang/lib/CodeGen/CGObjCMac.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ class ObjCCommonTypesHelper {
486486
}
487487

488488
ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm);
489-
~ObjCCommonTypesHelper(){}
490489
};
491490

492491
/// ObjCTypesHelper - Helper class that encapsulates lazy
@@ -595,7 +594,6 @@ class ObjCTypesHelper : public ObjCCommonTypesHelper {
595594

596595
public:
597596
ObjCTypesHelper(CodeGen::CodeGenModule &cgm);
598-
~ObjCTypesHelper() {}
599597
};
600598

601599
/// ObjCNonFragileABITypesHelper - will have all types needed by objective-c's
@@ -733,7 +731,6 @@ class ObjCNonFragileABITypesHelper : public ObjCCommonTypesHelper {
733731
llvm::Type *EHTypePtrTy;
734732

735733
ObjCNonFragileABITypesHelper(CodeGen::CodeGenModule &cgm);
736-
~ObjCNonFragileABITypesHelper(){}
737734
};
738735

739736
class CGObjCCommonMac : public CodeGen::CGObjCRuntime {

clang/lib/Index/SimpleFormatContext.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class SimpleFormatContext {
4444
Diagnostics->setClient(new IgnoringDiagConsumer, true);
4545
}
4646

47-
~SimpleFormatContext() { }
48-
4947
FileID createInMemoryFile(StringRef Name, StringRef Content) {
5048
std::unique_ptr<llvm::MemoryBuffer> Source =
5149
llvm::MemoryBuffer::getMemBuffer(Content);

clang/lib/Rewrite/RewriteRope.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ namespace {
8989
bool IsLeaf;
9090

9191
RopePieceBTreeNode(bool isLeaf) : Size(0), IsLeaf(isLeaf) {}
92-
~RopePieceBTreeNode() {}
93-
public:
92+
~RopePieceBTreeNode() = default;
9493

94+
public:
9595
bool isLeaf() const { return IsLeaf; }
9696
unsigned size() const { return Size; }
9797

clang/utils/TableGen/NeonEmitter.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,8 +1563,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
15631563
// See the documentation in arm_neon.td for a description of these operators.
15641564
class LowHalf : public SetTheory::Operator {
15651565
public:
1566-
void anchor() override {}
1567-
~LowHalf() override {}
15681566
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
15691567
ArrayRef<SMLoc> Loc) override {
15701568
SetTheory::RecSet Elts2;
@@ -1574,8 +1572,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
15741572
};
15751573
class HighHalf : public SetTheory::Operator {
15761574
public:
1577-
void anchor() override {}
1578-
~HighHalf() override {}
15791575
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
15801576
ArrayRef<SMLoc> Loc) override {
15811577
SetTheory::RecSet Elts2;
@@ -1588,8 +1584,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
15881584

15891585
public:
15901586
Rev(unsigned ElementSize) : ElementSize(ElementSize) {}
1591-
void anchor() override {}
1592-
~Rev() override {}
15931587
void apply(SetTheory &ST, DagInit *Expr, SetTheory::RecSet &Elts,
15941588
ArrayRef<SMLoc> Loc) override {
15951589
SetTheory::RecSet Elts2;
@@ -1613,8 +1607,6 @@ std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){
16131607

16141608
public:
16151609
MaskExpander(unsigned N) : N(N) {}
1616-
void anchor() override {}
1617-
~MaskExpander() override {}
16181610
void expand(SetTheory &ST, Record *R, SetTheory::RecSet &Elts) override {
16191611
unsigned Addend = 0;
16201612
if (R->getName() == "mask0")

0 commit comments

Comments
 (0)