Skip to content

Commit 4eed683

Browse files
[llvm] Use "= default" (NFC) (#166088)
Identified with modernize-use-equals-default.
1 parent 902b0bd commit 4eed683

File tree

83 files changed

+101
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+101
-108
lines changed

llvm/examples/Kaleidoscope/Chapter9/toy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class ExprAST {
203203

204204
public:
205205
ExprAST(SourceLocation Loc = CurLoc) : Loc(Loc) {}
206-
virtual ~ExprAST() {}
206+
virtual ~ExprAST() = default;
207207
virtual Value *codegen() = 0;
208208
int getLine() const { return Loc.Line; }
209209
int getCol() const { return Loc.Col; }

llvm/examples/OptSubcommand/llvm-hello-sub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class HelloSubOptTable : public GenericOptTable {
4646
HelloSubOptTable()
4747
: GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable,
4848
/*IgnoreCase=*/false, OptionSubCommands,
49-
OptionSubCommandIDsTable) {}
49+
OptionSubCommandIDsTable) = default;
5050
};
5151
} // namespace
5252

llvm/include/llvm/Analysis/DDG.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ class LLVM_ABI DDGNode : public DDGNodeBase {
6060
DDGNode(DDGNode &&N) : DDGNodeBase(std::move(N)), Kind(N.Kind) {}
6161
virtual ~DDGNode() = 0;
6262

63-
DDGNode &operator=(const DDGNode &N) {
64-
DGNode::operator=(N);
65-
Kind = N.Kind;
66-
return *this;
67-
}
63+
DDGNode &operator=(const DDGNode &N) = default;
6864

6965
DDGNode &operator=(DDGNode &&N) {
7066
DGNode::operator=(std::move(N));

llvm/include/llvm/Demangle/Utility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class OutputBuffer {
8181
OutputBuffer(const OutputBuffer &) = delete;
8282
OutputBuffer &operator=(const OutputBuffer &) = delete;
8383

84-
virtual ~OutputBuffer() {}
84+
virtual ~OutputBuffer() = default;
8585

8686
operator std::string_view() const {
8787
return std::string_view(Buffer, CurrentPosition);

llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ struct HalfWords {
175175
/// FixupInfo base class is required for dynamic lookups.
176176
struct FixupInfoBase {
177177
LLVM_ABI static const FixupInfoBase *getDynFixupInfo(Edge::Kind K);
178-
virtual ~FixupInfoBase() {}
178+
virtual ~FixupInfoBase() = default;
179179
};
180180

181181
/// FixupInfo checks for Arm edge kinds work on 32-bit words

llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ size_t writeMachOStruct(MutableArrayRef<char> Buf, size_t Offset, MachOStruct S,
3636

3737
/// Base type for MachOBuilder load command wrappers.
3838
struct MachOBuilderLoadCommandBase {
39-
virtual ~MachOBuilderLoadCommandBase() {}
39+
virtual ~MachOBuilderLoadCommandBase() = default;
4040
virtual size_t size() const = 0;
4141
virtual size_t write(MutableArrayRef<char> Buf, size_t Offset,
4242
bool SwapStruct) = 0;

llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace rt_bootstrap {
2929
class LLVM_ABI ExecutorSharedMemoryMapperService final
3030
: public ExecutorBootstrapService {
3131
public:
32-
~ExecutorSharedMemoryMapperService() override {};
32+
~ExecutorSharedMemoryMapperService() override = default;
3333

3434
Expected<std::pair<ExecutorAddr, std::string>> reserve(uint64_t Size);
3535
Expected<ExecutorAddr> initialize(ExecutorAddr Reservation,

llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ class OpenMPIRBuilder {
23832383
/// runtime library for debugging
23842384
Value *MapNamesArray = nullptr;
23852385

2386-
explicit TargetDataRTArgs() {}
2386+
explicit TargetDataRTArgs() = default;
23872387
explicit TargetDataRTArgs(Value *BasePointersArray, Value *PointersArray,
23882388
Value *SizesArray, Value *MapTypesArray,
23892389
Value *MapTypesArrayEnd, Value *MappersArray,
@@ -2451,7 +2451,7 @@ class OpenMPIRBuilder {
24512451
bool HasNoWait = false;
24522452

24532453
// Constructors for TargetKernelArgs.
2454-
TargetKernelArgs() {}
2454+
TargetKernelArgs() = default;
24552455
TargetKernelArgs(unsigned NumTargetItems, TargetDataRTArgs RTArgs,
24562456
Value *NumIterations, ArrayRef<Value *> NumTeams,
24572457
ArrayRef<Value *> NumThreads, Value *DynCGGroupMem,
@@ -2494,7 +2494,7 @@ class OpenMPIRBuilder {
24942494
/// Whether the `target ... data` directive has a `nowait` clause.
24952495
bool HasNoWait = false;
24962496

2497-
explicit TargetDataInfo() {}
2497+
explicit TargetDataInfo() = default;
24982498
explicit TargetDataInfo(bool RequiresDevicePointerInfo,
24992499
bool SeparateBeginEndCalls)
25002500
: RequiresDevicePointerInfo(RequiresDevicePointerInfo),

llvm/include/llvm/IR/DebugProgramInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ filterDbgVars(iterator_range<simple_ilist<DbgRecord>::iterator> R) {
589589
/// date.
590590
class DbgMarker {
591591
public:
592-
DbgMarker() {}
592+
DbgMarker() = default;
593593
/// Link back to the Instruction that owns this marker. Can be null during
594594
/// operations that move a marker from one instruction to another.
595595
Instruction *MarkedInstr = nullptr;

llvm/include/llvm/IR/DroppedVariableStats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DroppedVariableStats {
4242
public:
4343
LLVM_ABI DroppedVariableStats(bool DroppedVarStatsEnabled);
4444

45-
virtual ~DroppedVariableStats() {}
45+
virtual ~DroppedVariableStats() = default;
4646

4747
// We intend this to be unique per-compilation, thus no copies.
4848
DroppedVariableStats(const DroppedVariableStats &) = delete;

0 commit comments

Comments
 (0)