diff --git a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp index 51457a3c22ade..14081fb3c3b10 100644 --- a/llvm/examples/Kaleidoscope/Chapter9/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter9/toy.cpp @@ -203,7 +203,7 @@ class ExprAST { public: ExprAST(SourceLocation Loc = CurLoc) : Loc(Loc) {} - virtual ~ExprAST() {} + virtual ~ExprAST() = default; virtual Value *codegen() = 0; int getLine() const { return Loc.Line; } int getCol() const { return Loc.Col; } diff --git a/llvm/examples/OptSubcommand/llvm-hello-sub.cpp b/llvm/examples/OptSubcommand/llvm-hello-sub.cpp index 8071f56cb3685..8c0363f93803c 100644 --- a/llvm/examples/OptSubcommand/llvm-hello-sub.cpp +++ b/llvm/examples/OptSubcommand/llvm-hello-sub.cpp @@ -46,7 +46,7 @@ class HelloSubOptTable : public GenericOptTable { HelloSubOptTable() : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable, /*IgnoreCase=*/false, OptionSubCommands, - OptionSubCommandIDsTable) {} + OptionSubCommandIDsTable) = default; }; } // namespace diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h index 1c5329181ddb1..120bb46330a79 100644 --- a/llvm/include/llvm/Analysis/DDG.h +++ b/llvm/include/llvm/Analysis/DDG.h @@ -60,11 +60,7 @@ class LLVM_ABI DDGNode : public DDGNodeBase { DDGNode(DDGNode &&N) : DDGNodeBase(std::move(N)), Kind(N.Kind) {} virtual ~DDGNode() = 0; - DDGNode &operator=(const DDGNode &N) { - DGNode::operator=(N); - Kind = N.Kind; - return *this; - } + DDGNode &operator=(const DDGNode &N) = default; DDGNode &operator=(DDGNode &&N) { DGNode::operator=(std::move(N)); diff --git a/llvm/include/llvm/Demangle/Utility.h b/llvm/include/llvm/Demangle/Utility.h index 002a1f55467d6..6e6203d716e7a 100644 --- a/llvm/include/llvm/Demangle/Utility.h +++ b/llvm/include/llvm/Demangle/Utility.h @@ -81,7 +81,7 @@ class OutputBuffer { OutputBuffer(const OutputBuffer &) = delete; OutputBuffer &operator=(const OutputBuffer &) = delete; - virtual ~OutputBuffer() {} + virtual ~OutputBuffer() = default; operator std::string_view() const { return std::string_view(Buffer, CurrentPosition); diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h index 98170f60f6e49..9479c107447d5 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h @@ -175,7 +175,7 @@ struct HalfWords { /// FixupInfo base class is required for dynamic lookups. struct FixupInfoBase { LLVM_ABI static const FixupInfoBase *getDynFixupInfo(Edge::Kind K); - virtual ~FixupInfoBase() {} + virtual ~FixupInfoBase() = default; }; /// FixupInfo checks for Arm edge kinds work on 32-bit words diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h b/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h index dd4102599bdb5..1296e24fa4162 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/MachOBuilder.h @@ -36,7 +36,7 @@ size_t writeMachOStruct(MutableArrayRef Buf, size_t Offset, MachOStruct S, /// Base type for MachOBuilder load command wrappers. struct MachOBuilderLoadCommandBase { - virtual ~MachOBuilderLoadCommandBase() {} + virtual ~MachOBuilderLoadCommandBase() = default; virtual size_t size() const = 0; virtual size_t write(MutableArrayRef Buf, size_t Offset, bool SwapStruct) = 0; diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h index 2c385de48ddf6..8f876504eaf53 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h @@ -29,7 +29,7 @@ namespace rt_bootstrap { class LLVM_ABI ExecutorSharedMemoryMapperService final : public ExecutorBootstrapService { public: - ~ExecutorSharedMemoryMapperService() override {}; + ~ExecutorSharedMemoryMapperService() override = default; Expected> reserve(uint64_t Size); Expected initialize(ExecutorAddr Reservation, diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h index 5331cb5abdc6f..b3d7ab4acf303 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h +++ b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h @@ -2383,7 +2383,7 @@ class OpenMPIRBuilder { /// runtime library for debugging Value *MapNamesArray = nullptr; - explicit TargetDataRTArgs() {} + explicit TargetDataRTArgs() = default; explicit TargetDataRTArgs(Value *BasePointersArray, Value *PointersArray, Value *SizesArray, Value *MapTypesArray, Value *MapTypesArrayEnd, Value *MappersArray, @@ -2451,7 +2451,7 @@ class OpenMPIRBuilder { bool HasNoWait = false; // Constructors for TargetKernelArgs. - TargetKernelArgs() {} + TargetKernelArgs() = default; TargetKernelArgs(unsigned NumTargetItems, TargetDataRTArgs RTArgs, Value *NumIterations, ArrayRef NumTeams, ArrayRef NumThreads, Value *DynCGGroupMem, @@ -2494,7 +2494,7 @@ class OpenMPIRBuilder { /// Whether the `target ... data` directive has a `nowait` clause. bool HasNoWait = false; - explicit TargetDataInfo() {} + explicit TargetDataInfo() = default; explicit TargetDataInfo(bool RequiresDevicePointerInfo, bool SeparateBeginEndCalls) : RequiresDevicePointerInfo(RequiresDevicePointerInfo), diff --git a/llvm/include/llvm/IR/DebugProgramInstruction.h b/llvm/include/llvm/IR/DebugProgramInstruction.h index 457c60e3bc929..66f44fe34d3f6 100644 --- a/llvm/include/llvm/IR/DebugProgramInstruction.h +++ b/llvm/include/llvm/IR/DebugProgramInstruction.h @@ -589,7 +589,7 @@ filterDbgVars(iterator_range::iterator> R) { /// date. class DbgMarker { public: - DbgMarker() {} + DbgMarker() = default; /// Link back to the Instruction that owns this marker. Can be null during /// operations that move a marker from one instruction to another. Instruction *MarkedInstr = nullptr; diff --git a/llvm/include/llvm/IR/DroppedVariableStats.h b/llvm/include/llvm/IR/DroppedVariableStats.h index 42e86dd966751..8a1dbd6aeb60a 100644 --- a/llvm/include/llvm/IR/DroppedVariableStats.h +++ b/llvm/include/llvm/IR/DroppedVariableStats.h @@ -42,7 +42,7 @@ class DroppedVariableStats { public: LLVM_ABI DroppedVariableStats(bool DroppedVarStatsEnabled); - virtual ~DroppedVariableStats() {} + virtual ~DroppedVariableStats() = default; // We intend this to be unique per-compilation, thus no copies. DroppedVariableStats(const DroppedVariableStats &) = delete; diff --git a/llvm/include/llvm/IR/TrackingMDRef.h b/llvm/include/llvm/IR/TrackingMDRef.h index d7377398b91b3..7ad7225d076fc 100644 --- a/llvm/include/llvm/IR/TrackingMDRef.h +++ b/llvm/include/llvm/IR/TrackingMDRef.h @@ -111,17 +111,14 @@ template class TypedTrackingMDRef { explicit TypedTrackingMDRef(T *MD) : Ref(static_cast(MD)) {} TypedTrackingMDRef(TypedTrackingMDRef &&X) : Ref(std::move(X.Ref)) {} - TypedTrackingMDRef(const TypedTrackingMDRef &X) : Ref(X.Ref) {} + TypedTrackingMDRef(const TypedTrackingMDRef &X) = default; TypedTrackingMDRef &operator=(TypedTrackingMDRef &&X) { Ref = std::move(X.Ref); return *this; } - TypedTrackingMDRef &operator=(const TypedTrackingMDRef &X) { - Ref = X.Ref; - return *this; - } + TypedTrackingMDRef &operator=(const TypedTrackingMDRef &X) = default; T *get() const { return (T *)Ref.get(); } operator T *() const { return get(); } diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h index e6fc7077a2dc3..f611edd715398 100644 --- a/llvm/include/llvm/MC/MCRegisterInfo.h +++ b/llvm/include/llvm/MC/MCRegisterInfo.h @@ -272,7 +272,7 @@ class LLVM_ABI MCRegisterInfo { friend class MCRegUnitRootIterator; friend class MCRegAliasIterator; - virtual ~MCRegisterInfo() {} + virtual ~MCRegisterInfo() = default; /// Initialize MCRegisterInfo, called by TableGen /// auto-generated routines. *DO NOT USE*. diff --git a/llvm/include/llvm/MCA/SourceMgr.h b/llvm/include/llvm/MCA/SourceMgr.h index 16a60d1116ad6..300961cbfcd69 100644 --- a/llvm/include/llvm/MCA/SourceMgr.h +++ b/llvm/include/llvm/MCA/SourceMgr.h @@ -50,7 +50,7 @@ struct SourceMgr { /// Advance to the next \a SourceRef. virtual void updateNext() = 0; - virtual ~SourceMgr() {} + virtual ~SourceMgr() = default; }; /// The default implementation of \a SourceMgr. It always takes a fixed number diff --git a/llvm/include/llvm/ObjCopy/ConfigManager.h b/llvm/include/llvm/ObjCopy/ConfigManager.h index 15687998820c5..45f847ff7c434 100644 --- a/llvm/include/llvm/ObjCopy/ConfigManager.h +++ b/llvm/include/llvm/ObjCopy/ConfigManager.h @@ -23,7 +23,7 @@ namespace llvm { namespace objcopy { struct LLVM_ABI ConfigManager : public MultiFormatConfig { - ~ConfigManager() override {} + ~ConfigManager() override = default; const CommonConfig &getCommonConfig() const override { return Common; } diff --git a/llvm/include/llvm/ObjCopy/MultiFormatConfig.h b/llvm/include/llvm/ObjCopy/MultiFormatConfig.h index bb93f64aa2788..91baf9b286c58 100644 --- a/llvm/include/llvm/ObjCopy/MultiFormatConfig.h +++ b/llvm/include/llvm/ObjCopy/MultiFormatConfig.h @@ -24,7 +24,7 @@ struct DXContainerConfig; class MultiFormatConfig { public: - virtual ~MultiFormatConfig() {} + virtual ~MultiFormatConfig() = default; virtual const CommonConfig &getCommonConfig() const = 0; virtual Expected getELFConfig() const = 0; diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h index b5b110d0f59a1..fbfe3069566d3 100644 --- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h +++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h @@ -115,7 +115,7 @@ struct RootParameterHeaderYaml { dxbc::ShaderVisibility Visibility; uint32_t Offset; - RootParameterHeaderYaml(){}; + RootParameterHeaderYaml() = default; RootParameterHeaderYaml(dxbc::RootParameterType T) : Type(T) {} }; @@ -123,7 +123,7 @@ struct RootParameterLocationYaml { RootParameterHeaderYaml Header; std::optional IndexInSignature; - RootParameterLocationYaml(){}; + RootParameterLocationYaml() = default; explicit RootParameterLocationYaml(RootParameterHeaderYaml Header) : Header(Header) {} }; diff --git a/llvm/include/llvm/ProfileData/DataAccessProf.h b/llvm/include/llvm/ProfileData/DataAccessProf.h index 608306f02be66..ea256ef7b170b 100644 --- a/llvm/include/llvm/ProfileData/DataAccessProf.h +++ b/llvm/include/llvm/ProfileData/DataAccessProf.h @@ -42,7 +42,7 @@ struct SourceLocation { : FileName(FileNameRef.str()), Line(Line) {} // Empty constructor is used in yaml conversion. - SourceLocation() {} + SourceLocation() = default; /// The filename where the data is located. std::string FileName; /// The line number in the source code. diff --git a/llvm/include/llvm/SandboxIR/Pass.h b/llvm/include/llvm/SandboxIR/Pass.h index 267389a8a87a2..eb84f21483f8e 100644 --- a/llvm/include/llvm/SandboxIR/Pass.h +++ b/llvm/include/llvm/SandboxIR/Pass.h @@ -56,7 +56,7 @@ class Pass { "A pass name should not contain whitespaces!"); assert(!Name.starts_with('-') && "A pass name should not start with '-'!"); } - virtual ~Pass() {} + virtual ~Pass() = default; /// \Returns the name of the pass. StringRef getName() const { return Name; } #ifndef NDEBUG diff --git a/llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.h b/llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.h index 84757aea7045d..970abdc38f417 100644 --- a/llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.h +++ b/llvm/lib/DWARFLinker/Parallel/DWARFLinkerUnit.h @@ -28,7 +28,7 @@ using MacroOffset2UnitMapTy = DenseMap; /// Base class for all Dwarf units(Compile unit/Type table unit). class DwarfUnit : public OutputSections { public: - virtual ~DwarfUnit() {} + virtual ~DwarfUnit() = default; DwarfUnit(LinkingGlobalData &GlobalData, unsigned ID, StringRef ClangModuleName) : OutputSections(GlobalData), ID(ID), ClangModuleName(ClangModuleName), diff --git a/llvm/lib/DWARFLinker/Parallel/StringEntryToDwarfStringPoolEntryMap.h b/llvm/lib/DWARFLinker/Parallel/StringEntryToDwarfStringPoolEntryMap.h index f67536ef7a1a8..8ccb4a502aaba 100644 --- a/llvm/lib/DWARFLinker/Parallel/StringEntryToDwarfStringPoolEntryMap.h +++ b/llvm/lib/DWARFLinker/Parallel/StringEntryToDwarfStringPoolEntryMap.h @@ -22,7 +22,7 @@ class StringEntryToDwarfStringPoolEntryMap { public: StringEntryToDwarfStringPoolEntryMap(LinkingGlobalData &GlobalData) : GlobalData(GlobalData) {} - ~StringEntryToDwarfStringPoolEntryMap() {} + ~StringEntryToDwarfStringPoolEntryMap() = default; /// Create DwarfStringPoolEntry for specified StringEntry if necessary. /// Initialize DwarfStringPoolEntry with initial values. diff --git a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp index 7e606c6a473b6..4e7db822776cc 100644 --- a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp +++ b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp @@ -27,7 +27,7 @@ namespace llvm { namespace orc { -MemoryMapper::~MemoryMapper() {} +MemoryMapper::~MemoryMapper() = default; InProcessMemoryMapper::InProcessMemoryMapper(size_t PageSize) : PageSize(PageSize) {} diff --git a/llvm/lib/MC/GOFFObjectWriter.cpp b/llvm/lib/MC/GOFFObjectWriter.cpp index 71bd39763956e..a3eaaa743039d 100644 --- a/llvm/lib/MC/GOFFObjectWriter.cpp +++ b/llvm/lib/MC/GOFFObjectWriter.cpp @@ -520,7 +520,7 @@ GOFFObjectWriter::GOFFObjectWriter( std::unique_ptr MOTW, raw_pwrite_stream &OS) : TargetObjectWriter(std::move(MOTW)), OS(OS) {} -GOFFObjectWriter::~GOFFObjectWriter() {} +GOFFObjectWriter::~GOFFObjectWriter() = default; uint64_t GOFFObjectWriter::writeObject() { uint64_t Size = GOFFWriter(OS, *Asm).writeObject(); diff --git a/llvm/lib/MC/MCDXContainerWriter.cpp b/llvm/lib/MC/MCDXContainerWriter.cpp index 5eda039853ca8..ebed411454087 100644 --- a/llvm/lib/MC/MCDXContainerWriter.cpp +++ b/llvm/lib/MC/MCDXContainerWriter.cpp @@ -16,7 +16,7 @@ using namespace llvm; -MCDXContainerTargetWriter::~MCDXContainerTargetWriter() {} +MCDXContainerTargetWriter::~MCDXContainerTargetWriter() = default; uint64_t DXContainerObjectWriter::writeObject() { auto &Asm = *this->Asm; diff --git a/llvm/lib/MC/MCGOFFStreamer.cpp b/llvm/lib/MC/MCGOFFStreamer.cpp index 8b228db0e8b30..ad6397bce70f0 100644 --- a/llvm/lib/MC/MCGOFFStreamer.cpp +++ b/llvm/lib/MC/MCGOFFStreamer.cpp @@ -20,7 +20,7 @@ using namespace llvm; -MCGOFFStreamer::~MCGOFFStreamer() {} +MCGOFFStreamer::~MCGOFFStreamer() = default; GOFFObjectWriter &MCGOFFStreamer::getWriter() { return static_cast(getAssembler().getWriter()); diff --git a/llvm/lib/ObjCopy/COFF/COFFWriter.h b/llvm/lib/ObjCopy/COFF/COFFWriter.h index 66d7f01c87f18..3ee0e06b92ae4 100644 --- a/llvm/lib/ObjCopy/COFF/COFFWriter.h +++ b/llvm/lib/ObjCopy/COFF/COFFWriter.h @@ -50,7 +50,7 @@ class COFFWriter { Expected virtualAddressToFileAddress(uint32_t RVA); public: - virtual ~COFFWriter() {} + virtual ~COFFWriter() = default; Error write(); COFFWriter(Object &Obj, raw_ostream &Out) diff --git a/llvm/lib/ObjCopy/ELF/ELFObject.h b/llvm/lib/ObjCopy/ELF/ELFObject.h index 4f6473f515ddd..2783ef27ac9de 100644 --- a/llvm/lib/ObjCopy/ELF/ELFObject.h +++ b/llvm/lib/ObjCopy/ELF/ELFObject.h @@ -134,7 +134,7 @@ template class ELFSectionWriter : public SectionWriter { using Elf_Sym = typename ELFT::Sym; public: - ~ELFSectionWriter() override {} + ~ELFSectionWriter() override = default; Error visit(const SymbolTableSection &Sec) override; Error visit(const RelocationSection &Sec) override; Error visit(const GnuDebugLinkSection &Sec) override; @@ -180,7 +180,7 @@ template class ELFSectionSizer : public MutableSectionVisitor { class BinarySectionWriter : public SectionWriter { public: - ~BinarySectionWriter() override {} + ~BinarySectionWriter() override = default; Error visit(const SymbolTableSection &Sec) override; Error visit(const RelocationSection &Sec) override; @@ -346,7 +346,7 @@ template class ELFWriter : public Writer { size_t totalSize() const; public: - ~ELFWriter() override {} + ~ELFWriter() override = default; bool WriteSectionHeaders; // For --only-keep-debug, select an alternative section/segment layout @@ -367,7 +367,7 @@ class BinaryWriter : public Writer { uint64_t TotalSize = 0; public: - ~BinaryWriter() override {} + ~BinaryWriter() override = default; Error finalize() override; Error write() override; BinaryWriter(Object &Obj, raw_ostream &Out, const CommonConfig &Config) @@ -784,7 +784,7 @@ class SectionIndexSection : public SectionBase { SymbolTableSection *Symbols = nullptr; public: - ~SectionIndexSection() override {} + ~SectionIndexSection() override = default; void addIndex(uint32_t Index) { assert(Size > 0); Indexes.push_back(Index); diff --git a/llvm/lib/ObjCopy/MachO/MachOReader.h b/llvm/lib/ObjCopy/MachO/MachOReader.h index e315e6fd9b117..940ba4c2d879e 100644 --- a/llvm/lib/ObjCopy/MachO/MachOReader.h +++ b/llvm/lib/ObjCopy/MachO/MachOReader.h @@ -23,7 +23,7 @@ namespace macho { // raw binaries and regular MachO object files. class Reader { public: - virtual ~Reader(){}; + virtual ~Reader() = default; virtual Expected> create() const = 0; }; diff --git a/llvm/lib/ObjCopy/XCOFF/XCOFFWriter.h b/llvm/lib/ObjCopy/XCOFF/XCOFFWriter.h index 8620548ed5991..47639ad82fa75 100644 --- a/llvm/lib/ObjCopy/XCOFF/XCOFFWriter.h +++ b/llvm/lib/ObjCopy/XCOFF/XCOFFWriter.h @@ -20,7 +20,7 @@ namespace xcoff { class XCOFFWriter { public: - virtual ~XCOFFWriter() {} + virtual ~XCOFFWriter() = default; XCOFFWriter(Object &Obj, raw_ostream &Out) : Obj(Obj), Out(Out) {} Error write(); diff --git a/llvm/lib/ObjectYAML/GOFFYAML.cpp b/llvm/lib/ObjectYAML/GOFFYAML.cpp index 60bc1f70274b2..ecd7fb646ea36 100644 --- a/llvm/lib/ObjectYAML/GOFFYAML.cpp +++ b/llvm/lib/ObjectYAML/GOFFYAML.cpp @@ -15,7 +15,7 @@ namespace llvm { namespace GOFFYAML { -Object::Object() {} +Object::Object() = default; } // namespace GOFFYAML diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp index 7290a86503120..6b7e980d048a4 100644 --- a/llvm/lib/Passes/StandardInstrumentations.cpp +++ b/llvm/lib/Passes/StandardInstrumentations.cpp @@ -537,7 +537,7 @@ void IRChangedPrinter::handleAfter(StringRef PassID, std::string &Name, Out << "*** IR Dump After " << PassID << " on " << Name << " ***\n" << After; } -IRChangedTester::~IRChangedTester() {} +IRChangedTester::~IRChangedTester() = default; void IRChangedTester::registerCallbacks(PassInstrumentationCallbacks &PIC) { if (TestChanged != "") @@ -1566,7 +1566,7 @@ void InLineChangePrinter::registerCallbacks(PassInstrumentationCallbacks &PIC) { TextChangeReporter>::registerRequiredCallbacks(PIC); } -TimeProfilingPassesHandler::TimeProfilingPassesHandler() {} +TimeProfilingPassesHandler::TimeProfilingPassesHandler() = default; void TimeProfilingPassesHandler::registerCallbacks( PassInstrumentationCallbacks &PIC) { diff --git a/llvm/lib/SandboxIR/Context.cpp b/llvm/lib/SandboxIR/Context.cpp index fb6ff6203567a..6f5d072fb6913 100644 --- a/llvm/lib/SandboxIR/Context.cpp +++ b/llvm/lib/SandboxIR/Context.cpp @@ -637,7 +637,7 @@ Context::Context(LLVMContext &LLVMCtx) : LLVMCtx(LLVMCtx), IRTracker(*this), LLVMIRBuilder(LLVMCtx, ConstantFolder()) {} -Context::~Context() {} +Context::~Context() = default; void Context::clear() { // TODO: Ideally we should clear only function-scope objects, and keep global diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.h b/llvm/lib/Target/AMDGPU/AMDGPU.h index cd8b2495a4250..67042b700c047 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPU.h +++ b/llvm/lib/Target/AMDGPU/AMDGPU.h @@ -69,7 +69,7 @@ FunctionPass *createAMDGPUPreloadKernArgPrologLegacyPass(); ModulePass *createAMDGPUPreloadKernelArgumentsLegacyPass(const TargetMachine *); struct AMDGPUSimplifyLibCallsPass : PassInfoMixin { - AMDGPUSimplifyLibCallsPass() {} + AMDGPUSimplifyLibCallsPass() = default; PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); }; @@ -371,13 +371,13 @@ class AMDGPUPreloadKernelArgumentsPass class AMDGPUAnnotateUniformValuesPass : public PassInfoMixin { public: - AMDGPUAnnotateUniformValuesPass() {} + AMDGPUAnnotateUniformValuesPass() = default; PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); }; class SIModeRegisterPass : public PassInfoMixin { public: - SIModeRegisterPass() {} + SIModeRegisterPass() = default; PreservedAnalyses run(MachineFunction &F, MachineFunctionAnalysisManager &AM); }; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h index 1064e57b9da9e..dad94b83aa84f 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h @@ -96,7 +96,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const ArgDescriptor &Arg) { } struct KernArgPreloadDescriptor : public ArgDescriptor { - KernArgPreloadDescriptor() {} + KernArgPreloadDescriptor() = default; SmallVector Regs; }; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.h b/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.h index cf2ab82537800..a3be0f51c2c2f 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.h @@ -48,7 +48,7 @@ class AMDGPUPerfHintAnalysis { FuncInfoMap FIM; public: - AMDGPUPerfHintAnalysis() {} + AMDGPUPerfHintAnalysis() = default; // OldPM bool runOnSCC(const GCNTargetMachine &TM, CallGraphSCC &SCC); diff --git a/llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp b/llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp index 103cdec8233a0..dd474ac52c3c8 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp @@ -202,7 +202,7 @@ bool PredicateMapping::match(const MachineInstr &MI, return true; } -SetOfRulesForOpcode::SetOfRulesForOpcode() {} +SetOfRulesForOpcode::SetOfRulesForOpcode() = default; SetOfRulesForOpcode::SetOfRulesForOpcode(FastRulesTypes FastTypes) : FastTypes(FastTypes) {} diff --git a/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp b/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp index 61c5dcd5ebada..ded2f5ae1f8af 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp @@ -54,7 +54,7 @@ class AMDGPUWaitSGPRHazards { bool CullSGPRHazardsAtMemWait; unsigned CullSGPRHazardsMemWaitThreshold; - AMDGPUWaitSGPRHazards() {} + AMDGPUWaitSGPRHazards() = default; // Return the numeric ID 0-127 for a given SGPR. static std::optional sgprNumber(Register Reg, diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h index 975781fea9452..f357981ac91de 100644 --- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h +++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h @@ -183,7 +183,7 @@ class ScheduleMetrics { unsigned BubbleCycles; public: - ScheduleMetrics() {} + ScheduleMetrics() = default; ScheduleMetrics(unsigned L, unsigned BC) : ScheduleLength(L), BubbleCycles(BC) {} unsigned getLength() const { return ScheduleLength; } @@ -217,7 +217,7 @@ class RegionPressureMap { bool IsLiveOut; public: - RegionPressureMap() {} + RegionPressureMap() = default; RegionPressureMap(GCNScheduleDAGMILive *GCNDAG, bool LiveOut) : DAG(GCNDAG), IsLiveOut(LiveOut) {} // Build the Instr->LiveReg and RegionIdx->Instr maps diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp index 7ee280d8fc8b0..eadf02043841e 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp @@ -1815,7 +1815,7 @@ struct WeightedLeaf { int Weight; int InsertionOrder; - WeightedLeaf() {} + WeightedLeaf() = default; WeightedLeaf(SDValue Value, int Weight, int InsertionOrder) : Value(Value), Weight(Weight), InsertionOrder(InsertionOrder) { diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp index 7d5456555045b..6d69af5938e79 100644 --- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp @@ -39,7 +39,7 @@ LoongArchELFObjectWriter::LoongArchELFObjectWriter(uint8_t OSABI, bool Is64Bit) : MCELFObjectTargetWriter(Is64Bit, OSABI, ELF::EM_LOONGARCH, /*HasRelocationAddend=*/true) {} -LoongArchELFObjectWriter::~LoongArchELFObjectWriter() {} +LoongArchELFObjectWriter::~LoongArchELFObjectWriter() = default; unsigned LoongArchELFObjectWriter::getRelocType(const MCFixup &Fixup, const MCValue &Target, diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp index f0e2bc4855187..08fa51d333346 100644 --- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp @@ -38,7 +38,7 @@ class LoongArchMCCodeEmitter : public MCCodeEmitter { LoongArchMCCodeEmitter(MCContext &ctx, MCInstrInfo const &MCII) : Ctx(ctx), MCII(MCII) {} - ~LoongArchMCCodeEmitter() override {} + ~LoongArchMCCodeEmitter() override = default; void encodeInstruction(const MCInst &MI, SmallVectorImpl &CB, SmallVectorImpl &Fixups, diff --git a/llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h b/llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h index caef8fe790adb..b832b82cbc30c 100644 --- a/llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h +++ b/llvm/lib/Target/NVPTX/NVPTXAliasAnalysis.h @@ -20,7 +20,7 @@ class MemoryLocation; class NVPTXAAResult : public AAResultBase { public: - NVPTXAAResult() {} + NVPTXAAResult() = default; NVPTXAAResult(NVPTXAAResult &&Arg) : AAResultBase(std::move(Arg)) {} /// Handle invalidation events from the new pass manager. diff --git a/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp b/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp index a1c8e23793b92..c58a5c07a34f7 100644 --- a/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp +++ b/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp @@ -48,7 +48,7 @@ class VXRMInfo { } State = Uninitialized; public: - VXRMInfo() {} + VXRMInfo() = default; static VXRMInfo getUnknown() { VXRMInfo Info; diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVTargetStreamer.cpp b/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVTargetStreamer.cpp index 0a318e0e01e59..ed6d355670cbd 100644 --- a/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVTargetStreamer.cpp +++ b/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVTargetStreamer.cpp @@ -15,4 +15,4 @@ using namespace llvm; SPIRVTargetStreamer::SPIRVTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {} -SPIRVTargetStreamer::~SPIRVTargetStreamer() {} +SPIRVTargetStreamer::~SPIRVTargetStreamer() = default; diff --git a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h index 2d19f6de604e4..44b6c66d361bf 100644 --- a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h +++ b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h @@ -81,7 +81,7 @@ struct RequirementHandler { void initAvailableCapabilitiesForVulkan(const SPIRVSubtarget &ST); public: - RequirementHandler() {} + RequirementHandler() = default; void clear() { MinimalCaps.clear(); AllCaps.clear(); diff --git a/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp b/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp index 7dd0b95cd9763..5ba035682238b 100644 --- a/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp @@ -69,7 +69,7 @@ static Reloc::Model getEffectiveRelocModel(std::optional RM) { } // Pin SPIRVTargetObjectFile's vtables to this file. -SPIRVTargetObjectFile::~SPIRVTargetObjectFile() {} +SPIRVTargetObjectFile::~SPIRVTargetObjectFile() = default; SPIRVTargetMachine::SPIRVTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, diff --git a/llvm/lib/Target/SystemZ/SystemZTargetObjectFile.h b/llvm/lib/Target/SystemZ/SystemZTargetObjectFile.h index 9d0adbb81d86d..87ec2564edcfb 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetObjectFile.h +++ b/llvm/lib/Target/SystemZ/SystemZTargetObjectFile.h @@ -16,7 +16,7 @@ namespace llvm { /// This implementation is used for SystemZ ELF targets. class SystemZELFTargetObjectFile : public TargetLoweringObjectFileELF { public: - SystemZELFTargetObjectFile() {} + SystemZELFTargetObjectFile() = default; /// Describe a TLS variable address within debug info. const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override; diff --git a/llvm/lib/TextAPI/RecordVisitor.cpp b/llvm/lib/TextAPI/RecordVisitor.cpp index d333b33092263..24971a70f2ddf 100644 --- a/llvm/lib/TextAPI/RecordVisitor.cpp +++ b/llvm/lib/TextAPI/RecordVisitor.cpp @@ -15,7 +15,7 @@ using namespace llvm; using namespace llvm::MachO; -RecordVisitor::~RecordVisitor() {} +RecordVisitor::~RecordVisitor() = default; void RecordVisitor::visitObjCInterface(const ObjCInterfaceRecord &) {} void RecordVisitor::visitObjCCategory(const ObjCCategoryRecord &) {} diff --git a/llvm/tools/bugpoint/ListReducer.h b/llvm/tools/bugpoint/ListReducer.h index 06f8ddb255346..ceee85325129e 100644 --- a/llvm/tools/bugpoint/ListReducer.h +++ b/llvm/tools/bugpoint/ListReducer.h @@ -32,7 +32,7 @@ template struct ListReducer { KeepPrefix // The prefix alone satisfies the predicate }; - virtual ~ListReducer() {} + virtual ~ListReducer() = default; /// This virtual function should be overriden by subclasses to implement the /// test desired. The testcase is only required to test to see if the Kept diff --git a/llvm/tools/bugpoint/ToolRunner.h b/llvm/tools/bugpoint/ToolRunner.h index c9da9afba0e46..9ff06639d311d 100644 --- a/llvm/tools/bugpoint/ToolRunner.h +++ b/llvm/tools/bugpoint/ToolRunner.h @@ -105,7 +105,7 @@ class AbstractInterpreter { createCustomExecutor(const char *Argv0, std::string &Message, const std::string &ExecCommandLine); - virtual ~AbstractInterpreter() {} + virtual ~AbstractInterpreter() = default; /// compileProgram - Compile the specified program from bitcode to executable /// code. This does not produce any output, it is only used when debugging diff --git a/llvm/tools/dsymutil/BinaryHolder.h b/llvm/tools/dsymutil/BinaryHolder.h index cb5bd95978144..27d71514cb73e 100644 --- a/llvm/tools/dsymutil/BinaryHolder.h +++ b/llvm/tools/dsymutil/BinaryHolder.h @@ -110,7 +110,7 @@ class BinaryHolder { std::string Filename; TimestampTy Timestamp; - KeyTy() {} + KeyTy() = default; KeyTy(StringRef Filename, TimestampTy Timestamp) : Filename(Filename.str()), Timestamp(Timestamp) {} }; diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 7fee06b5d7b4f..017e2102348b7 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -305,7 +305,7 @@ class LLIObjectCache : public ObjectCache { this->CacheDir[this->CacheDir.size() - 1] != '/') this->CacheDir += '/'; } - ~LLIObjectCache() override {} + ~LLIObjectCache() override = default; void notifyObjectCompiled(const Module *M, MemoryBufferRef Obj) override { const std::string &ModuleID = M->getModuleIdentifier(); diff --git a/llvm/tools/llvm-cov/CoverageExporter.h b/llvm/tools/llvm-cov/CoverageExporter.h index 751e55dc09161..ba946a14e6e5c 100644 --- a/llvm/tools/llvm-cov/CoverageExporter.h +++ b/llvm/tools/llvm-cov/CoverageExporter.h @@ -37,7 +37,7 @@ class CoverageExporter { : Coverage(CoverageMapping), Options(Options), OS(OS) {} public: - virtual ~CoverageExporter(){}; + virtual ~CoverageExporter() = default; /// Render the CoverageMapping object. virtual void renderRoot(const CoverageFilters &IgnoreFilters) = 0; diff --git a/llvm/tools/llvm-cov/CoverageFilters.h b/llvm/tools/llvm-cov/CoverageFilters.h index 5345b0c87cc27..3cee23ae50dbf 100644 --- a/llvm/tools/llvm-cov/CoverageFilters.h +++ b/llvm/tools/llvm-cov/CoverageFilters.h @@ -28,7 +28,7 @@ struct FunctionRecord; /// Matches specific functions that pass the requirement of this filter. class CoverageFilter { public: - virtual ~CoverageFilter() {} + virtual ~CoverageFilter() = default; /// Return true if the function passes the requirements of this filter. virtual bool matches(const coverage::CoverageMapping &CM, diff --git a/llvm/tools/llvm-cov/SourceCoverageView.h b/llvm/tools/llvm-cov/SourceCoverageView.h index 43fb890ad7687..bde187ea35ed1 100644 --- a/llvm/tools/llvm-cov/SourceCoverageView.h +++ b/llvm/tools/llvm-cov/SourceCoverageView.h @@ -122,7 +122,7 @@ class CoveragePrinter { static std::unique_ptr create(const CoverageViewOptions &Opts); - virtual ~CoveragePrinter() {} + virtual ~CoveragePrinter() = default; /// @name File Creation Interface /// @{ @@ -288,7 +288,7 @@ class SourceCoverageView { create(StringRef SourceName, const MemoryBuffer &File, const CoverageViewOptions &Options, CoverageData &&CoverageInfo); - virtual ~SourceCoverageView() {} + virtual ~SourceCoverageView() = default; /// Return the source name formatted for the host OS. std::string getSourceName() const; diff --git a/llvm/tools/llvm-diff/lib/DiffConsumer.h b/llvm/tools/llvm-diff/lib/DiffConsumer.h index 08c3afcbe111e..d4f339bd560f4 100644 --- a/llvm/tools/llvm-diff/lib/DiffConsumer.h +++ b/llvm/tools/llvm-diff/lib/DiffConsumer.h @@ -49,7 +49,7 @@ class StringRef; virtual void logd(const DiffLogBuilder &Log) = 0; protected: - virtual ~Consumer() {} + virtual ~Consumer() = default; }; class DiffConsumer : public Consumer { diff --git a/llvm/tools/llvm-diff/lib/DifferenceEngine.h b/llvm/tools/llvm-diff/lib/DifferenceEngine.h index 436a35566360f..b829b2cd0bcbc 100644 --- a/llvm/tools/llvm-diff/lib/DifferenceEngine.h +++ b/llvm/tools/llvm-diff/lib/DifferenceEngine.h @@ -54,7 +54,7 @@ namespace llvm { virtual bool operator()(const Value *L, const Value *R) = 0; protected: - virtual ~Oracle() {} + virtual ~Oracle() = default; }; DifferenceEngine(Consumer &consumer) diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp index 1fd0a15dcfa91..09b8614943ac4 100644 --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp @@ -877,7 +877,7 @@ Error BenchmarkRunner::getValidationCountersToRun( return Error::success(); } -BenchmarkRunner::FunctionExecutor::~FunctionExecutor() {} +BenchmarkRunner::FunctionExecutor::~FunctionExecutor() = default; } // namespace exegesis } // namespace llvm diff --git a/llvm/tools/llvm-exegesis/lib/Error.h b/llvm/tools/llvm-exegesis/lib/Error.h index 9b71fe8f56897..c899023e46607 100644 --- a/llvm/tools/llvm-exegesis/lib/Error.h +++ b/llvm/tools/llvm-exegesis/lib/Error.h @@ -81,7 +81,7 @@ class SnippetSignal : public SnippetExecutionFailure { struct PerfCounterNotFullyEnabled : public ErrorInfo { static char ID; - PerfCounterNotFullyEnabled() {} + PerfCounterNotFullyEnabled() = default; void log(raw_ostream &OS) const override; diff --git a/llvm/tools/llvm-exegesis/lib/SnippetRepetitor.cpp b/llvm/tools/llvm-exegesis/lib/SnippetRepetitor.cpp index 80f5ce4a2f1db..37dcc7c56e5af 100644 --- a/llvm/tools/llvm-exegesis/lib/SnippetRepetitor.cpp +++ b/llvm/tools/llvm-exegesis/lib/SnippetRepetitor.cpp @@ -131,7 +131,7 @@ class LoopSnippetRepetitor : public SnippetRepetitor { } // namespace -SnippetRepetitor::~SnippetRepetitor() {} +SnippetRepetitor::~SnippetRepetitor() = default; std::unique_ptr SnippetRepetitor::Create(Benchmark::RepetitionModeE Mode, diff --git a/llvm/tools/llvm-exegesis/lib/Target.cpp b/llvm/tools/llvm-exegesis/lib/Target.cpp index fc5f82f288ae4..2ad6c5af4de4d 100644 --- a/llvm/tools/llvm-exegesis/lib/Target.cpp +++ b/llvm/tools/llvm-exegesis/lib/Target.cpp @@ -23,7 +23,7 @@ cl::OptionCategory Options("llvm-exegesis options"); cl::OptionCategory BenchmarkOptions("llvm-exegesis benchmark options"); cl::OptionCategory AnalysisOptions("llvm-exegesis analysis options"); -ExegesisTarget::~ExegesisTarget() {} // anchor. +ExegesisTarget::~ExegesisTarget() = default; // anchor. static ExegesisTarget *FirstTarget = nullptr; @@ -215,7 +215,7 @@ const PfmCountersInfo &ExegesisTarget::getDummyPfmCounters() const { return PfmCountersInfo::Dummy; } -ExegesisTarget::SavedState::~SavedState() {} // anchor. +ExegesisTarget::SavedState::~SavedState() = default; // anchor. namespace { diff --git a/llvm/tools/llvm-libtool-darwin/DependencyInfo.h b/llvm/tools/llvm-libtool-darwin/DependencyInfo.h index 784ec3f50cd53..80bad8f5fa545 100644 --- a/llvm/tools/llvm-libtool-darwin/DependencyInfo.h +++ b/llvm/tools/llvm-libtool-darwin/DependencyInfo.h @@ -18,7 +18,7 @@ class DependencyInfo { explicit DependencyInfo(std::string DependencyInfoPath) : DependencyInfoPath(DependencyInfoPath) {} - virtual ~DependencyInfo(){}; + virtual ~DependencyInfo() = default; virtual void addMissingInput(llvm::StringRef Path) { NotFounds.insert(Path.str()); diff --git a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp index f7f929e49ead9..146907189929e 100644 --- a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp +++ b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp @@ -26,7 +26,7 @@ namespace llvm { namespace mca { // This virtual dtor serves as the anchor for the CodeRegionGenerator class. -CodeRegionGenerator::~CodeRegionGenerator() {} +CodeRegionGenerator::~CodeRegionGenerator() = default; Expected AsmCodeRegionGenerator::parseCodeRegions( const std::unique_ptr &IP, bool SkipFailures) { diff --git a/llvm/tools/llvm-mca/CodeRegionGenerator.h b/llvm/tools/llvm-mca/CodeRegionGenerator.h index a48c67a22f27b..c30f67a53eac0 100644 --- a/llvm/tools/llvm-mca/CodeRegionGenerator.h +++ b/llvm/tools/llvm-mca/CodeRegionGenerator.h @@ -151,7 +151,7 @@ class CodeRegionGenerator { bool SkipFailures) = 0; public: - CodeRegionGenerator() {} + CodeRegionGenerator() = default; virtual ~CodeRegionGenerator(); }; diff --git a/llvm/tools/llvm-objdump/SourcePrinter.h b/llvm/tools/llvm-objdump/SourcePrinter.h index 5c131a0eb1fd7..19acc871707aa 100644 --- a/llvm/tools/llvm-objdump/SourcePrinter.h +++ b/llvm/tools/llvm-objdump/SourcePrinter.h @@ -34,7 +34,7 @@ class LiveElement { LiveElement(const char *Name, DWARFUnit *Unit, const DWARFDie FuncDie) : Name(Name), Unit(Unit), FuncDie(FuncDie) {} - virtual ~LiveElement() {}; + virtual ~LiveElement() = default; const char *getName() const { return Name; } virtual bool liveAtAddress(object::SectionedAddress Addr) const = 0; diff --git a/llvm/tools/llvm-objdump/llvm-objdump.h b/llvm/tools/llvm-objdump/llvm-objdump.h index 3525be9a5314a..bac858929ae9c 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.h +++ b/llvm/tools/llvm-objdump/llvm-objdump.h @@ -84,7 +84,7 @@ class Dumper { public: Dumper(const object::ObjectFile &O); - virtual ~Dumper() {} + virtual ~Dumper() = default; void reportUniqueWarning(Error Err); void reportUniqueWarning(const Twine &Msg); diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp index b2362ecb75703..d836d98e1b0d0 100644 --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -68,7 +68,7 @@ DumpOutputStyle::DumpOutputStyle(InputFile &File) RefTracker.reset(new TypeReferenceTracker(File)); } -DumpOutputStyle::~DumpOutputStyle() {} +DumpOutputStyle::~DumpOutputStyle() = default; PDBFile &DumpOutputStyle::getPdb() { return File.pdb(); } object::COFFObjectFile &DumpOutputStyle::getObj() { return File.obj(); } diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.h b/llvm/tools/llvm-pdbutil/DumpOutputStyle.h index 6714a6aa59f17..ea4a47f6f4f06 100644 --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.h +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.h @@ -29,7 +29,7 @@ class TypeReferenceTracker; struct StatCollection { struct Stat { - Stat() {} + Stat() = default; Stat(uint32_t Count, uint32_t Size) : Count(Count), Size(Size) {} uint32_t Count = 0; uint32_t Size = 0; diff --git a/llvm/tools/llvm-pdbutil/OutputStyle.h b/llvm/tools/llvm-pdbutil/OutputStyle.h index 8cc9016d79a28..a09fb82f066bb 100644 --- a/llvm/tools/llvm-pdbutil/OutputStyle.h +++ b/llvm/tools/llvm-pdbutil/OutputStyle.h @@ -17,7 +17,7 @@ namespace pdb { class OutputStyle { public: - virtual ~OutputStyle() {} + virtual ~OutputStyle() = default; virtual Error dump() = 0; }; diff --git a/llvm/tools/llvm-pdbutil/StreamUtil.h b/llvm/tools/llvm-pdbutil/StreamUtil.h index 9d6030c7ba9c4..6b8c13f0c0c25 100644 --- a/llvm/tools/llvm-pdbutil/StreamUtil.h +++ b/llvm/tools/llvm-pdbutil/StreamUtil.h @@ -35,7 +35,7 @@ enum class StreamPurpose { struct StreamInfo { public: - StreamInfo() {} + StreamInfo() = default; uint32_t getModuleIndex() const { return *ModuleIndex; } StreamPurpose getPurpose() const { return Purpose; } diff --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp index 94728ce4abffe..96db6a714572a 100644 --- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp +++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp @@ -187,7 +187,7 @@ ProfiledBinary::ProfiledBinary(const StringRef ExeBinPath, load(); } -ProfiledBinary::~ProfiledBinary() {} +ProfiledBinary::~ProfiledBinary() = default; void ProfiledBinary::warnNoFuncEntry() { uint64_t NoFuncEntryNum = 0; diff --git a/llvm/tools/llvm-rc/ResourceScriptStmt.h b/llvm/tools/llvm-rc/ResourceScriptStmt.h index a81e384fda365..84da9beb64be9 100644 --- a/llvm/tools/llvm-rc/ResourceScriptStmt.h +++ b/llvm/tools/llvm-rc/ResourceScriptStmt.h @@ -242,9 +242,9 @@ class RCResource { virtual raw_ostream &log(raw_ostream &OS) const { return OS << "Base statement\n"; }; - RCResource() {} + RCResource() = default; RCResource(uint16_t Flags) : MemoryFlags(Flags) {} - virtual ~RCResource() {} + virtual ~RCResource() = default; virtual Error visit(Visitor *) const { llvm_unreachable("This is unable to call methods from Visitor base"); @@ -290,7 +290,7 @@ class OptionalStmtList : public OptionalStmt { std::vector> Statements; public: - OptionalStmtList() {} + OptionalStmtList() = default; raw_ostream &log(raw_ostream &OS) const override; void addStmt(std::unique_ptr Stmt) { @@ -510,7 +510,7 @@ class MenuDefinition { virtual raw_ostream &log(raw_ostream &OS) const { return OS << "Base menu definition\n"; } - virtual ~MenuDefinition() {} + virtual ~MenuDefinition() = default; virtual uint16_t getResFlags() const { return 0; } virtual MenuDefKind getKind() const { return MkBase; } @@ -818,7 +818,7 @@ class VersionInfoStmt { enum StmtKind { StBase = 0, StBlock = 1, StValue = 2 }; virtual raw_ostream &log(raw_ostream &OS) const { return OS << "VI stmt\n"; } - virtual ~VersionInfoStmt() {} + virtual ~VersionInfoStmt() = default; virtual StmtKind getKind() const { return StBase; } static bool classof(const VersionInfoStmt *S) { diff --git a/llvm/tools/llvm-rc/ResourceVisitor.h b/llvm/tools/llvm-rc/ResourceVisitor.h index a121a0a507c27..1815c6b8a2f52 100644 --- a/llvm/tools/llvm-rc/ResourceVisitor.h +++ b/llvm/tools/llvm-rc/ResourceVisitor.h @@ -55,7 +55,7 @@ class Visitor { virtual Error visitVersionStmt(const VersionStmt *) = 0; virtual Error visitMenuStmt(const MenuStmt *) = 0; - virtual ~Visitor() {} + virtual ~Visitor() = default; }; } // namespace rc diff --git a/llvm/tools/llvm-readobj/ObjDumper.cpp b/llvm/tools/llvm-readobj/ObjDumper.cpp index 0b59dd48d4203..20e027aa5a5ef 100644 --- a/llvm/tools/llvm-readobj/ObjDumper.cpp +++ b/llvm/tools/llvm-readobj/ObjDumper.cpp @@ -41,7 +41,7 @@ ObjDumper::ObjDumper(ScopedPrinter &Writer, StringRef ObjName) : W(Writer) { }; } -ObjDumper::~ObjDumper() {} +ObjDumper::~ObjDumper() = default; void ObjDumper::reportUniqueWarning(Error Err) const { reportUniqueWarning(toString(std::move(Err))); diff --git a/llvm/tools/llvm-readtapi/DiffEngine.h b/llvm/tools/llvm-readtapi/DiffEngine.h index 7ab57d43e3af2..b350ceef5c6e0 100644 --- a/llvm/tools/llvm-readtapi/DiffEngine.h +++ b/llvm/tools/llvm-readtapi/DiffEngine.h @@ -39,7 +39,7 @@ enum DiffAttrKind { class AttributeDiff { public: AttributeDiff(DiffAttrKind Kind) : Kind(Kind){}; - virtual ~AttributeDiff(){}; + virtual ~AttributeDiff() = default; DiffAttrKind getKind() const { return Kind; } private: diff --git a/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp b/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp index 5c961998a4157..fab40b963731b 100644 --- a/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp +++ b/llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp @@ -84,7 +84,7 @@ class MockCallbacks : public TypeVisitorCallbacks { class RandomAccessVisitorTest : public testing::Test { public: - RandomAccessVisitorTest() {} + RandomAccessVisitorTest() = default; static void SetUpTestCase() { GlobalState = std::make_unique(); diff --git a/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp b/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp index b1f19e9e20891..62b75912814dd 100644 --- a/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp +++ b/llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp @@ -21,7 +21,7 @@ using namespace llvm::codeview; class TypeIndexIteratorTest : public testing::Test { public: - TypeIndexIteratorTest() {} + TypeIndexIteratorTest() = default; void SetUp() override { Refs.clear(); diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp index 2fe52600df923..aa5b2926ab55a 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp @@ -864,7 +864,7 @@ TEST_F(DebugLineBasicFixture, CallbackUsedForUnterminatedSequence) { } struct AdjustAddressFixtureBase : public CommonFixture { - virtual ~AdjustAddressFixtureBase() {} + virtual ~AdjustAddressFixtureBase() = default; // Create and update the prologue as specified by the subclass, then return // the length of the table. diff --git a/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestUtils.h b/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestUtils.h index f03c82f76c324..a2732e36a8a68 100644 --- a/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestUtils.h +++ b/llvm/unittests/ExecutionEngine/JITLink/JITLinkTestUtils.h @@ -19,7 +19,7 @@ class MockJITLinkMemoryManager : public llvm::jitlink::JITLinkMemoryManager { public: class Alloc { public: - virtual ~Alloc() {} + virtual ~Alloc() = default; }; class SimpleAlloc : public Alloc { diff --git a/llvm/unittests/MC/SystemZ/SystemZMCDisassemblerTest.cpp b/llvm/unittests/MC/SystemZ/SystemZMCDisassemblerTest.cpp index 87fad37635320..25c22d1b4ba73 100644 --- a/llvm/unittests/MC/SystemZ/SystemZMCDisassemblerTest.cpp +++ b/llvm/unittests/MC/SystemZ/SystemZMCDisassemblerTest.cpp @@ -61,7 +61,7 @@ Context &getContext() { class SystemZMCSymbolizerTest : public MCSymbolizer { public: SystemZMCSymbolizerTest(MCContext &MC) : MCSymbolizer(MC, nullptr) {} - ~SystemZMCSymbolizerTest() override {} + ~SystemZMCSymbolizerTest() override = default; bool tryAddingSymbolicOperand([[maybe_unused]] MCInst &Inst, [[maybe_unused]] raw_ostream &CStream, diff --git a/llvm/unittests/MC/X86/X86MCDisassemblerTest.cpp b/llvm/unittests/MC/X86/X86MCDisassemblerTest.cpp index 286528fdd21c3..6d44151b378b2 100644 --- a/llvm/unittests/MC/X86/X86MCDisassemblerTest.cpp +++ b/llvm/unittests/MC/X86/X86MCDisassemblerTest.cpp @@ -62,7 +62,7 @@ Context &getContext() { class X86MCSymbolizerTest : public MCSymbolizer { public: X86MCSymbolizerTest(MCContext &MC) : MCSymbolizer(MC, nullptr) {} - ~X86MCSymbolizerTest() override {} + ~X86MCSymbolizerTest() override = default; struct OpInfo { int64_t Value = 0; diff --git a/llvm/unittests/MIR/MachineMetadata.cpp b/llvm/unittests/MIR/MachineMetadata.cpp index 0f038d9dc2234..587551246c4f4 100644 --- a/llvm/unittests/MIR/MachineMetadata.cpp +++ b/llvm/unittests/MIR/MachineMetadata.cpp @@ -33,7 +33,7 @@ using namespace llvm; class MachineMetadataTest : public testing::Test { public: - MachineMetadataTest() {} + MachineMetadataTest() = default; protected: LLVMContext Context; diff --git a/llvm/unittests/MIR/MachineStableHashTest.cpp b/llvm/unittests/MIR/MachineStableHashTest.cpp index ea0de1a73da62..bedecb17df51f 100644 --- a/llvm/unittests/MIR/MachineStableHashTest.cpp +++ b/llvm/unittests/MIR/MachineStableHashTest.cpp @@ -22,7 +22,7 @@ using namespace llvm; class MachineStableHashTest : public testing::Test { public: - MachineStableHashTest() {} + MachineStableHashTest() = default; protected: LLVMContext Context; diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp index 305c28b4c7257..a5473f951492e 100644 --- a/llvm/utils/FileCheck/FileCheck.cpp +++ b/llvm/utils/FileCheck/FileCheck.cpp @@ -193,7 +193,7 @@ struct MarkerStyle { std::string Note; /// Does this marker indicate inclusion by -dump-input-filter=error? bool FiltersAsError; - MarkerStyle() {} + MarkerStyle() = default; MarkerStyle(char Lead, raw_ostream::Colors Color, const std::string &Note = "", bool FiltersAsError = false) : Lead(Lead), Color(Color), Note(Note), FiltersAsError(FiltersAsError) {