Skip to content

Commit 0c74e6e

Browse files
kazutakahirataDebadri Basak
authored andcommitted
[ADT, Support] Use "= default" (NFC) (llvm#166007)
Identified with modernize-use-equals-default.
1 parent 52b7467 commit 0c74e6e

16 files changed

+28
-28
lines changed

llvm/include/llvm/ADT/AddressRanges.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace llvm {
2121
/// a start and an end address: [Start, End).
2222
class AddressRange {
2323
public:
24-
AddressRange() {}
24+
AddressRange() = default;
2525
AddressRange(uint64_t S, uint64_t E) : Start(S), End(E) {
2626
assert(Start <= End);
2727
}

llvm/include/llvm/Support/ELFAttributeParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace llvm {
1717

1818
class ELFAttributeParser {
1919
public:
20-
virtual ~ELFAttributeParser() {}
20+
virtual ~ELFAttributeParser() = default;
2121

2222
virtual Error parse(ArrayRef<uint8_t> Section, llvm::endianness Endian) {
2323
return llvm::Error::success();

llvm/include/llvm/Support/GraphWriter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ template <typename GraphType, typename Derived> class GraphWriterBase {
128128
DTraits = DOTTraits(SN);
129129
RenderUsingHTML = DTraits.renderNodesUsingHTML();
130130
}
131-
virtual ~GraphWriterBase() {}
131+
virtual ~GraphWriterBase() = default;
132132

133133
void writeGraph(const std::string &Title = "") {
134134
// Output the header for the graph...
@@ -369,7 +369,7 @@ class GraphWriter : public GraphWriterBase<GraphType, GraphWriter<GraphType>> {
369369
public:
370370
GraphWriter(raw_ostream &o, const GraphType &g, bool SN)
371371
: GraphWriterBase<GraphType, GraphWriter<GraphType>>(o, g, SN) {}
372-
~GraphWriter() override {}
372+
~GraphWriter() override = default;
373373
};
374374

375375
template <typename GraphType>

llvm/lib/Support/raw_socket_stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ ListeningSocket::~ListeningSocket() {
332332
raw_socket_stream::raw_socket_stream(int SocketFD)
333333
: raw_fd_stream(SocketFD, true) {}
334334

335-
raw_socket_stream::~raw_socket_stream() {}
335+
raw_socket_stream::~raw_socket_stream() = default;
336336

337337
Expected<std::unique_ptr<raw_socket_stream>>
338338
raw_socket_stream::createConnectedUnix(StringRef SocketPath) {

llvm/unittests/ADT/ConcurrentHashtableTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using namespace parallel;
2121
namespace {
2222
class String {
2323
public:
24-
String() {}
24+
String() = default;
2525
const std::string &getKey() const { return Data; }
2626

2727
template <typename AllocatorTy>

llvm/unittests/ADT/DirectedGraphTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class DGTestEdge : public DGTestEdgeBase {
4343
class DGTestGraph : public DGTestBase {
4444
public:
4545
DGTestGraph() = default;
46-
~DGTestGraph(){};
46+
~DGTestGraph() = default;
4747
};
4848

4949
using EdgeListTy = SmallVector<DGTestEdge *, 2>;

llvm/unittests/ADT/IListTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace {
1919
struct Node : ilist_node<Node> {
2020
int Value;
2121

22-
Node() {}
22+
Node() = default;
2323
Node(int Value) : Value(Value) {}
2424
Node(const Node&) = default;
2525
~Node() { Value = -1; }

llvm/unittests/ADT/SmallVectorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ int Constructable::numCopyAssignmentCalls;
159159
int Constructable::numMoveAssignmentCalls;
160160

161161
struct NonCopyable {
162-
NonCopyable() {}
162+
NonCopyable() = default;
163163
NonCopyable(NonCopyable &&) {}
164164
NonCopyable &operator=(NonCopyable &&) { return *this; }
165165
private:

llvm/unittests/ADT/StringMapTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ TEST_F(StringMapTest, NonDefaultConstructable) {
367367
}
368368

369369
struct Immovable {
370-
Immovable() {}
370+
Immovable() = default;
371371
Immovable(Immovable &&) = delete; // will disable the other special members
372372
};
373373

llvm/unittests/ADT/TypeSwitchTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ TEST(TypeSwitchTest, DefaultNullptr) {
167167
TEST(TypeSwitchTest, DefaultNullptrForPointerLike) {
168168
struct Value {
169169
void *ptr;
170-
Value(const Value &other) : ptr(other.ptr) {}
170+
Value(const Value &other) = default;
171171
Value(std::nullptr_t) : ptr(nullptr) {}
172172
Value() : Value(nullptr) {}
173173
};

0 commit comments

Comments
 (0)