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; }

0 commit comments

Comments
 (0)