[llvm] Use "= default" (NFC) (#166088)

Identified with modernize-use-equals-default.
This commit is contained in:
Kazu Hirata 2025-11-02 17:16:47 -08:00 committed by GitHub
parent 902b0bd04a
commit 4eed68357e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
83 changed files with 101 additions and 108 deletions

View File

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

View File

@ -46,7 +46,7 @@ public:
HelloSubOptTable()
: GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable,
/*IgnoreCase=*/false, OptionSubCommands,
OptionSubCommandIDsTable) {}
OptionSubCommandIDsTable) = default;
};
} // namespace

View File

@ -60,11 +60,7 @@ public:
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));

View File

@ -81,7 +81,7 @@ public:
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);

View File

@ -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

View File

@ -36,7 +36,7 @@ size_t writeMachOStruct(MutableArrayRef<char> 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<char> Buf, size_t Offset,
bool SwapStruct) = 0;

View File

@ -29,7 +29,7 @@ namespace rt_bootstrap {
class LLVM_ABI ExecutorSharedMemoryMapperService final
: public ExecutorBootstrapService {
public:
~ExecutorSharedMemoryMapperService() override {};
~ExecutorSharedMemoryMapperService() override = default;
Expected<std::pair<ExecutorAddr, std::string>> reserve(uint64_t Size);
Expected<ExecutorAddr> initialize(ExecutorAddr Reservation,

View File

@ -2383,7 +2383,7 @@ public:
/// 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 @@ public:
bool HasNoWait = false;
// Constructors for TargetKernelArgs.
TargetKernelArgs() {}
TargetKernelArgs() = default;
TargetKernelArgs(unsigned NumTargetItems, TargetDataRTArgs RTArgs,
Value *NumIterations, ArrayRef<Value *> NumTeams,
ArrayRef<Value *> NumThreads, Value *DynCGGroupMem,
@ -2494,7 +2494,7 @@ public:
/// 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),

View File

@ -589,7 +589,7 @@ filterDbgVars(iterator_range<simple_ilist<DbgRecord>::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;

View File

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

View File

@ -111,17 +111,14 @@ public:
explicit TypedTrackingMDRef(T *MD) : Ref(static_cast<Metadata *>(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(); }

View File

@ -272,7 +272,7 @@ public:
friend class MCRegUnitRootIterator;
friend class MCRegAliasIterator;
virtual ~MCRegisterInfo() {}
virtual ~MCRegisterInfo() = default;
/// Initialize MCRegisterInfo, called by TableGen
/// auto-generated routines. *DO NOT USE*.

View File

@ -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

View File

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

View File

@ -24,7 +24,7 @@ struct DXContainerConfig;
class MultiFormatConfig {
public:
virtual ~MultiFormatConfig() {}
virtual ~MultiFormatConfig() = default;
virtual const CommonConfig &getCommonConfig() const = 0;
virtual Expected<const ELFConfig &> getELFConfig() const = 0;

View File

@ -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<size_t> IndexInSignature;
RootParameterLocationYaml(){};
RootParameterLocationYaml() = default;
explicit RootParameterLocationYaml(RootParameterHeaderYaml Header)
: Header(Header) {}
};

View File

@ -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.

View File

@ -56,7 +56,7 @@ public:
"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

View File

@ -28,7 +28,7 @@ using MacroOffset2UnitMapTy = DenseMap<uint64_t, DwarfUnit *>;
/// 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),

View File

@ -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.

View File

@ -27,7 +27,7 @@
namespace llvm {
namespace orc {
MemoryMapper::~MemoryMapper() {}
MemoryMapper::~MemoryMapper() = default;
InProcessMemoryMapper::InProcessMemoryMapper(size_t PageSize)
: PageSize(PageSize) {}

View File

@ -520,7 +520,7 @@ GOFFObjectWriter::GOFFObjectWriter(
std::unique_ptr<MCGOFFObjectTargetWriter> 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();

View File

@ -16,7 +16,7 @@
using namespace llvm;
MCDXContainerTargetWriter::~MCDXContainerTargetWriter() {}
MCDXContainerTargetWriter::~MCDXContainerTargetWriter() = default;
uint64_t DXContainerObjectWriter::writeObject() {
auto &Asm = *this->Asm;

View File

@ -20,7 +20,7 @@
using namespace llvm;
MCGOFFStreamer::~MCGOFFStreamer() {}
MCGOFFStreamer::~MCGOFFStreamer() = default;
GOFFObjectWriter &MCGOFFStreamer::getWriter() {
return static_cast<GOFFObjectWriter &>(getAssembler().getWriter());

View File

@ -50,7 +50,7 @@ class COFFWriter {
Expected<uint32_t> virtualAddressToFileAddress(uint32_t RVA);
public:
virtual ~COFFWriter() {}
virtual ~COFFWriter() = default;
Error write();
COFFWriter(Object &Obj, raw_ostream &Out)

View File

@ -134,7 +134,7 @@ private:
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 @@ public:
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 @@ private:
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 @@ private:
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 @@ private:
SymbolTableSection *Symbols = nullptr;
public:
~SectionIndexSection() override {}
~SectionIndexSection() override = default;
void addIndex(uint32_t Index) {
assert(Size > 0);
Indexes.push_back(Index);

View File

@ -23,7 +23,7 @@ namespace macho {
// raw binaries and regular MachO object files.
class Reader {
public:
virtual ~Reader(){};
virtual ~Reader() = default;
virtual Expected<std::unique_ptr<Object>> create() const = 0;
};

View File

@ -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();

View File

@ -15,7 +15,7 @@
namespace llvm {
namespace GOFFYAML {
Object::Object() {}
Object::Object() = default;
} // namespace GOFFYAML

View File

@ -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<IRDataT<EmptyData>>::registerRequiredCallbacks(PIC);
}
TimeProfilingPassesHandler::TimeProfilingPassesHandler() {}
TimeProfilingPassesHandler::TimeProfilingPassesHandler() = default;
void TimeProfilingPassesHandler::registerCallbacks(
PassInstrumentationCallbacks &PIC) {

View File

@ -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

View File

@ -69,7 +69,7 @@ FunctionPass *createAMDGPUPreloadKernArgPrologLegacyPass();
ModulePass *createAMDGPUPreloadKernelArgumentsLegacyPass(const TargetMachine *);
struct AMDGPUSimplifyLibCallsPass : PassInfoMixin<AMDGPUSimplifyLibCallsPass> {
AMDGPUSimplifyLibCallsPass() {}
AMDGPUSimplifyLibCallsPass() = default;
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
@ -371,13 +371,13 @@ public:
class AMDGPUAnnotateUniformValuesPass
: public PassInfoMixin<AMDGPUAnnotateUniformValuesPass> {
public:
AMDGPUAnnotateUniformValuesPass() {}
AMDGPUAnnotateUniformValuesPass() = default;
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
class SIModeRegisterPass : public PassInfoMixin<SIModeRegisterPass> {
public:
SIModeRegisterPass() {}
SIModeRegisterPass() = default;
PreservedAnalyses run(MachineFunction &F, MachineFunctionAnalysisManager &AM);
};

View File

@ -96,7 +96,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const ArgDescriptor &Arg) {
}
struct KernArgPreloadDescriptor : public ArgDescriptor {
KernArgPreloadDescriptor() {}
KernArgPreloadDescriptor() = default;
SmallVector<MCRegister> Regs;
};

View File

@ -48,7 +48,7 @@ private:
FuncInfoMap FIM;
public:
AMDGPUPerfHintAnalysis() {}
AMDGPUPerfHintAnalysis() = default;
// OldPM
bool runOnSCC(const GCNTargetMachine &TM, CallGraphSCC &SCC);

View File

@ -202,7 +202,7 @@ bool PredicateMapping::match(const MachineInstr &MI,
return true;
}
SetOfRulesForOpcode::SetOfRulesForOpcode() {}
SetOfRulesForOpcode::SetOfRulesForOpcode() = default;
SetOfRulesForOpcode::SetOfRulesForOpcode(FastRulesTypes FastTypes)
: FastTypes(FastTypes) {}

View File

@ -54,7 +54,7 @@ public:
bool CullSGPRHazardsAtMemWait;
unsigned CullSGPRHazardsMemWaitThreshold;
AMDGPUWaitSGPRHazards() {}
AMDGPUWaitSGPRHazards() = default;
// Return the numeric ID 0-127 for a given SGPR.
static std::optional<unsigned> sgprNumber(Register Reg,

View File

@ -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

View File

@ -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) {

View File

@ -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,

View File

@ -38,7 +38,7 @@ public:
LoongArchMCCodeEmitter(MCContext &ctx, MCInstrInfo const &MCII)
: Ctx(ctx), MCII(MCII) {}
~LoongArchMCCodeEmitter() override {}
~LoongArchMCCodeEmitter() override = default;
void encodeInstruction(const MCInst &MI, SmallVectorImpl<char> &CB,
SmallVectorImpl<MCFixup> &Fixups,

View File

@ -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.

View File

@ -48,7 +48,7 @@ class VXRMInfo {
} State = Uninitialized;
public:
VXRMInfo() {}
VXRMInfo() = default;
static VXRMInfo getUnknown() {
VXRMInfo Info;

View File

@ -15,4 +15,4 @@
using namespace llvm;
SPIRVTargetStreamer::SPIRVTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
SPIRVTargetStreamer::~SPIRVTargetStreamer() {}
SPIRVTargetStreamer::~SPIRVTargetStreamer() = default;

View File

@ -81,7 +81,7 @@ private:
void initAvailableCapabilitiesForVulkan(const SPIRVSubtarget &ST);
public:
RequirementHandler() {}
RequirementHandler() = default;
void clear() {
MinimalCaps.clear();
AllCaps.clear();

View File

@ -69,7 +69,7 @@ static Reloc::Model getEffectiveRelocModel(std::optional<Reloc::Model> 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,

View File

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

View File

@ -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 &) {}

View File

@ -32,7 +32,7 @@ template <typename ElTy> 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

View File

@ -105,7 +105,7 @@ public:
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

View File

@ -110,7 +110,7 @@ public:
std::string Filename;
TimestampTy Timestamp;
KeyTy() {}
KeyTy() = default;
KeyTy(StringRef Filename, TimestampTy Timestamp)
: Filename(Filename.str()), Timestamp(Timestamp) {}
};

View File

@ -305,7 +305,7 @@ public:
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();

View File

@ -37,7 +37,7 @@ protected:
: Coverage(CoverageMapping), Options(Options), OS(OS) {}
public:
virtual ~CoverageExporter(){};
virtual ~CoverageExporter() = default;
/// Render the CoverageMapping object.
virtual void renderRoot(const CoverageFilters &IgnoreFilters) = 0;

View File

@ -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,

View File

@ -122,7 +122,7 @@ public:
static std::unique_ptr<CoveragePrinter>
create(const CoverageViewOptions &Opts);
virtual ~CoveragePrinter() {}
virtual ~CoveragePrinter() = default;
/// @name File Creation Interface
/// @{
@ -288,7 +288,7 @@ public:
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;

View File

@ -49,7 +49,7 @@ class StringRef;
virtual void logd(const DiffLogBuilder &Log) = 0;
protected:
virtual ~Consumer() {}
virtual ~Consumer() = default;
};
class DiffConsumer : public Consumer {

View File

@ -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)

View File

@ -877,7 +877,7 @@ Error BenchmarkRunner::getValidationCountersToRun(
return Error::success();
}
BenchmarkRunner::FunctionExecutor::~FunctionExecutor() {}
BenchmarkRunner::FunctionExecutor::~FunctionExecutor() = default;
} // namespace exegesis
} // namespace llvm

View File

@ -81,7 +81,7 @@ private:
struct PerfCounterNotFullyEnabled
: public ErrorInfo<PerfCounterNotFullyEnabled> {
static char ID;
PerfCounterNotFullyEnabled() {}
PerfCounterNotFullyEnabled() = default;
void log(raw_ostream &OS) const override;

View File

@ -131,7 +131,7 @@ private:
} // namespace
SnippetRepetitor::~SnippetRepetitor() {}
SnippetRepetitor::~SnippetRepetitor() = default;
std::unique_ptr<const SnippetRepetitor>
SnippetRepetitor::Create(Benchmark::RepetitionModeE Mode,

View File

@ -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 {

View File

@ -18,7 +18,7 @@ public:
explicit DependencyInfo(std::string DependencyInfoPath)
: DependencyInfoPath(DependencyInfoPath) {}
virtual ~DependencyInfo(){};
virtual ~DependencyInfo() = default;
virtual void addMissingInput(llvm::StringRef Path) {
NotFounds.insert(Path.str());

View File

@ -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<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions(
const std::unique_ptr<MCInstPrinter> &IP, bool SkipFailures) {

View File

@ -151,7 +151,7 @@ protected:
bool SkipFailures) = 0;
public:
CodeRegionGenerator() {}
CodeRegionGenerator() = default;
virtual ~CodeRegionGenerator();
};

View File

@ -34,7 +34,7 @@ public:
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;

View File

@ -84,7 +84,7 @@ protected:
public:
Dumper(const object::ObjectFile &O);
virtual ~Dumper() {}
virtual ~Dumper() = default;
void reportUniqueWarning(Error Err);
void reportUniqueWarning(const Twine &Msg);

View File

@ -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(); }

View File

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

View File

@ -17,7 +17,7 @@ namespace pdb {
class OutputStyle {
public:
virtual ~OutputStyle() {}
virtual ~OutputStyle() = default;
virtual Error dump() = 0;
};

View File

@ -35,7 +35,7 @@ enum class StreamPurpose {
struct StreamInfo {
public:
StreamInfo() {}
StreamInfo() = default;
uint32_t getModuleIndex() const { return *ModuleIndex; }
StreamPurpose getPurpose() const { return Purpose; }

View File

@ -187,7 +187,7 @@ ProfiledBinary::ProfiledBinary(const StringRef ExeBinPath,
load();
}
ProfiledBinary::~ProfiledBinary() {}
ProfiledBinary::~ProfiledBinary() = default;
void ProfiledBinary::warnNoFuncEntry() {
uint64_t NoFuncEntryNum = 0;

View File

@ -242,9 +242,9 @@ public:
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<std::unique_ptr<OptionalStmt>> Statements;
public:
OptionalStmtList() {}
OptionalStmtList() = default;
raw_ostream &log(raw_ostream &OS) const override;
void addStmt(std::unique_ptr<OptionalStmt> Stmt) {
@ -510,7 +510,7 @@ public:
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 @@ public:
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) {

View File

@ -55,7 +55,7 @@ public:
virtual Error visitVersionStmt(const VersionStmt *) = 0;
virtual Error visitMenuStmt(const MenuStmt *) = 0;
virtual ~Visitor() {}
virtual ~Visitor() = default;
};
} // namespace rc

View File

@ -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)));

View File

@ -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:

View File

@ -84,7 +84,7 @@ public:
class RandomAccessVisitorTest : public testing::Test {
public:
RandomAccessVisitorTest() {}
RandomAccessVisitorTest() = default;
static void SetUpTestCase() {
GlobalState = std::make_unique<GlobalTestState>();

View File

@ -21,7 +21,7 @@ using namespace llvm::codeview;
class TypeIndexIteratorTest : public testing::Test {
public:
TypeIndexIteratorTest() {}
TypeIndexIteratorTest() = default;
void SetUp() override {
Refs.clear();

View File

@ -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.

View File

@ -19,7 +19,7 @@ class MockJITLinkMemoryManager : public llvm::jitlink::JITLinkMemoryManager {
public:
class Alloc {
public:
virtual ~Alloc() {}
virtual ~Alloc() = default;
};
class SimpleAlloc : public Alloc {

View File

@ -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,

View File

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

View File

@ -33,7 +33,7 @@ using namespace llvm;
class MachineMetadataTest : public testing::Test {
public:
MachineMetadataTest() {}
MachineMetadataTest() = default;
protected:
LLVMContext Context;

View File

@ -22,7 +22,7 @@ using namespace llvm;
class MachineStableHashTest : public testing::Test {
public:
MachineStableHashTest() {}
MachineStableHashTest() = default;
protected:
LLVMContext Context;

View File

@ -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) {