[llvm] b518859 - [llvm] Remove redundaunt virtual specifiers (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 24 21:50:43 PDT 2022
Author: Kazu Hirata
Date: 2022-07-24T21:50:35-07:00
New Revision: b5188591a06b5814860622ec04d199d83deb40f8
URL: https://github.com/llvm/llvm-project/commit/b5188591a06b5814860622ec04d199d83deb40f8
DIFF: https://github.com/llvm/llvm-project/commit/b5188591a06b5814860622ec04d199d83deb40f8.diff
LOG: [llvm] Remove redundaunt virtual specifiers (NFC)
Identified with modernize-use-override.
Added:
Modified:
llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
llvm/include/llvm/Passes/StandardInstrumentations.h
llvm/include/llvm/ProfileData/SampleProfReader.h
llvm/include/llvm/ProfileData/SampleProfWriter.h
llvm/include/llvm/Support/BinaryByteStream.h
llvm/include/llvm/Support/Error.h
llvm/include/llvm/Support/raw_ostream.h
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/CodeGen/AsmPrinter/WasmException.h
llvm/lib/CodeGen/ProcessImplicitDefs.cpp
llvm/lib/MC/XCOFFObjectWriter.cpp
llvm/lib/ObjCopy/ELF/ELFObject.h
llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h
llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
llvm/lib/Target/AMDGPU/R600ISelLowering.h
llvm/lib/Target/AMDGPU/SIISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfo.h
llvm/lib/Target/RISCV/RISCVTargetMachine.h
llvm/lib/Target/X86/X86ISelLowering.h
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/lib/Transforms/IPO/SCCP.cpp
llvm/tools/dsymutil/DwarfLinkerForBinary.h
llvm/tools/dsymutil/Reproducer.h
llvm/tools/llvm-mca/CodeRegionGenerator.cpp
llvm/tools/llvm-profgen/PerfReader.h
llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
index dd213bf68e62c..87dae64c5f902 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
@@ -39,14 +39,14 @@ class UniqueMachineInstr : public FoldingSetNode {
class CSEConfigFull : public CSEConfigBase {
public:
virtual ~CSEConfigFull() = default;
- virtual bool shouldCSEOpc(unsigned Opc) override;
+ bool shouldCSEOpc(unsigned Opc) override;
};
// Commonly used for O0 config.
class CSEConfigConstantOnly : public CSEConfigBase {
public:
virtual ~CSEConfigConstantOnly() = default;
- virtual bool shouldCSEOpc(unsigned Opc) override;
+ bool shouldCSEOpc(unsigned Opc) override;
};
// Returns the standard expected CSEConfig for the given optimization level.
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
index f7fafdc57401a..e40f004338703 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
@@ -590,7 +590,7 @@ class IRTranslator : public MachineFunctionPass {
assert(irt && "irt is null!");
}
- virtual void addSuccessorWithProb(
+ void addSuccessorWithProb(
MachineBasicBlock *Src, MachineBasicBlock *Dst,
BranchProbability Prob = BranchProbability::getUnknown()) override {
IRT->addSuccessorWithProb(Src, Dst, Prob);
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
index 6cd5c8d1d668f..93525b7167915 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
@@ -32,15 +32,12 @@ template <typename ChildType> class IPDBEnumChildren {
template <typename ChildType>
class NullEnumerator : public IPDBEnumChildren<ChildType> {
- virtual uint32_t getChildCount() const override { return 0; }
- virtual std::unique_ptr<ChildType>
- getChildAtIndex(uint32_t Index) const override {
+ uint32_t getChildCount() const override { return 0; }
+ std::unique_ptr<ChildType> getChildAtIndex(uint32_t Index) const override {
return nullptr;
}
- virtual std::unique_ptr<ChildType> getNext() override {
- return nullptr;
- }
- virtual void reset() override {}
+ std::unique_ptr<ChildType> getNext() override { return nullptr; }
+ void reset() override {}
};
} // end namespace pdb
diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 30287cde5de70..b4d2178f57248 100644
--- a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -381,13 +381,13 @@ class InLineChangePrinter : public TextChangeReporter<IRDataT<EmptyData>> {
protected:
// Create a representation of the IR.
- virtual void generateIRRepresentation(Any IR, StringRef PassID,
- IRDataT<EmptyData> &Output) override;
+ void generateIRRepresentation(Any IR, StringRef PassID,
+ IRDataT<EmptyData> &Output) override;
// Called when an interesting IR has changed.
- virtual void handleAfter(StringRef PassID, std::string &Name,
- const IRDataT<EmptyData> &Before,
- const IRDataT<EmptyData> &After, Any) override;
+ void handleAfter(StringRef PassID, std::string &Name,
+ const IRDataT<EmptyData> &Before,
+ const IRDataT<EmptyData> &After, Any) override;
void handleFunctionCompare(StringRef Name, StringRef Prefix, StringRef PassID,
StringRef Divider, bool InModule, unsigned Minor,
diff --git a/llvm/include/llvm/ProfileData/SampleProfReader.h b/llvm/include/llvm/ProfileData/SampleProfReader.h
index 7da336b9f61bf..b96d6c70dae44 100644
--- a/llvm/include/llvm/ProfileData/SampleProfReader.h
+++ b/llvm/include/llvm/ProfileData/SampleProfReader.h
@@ -585,14 +585,14 @@ class SampleProfileReaderBinary : public SampleProfileReader {
: SampleProfileReader(std::move(B), C, Format) {}
/// Read and validate the file header.
- virtual std::error_code readHeader() override;
+ std::error_code readHeader() override;
/// Read sample profiles from the associated file.
std::error_code readImpl() override;
/// It includes all the names that have samples either in outline instance
/// or inline instance.
- virtual std::vector<StringRef> *getNameTable() override { return &NameTable; }
+ std::vector<StringRef> *getNameTable() override { return &NameTable; }
protected:
/// Read a numeric value of type T from the profile.
@@ -656,7 +656,7 @@ class SampleProfileReaderBinary : public SampleProfileReader {
class SampleProfileReaderRawBinary : public SampleProfileReaderBinary {
private:
- virtual std::error_code verifySPMagic(uint64_t Magic) override;
+ std::error_code verifySPMagic(uint64_t Magic) override;
public:
SampleProfileReaderRawBinary(std::unique_ptr<MemoryBuffer> B, LLVMContext &C,
@@ -710,14 +710,14 @@ class SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
std::error_code readCSNameTableSec();
std::error_code readProfileSymbolList();
- virtual std::error_code readHeader() override;
- virtual std::error_code verifySPMagic(uint64_t Magic) override = 0;
+ std::error_code readHeader() override;
+ std::error_code verifySPMagic(uint64_t Magic) override = 0;
virtual std::error_code readOneSection(const uint8_t *Start, uint64_t Size,
const SecHdrTableEntry &Entry);
// placeholder for subclasses to dispatch their own section readers.
virtual std::error_code readCustomSection(const SecHdrTableEntry &Entry) = 0;
- virtual ErrorOr<StringRef> readStringFromTable() override;
- virtual ErrorOr<SampleContext> readSampleContextFromTable() override;
+ ErrorOr<StringRef> readStringFromTable() override;
+ ErrorOr<SampleContext> readSampleContextFromTable() override;
ErrorOr<SampleContextFrames> readContextFromTable();
std::unique_ptr<ProfileSymbolList> ProfSymList;
@@ -770,27 +770,26 @@ class SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
uint64_t getSectionSize(SecType Type);
/// Get the total size of header and all sections.
uint64_t getFileSize();
- virtual bool dumpSectionInfo(raw_ostream &OS = dbgs()) override;
+ bool dumpSectionInfo(raw_ostream &OS = dbgs()) override;
/// Collect functions with definitions in Module M. Return true if
/// the reader has been given a module.
bool collectFuncsFromModule() override;
/// Return whether names in the profile are all MD5 numbers.
- virtual bool useMD5() override { return MD5StringBuf.get(); }
+ bool useMD5() override { return MD5StringBuf.get(); }
- virtual std::unique_ptr<ProfileSymbolList> getProfileSymbolList() override {
+ std::unique_ptr<ProfileSymbolList> getProfileSymbolList() override {
return std::move(ProfSymList);
};
- virtual void setSkipFlatProf(bool Skip) override { SkipFlatProf = Skip; }
+ void setSkipFlatProf(bool Skip) override { SkipFlatProf = Skip; }
};
class SampleProfileReaderExtBinary : public SampleProfileReaderExtBinaryBase {
private:
- virtual std::error_code verifySPMagic(uint64_t Magic) override;
- virtual std::error_code
- readCustomSection(const SecHdrTableEntry &Entry) override {
+ std::error_code verifySPMagic(uint64_t Magic) override;
+ std::error_code readCustomSection(const SecHdrTableEntry &Entry) override {
// Update the data reader pointer to the end of the section.
Data = End;
return sampleprof_error::success;
@@ -814,11 +813,11 @@ class SampleProfileReaderCompactBinary : public SampleProfileReaderBinary {
DenseMap<StringRef, uint64_t> FuncOffsetTable;
/// The set containing the functions to use when compiling a module.
DenseSet<StringRef> FuncsToUse;
- virtual std::error_code verifySPMagic(uint64_t Magic) override;
- virtual std::error_code readNameTable() override;
+ std::error_code verifySPMagic(uint64_t Magic) override;
+ std::error_code readNameTable() override;
/// Read a string indirectly via the name table.
- virtual ErrorOr<StringRef> readStringFromTable() override;
- virtual std::error_code readHeader() override;
+ ErrorOr<StringRef> readStringFromTable() override;
+ std::error_code readHeader() override;
std::error_code readFuncOffsetTable();
public:
@@ -837,7 +836,7 @@ class SampleProfileReaderCompactBinary : public SampleProfileReaderBinary {
bool collectFuncsFromModule() override;
/// Return whether names in the profile are all MD5 numbers.
- virtual bool useMD5() override { return true; }
+ bool useMD5() override { return true; }
};
using InlineCallStack = SmallVector<FunctionSamples *, 10>;
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h
index aa7f1cbdd7e88..b1ed0335e9c93 100644
--- a/llvm/include/llvm/ProfileData/SampleProfWriter.h
+++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h
@@ -122,14 +122,13 @@ class SampleProfileWriterBinary : public SampleProfileWriter {
SampleProfileWriterBinary(std::unique_ptr<raw_ostream> &OS)
: SampleProfileWriter(OS) {}
- virtual std::error_code writeSample(const FunctionSamples &S) override;
+ std::error_code writeSample(const FunctionSamples &S) override;
protected:
virtual MapVector<StringRef, uint32_t> &getNameTable() { return NameTable; }
virtual std::error_code writeMagicIdent(SampleProfileFormat Format);
virtual std::error_code writeNameTable();
- virtual std::error_code
- writeHeader(const SampleProfileMap &ProfileMap) override;
+ std::error_code writeHeader(const SampleProfileMap &ProfileMap) override;
std::error_code writeSummary();
virtual std::error_code writeContextIdx(const SampleContext &Context);
std::error_code writeNameIdx(StringRef FName);
@@ -187,14 +186,14 @@ const std::array<SmallVector<SecHdrTableEntry, 8>, NumOfLayout>
class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
using SampleProfileWriterBinary::SampleProfileWriterBinary;
public:
- virtual std::error_code write(const SampleProfileMap &ProfileMap) override;
+ std::error_code write(const SampleProfileMap &ProfileMap) override;
- virtual void setToCompressAllSections() override;
+ void setToCompressAllSections() override;
void setToCompressSection(SecType Type);
- virtual std::error_code writeSample(const FunctionSamples &S) override;
+ std::error_code writeSample(const FunctionSamples &S) override;
// Set to use MD5 to represent string in NameTable.
- virtual void setUseMD5() override {
+ void setUseMD5() override {
UseMD5 = true;
addSectionFlag(SecNameTable, SecNameTableFlags::SecFlagMD5Name);
// MD5 will be stored as plain uint64_t instead of variable-length
@@ -205,15 +204,15 @@ class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
// Set the profile to be partial. It means the profile is for
// common/shared code. The common profile is usually merged from
// profiles collected from running other targets.
- virtual void setPartialProfile() override {
+ void setPartialProfile() override {
addSectionFlag(SecProfSummary, SecProfSummaryFlags::SecFlagPartial);
}
- virtual void setProfileSymbolList(ProfileSymbolList *PSL) override {
+ void setProfileSymbolList(ProfileSymbolList *PSL) override {
ProfSymList = PSL;
};
- virtual void resetSecLayout(SectionLayout SL) override {
+ void resetSecLayout(SectionLayout SL) override {
verifySecLayout(SL);
#ifndef NDEBUG
// Make sure resetSecLayout is called before any flag setting.
@@ -242,7 +241,7 @@ class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
addSecFlag(SectionHdrLayout[SectionIdx], Flag);
}
- virtual void addContext(const SampleContext &Context) override;
+ void addContext(const SampleContext &Context) override;
// placeholder for subclasses to dispatch their own section writers.
virtual std::error_code writeCustomSection(SecType Type) = 0;
@@ -258,9 +257,8 @@ class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
const SampleProfileMap &ProfileMap);
// Helper function to write name table.
- virtual std::error_code writeNameTable() override;
- virtual std::error_code
- writeContextIdx(const SampleContext &Context) override;
+ std::error_code writeNameTable() override;
+ std::error_code writeContextIdx(const SampleContext &Context) override;
std::error_code writeCSNameIdx(const SampleContext &Context);
std::error_code writeCSNameTableSection();
@@ -288,8 +286,7 @@ class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
private:
void allocSecHdrTable();
std::error_code writeSecHdrTable();
- virtual std::error_code
- writeHeader(const SampleProfileMap &ProfileMap) override;
+ std::error_code writeHeader(const SampleProfileMap &ProfileMap) override;
std::error_code compressAndOutput();
// We will swap the raw_ostream held by LocalBufStream and that
@@ -334,14 +331,13 @@ class SampleProfileWriterExtBinary : public SampleProfileWriterExtBinaryBase {
std::error_code writeDefaultLayout(const SampleProfileMap &ProfileMap);
std::error_code writeCtxSplitLayout(const SampleProfileMap &ProfileMap);
- virtual std::error_code
- writeSections(const SampleProfileMap &ProfileMap) override;
+ std::error_code writeSections(const SampleProfileMap &ProfileMap) override;
- virtual std::error_code writeCustomSection(SecType Type) override {
+ std::error_code writeCustomSection(SecType Type) override {
return sampleprof_error::success;
};
- virtual void verifySecLayout(SectionLayout SL) override {
+ void verifySecLayout(SectionLayout SL) override {
assert((SL == DefaultLayout || SL == CtxSplitLayout) &&
"Unsupported layout");
}
@@ -381,8 +377,8 @@ class SampleProfileWriterCompactBinary : public SampleProfileWriterBinary {
using SampleProfileWriterBinary::SampleProfileWriterBinary;
public:
- virtual std::error_code writeSample(const FunctionSamples &S) override;
- virtual std::error_code write(const SampleProfileMap &ProfileMap) override;
+ std::error_code writeSample(const FunctionSamples &S) override;
+ std::error_code write(const SampleProfileMap &ProfileMap) override;
protected:
/// The table mapping from function name to the offset of its FunctionSample
@@ -391,9 +387,8 @@ class SampleProfileWriterCompactBinary : public SampleProfileWriterBinary {
/// The offset of the slot to be filled with the offset of FuncOffsetTable
/// towards profile start.
uint64_t TableOffset;
- virtual std::error_code writeNameTable() override;
- virtual std::error_code
- writeHeader(const SampleProfileMap &ProfileMap) override;
+ std::error_code writeNameTable() override;
+ std::error_code writeHeader(const SampleProfileMap &ProfileMap) override;
std::error_code writeFuncOffsetTable();
};
diff --git a/llvm/include/llvm/Support/BinaryByteStream.h b/llvm/include/llvm/Support/BinaryByteStream.h
index dc4adba26f160..9dc09b4e97f78 100644
--- a/llvm/include/llvm/Support/BinaryByteStream.h
+++ b/llvm/include/llvm/Support/BinaryByteStream.h
@@ -192,9 +192,7 @@ class AppendingBinaryByteStream : public WritableBinaryStream {
Error commit() override { return Error::success(); }
/// Return the properties of this stream.
- virtual BinaryStreamFlags getFlags() const override {
- return BSF_Write | BSF_Append;
- }
+ BinaryStreamFlags getFlags() const override { return BSF_Write | BSF_Append; }
MutableArrayRef<uint8_t> data() { return Data; }
};
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h
index 3c2c2c8b8ceb5..f2d3388a328f4 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -1141,7 +1141,7 @@ class ExpectedAsOutParameter {
class ECError : public ErrorInfo<ECError> {
friend Error errorCodeToError(std::error_code);
- virtual void anchor() override;
+ void anchor() override;
public:
void setErrorCode(std::error_code EC) { this->EC = EC; }
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index 58adb41cb0ef6..f025cde4a16bc 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -710,7 +710,7 @@ class buffer_ostream : public raw_svector_ostream {
raw_ostream &OS;
SmallVector<char, 0> Buffer;
- virtual void anchor() override;
+ void anchor() override;
public:
buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
@@ -721,7 +721,7 @@ class buffer_unique_ostream : public raw_svector_ostream {
std::unique_ptr<raw_ostream> OS;
SmallVector<char, 0> Buffer;
- virtual void anchor() override;
+ void anchor() override;
public:
buffer_unique_ostream(std::unique_ptr<raw_ostream> OS)
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 8466f5612d99d..794e85f877bea 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -2837,7 +2837,7 @@ struct IRAttribute : public BaseType {
IRAttribute(const IRPosition &IRP) : BaseType(IRP) {}
/// See AbstractAttribute::initialize(...).
- virtual void initialize(Attributor &A) override {
+ void initialize(Attributor &A) override {
const IRPosition &IRP = this->getIRPosition();
if (isa<UndefValue>(IRP.getAssociatedValue()) ||
this->hasAttr(getAttrKind(), /* IgnoreSubsumingPositions */ false,
diff --git a/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h b/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
index 8dc0f1e26a928..56cc15658675f 100644
--- a/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
+++ b/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
@@ -102,9 +102,9 @@ struct AutoInitRemark : public MemoryOpRemark {
static bool canHandle(const Instruction *I);
protected:
- virtual std::string explainSource(StringRef Type) const override;
- virtual StringRef remarkName(RemarkKind RK) const override;
- virtual DiagnosticKind diagnosticKind() const override {
+ std::string explainSource(StringRef Type) const override;
+ StringRef remarkName(RemarkKind RK) const override;
+ DiagnosticKind diagnosticKind() const override {
return DK_OptimizationRemarkMissed;
}
};
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 9f8a5e472f01a..8192ed56caf09 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -185,8 +185,8 @@ class InlineCostAnnotationWriter : public AssemblyAnnotationWriter {
public:
InlineCostAnnotationWriter(InlineCostCallAnalyzer *ICCA) : ICCA(ICCA) {}
- virtual void emitInstructionAnnot(const Instruction *I,
- formatted_raw_ostream &OS) override;
+ void emitInstructionAnnot(const Instruction *I,
+ formatted_raw_ostream &OS) override;
};
/// Carry out call site analysis, in order to evaluate inlinability.
diff --git a/llvm/lib/CodeGen/AsmPrinter/WasmException.h b/llvm/lib/CodeGen/AsmPrinter/WasmException.h
index 2abbe37cb6d9a..419b569d123ca 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WasmException.h
+++ b/llvm/lib/CodeGen/AsmPrinter/WasmException.h
@@ -28,7 +28,7 @@ class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
void endModule() override;
void beginFunction(const MachineFunction *MF) override {}
- virtual void markFunctionEnd() override;
+ void markFunctionEnd() override;
void endFunction(const MachineFunction *MF) override;
protected:
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
index 7327f9e52efc3..54bb4a31ef491 100644
--- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
@@ -47,7 +47,7 @@ class ProcessImplicitDefs : public MachineFunctionPass {
bool runOnMachineFunction(MachineFunction &MF) override;
- virtual MachineFunctionProperties getRequiredProperties() const override {
+ MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA);
}
diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp
index d46ae2247535d..8a43a477c1c72 100644
--- a/llvm/lib/MC/XCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -253,7 +253,7 @@ class XCOFFObjectWriter : public MCObjectWriter {
CsectGroup &getCsectGroup(const MCSectionXCOFF *MCSec);
- virtual void reset() override;
+ void reset() override;
void executePostLayoutBinding(MCAssembler &, const MCAsmLayout &) override;
diff --git a/llvm/lib/ObjCopy/ELF/ELFObject.h b/llvm/lib/ObjCopy/ELF/ELFObject.h
index 799db5034532e..2c3ea3a5f6d6a 100644
--- a/llvm/lib/ObjCopy/ELF/ELFObject.h
+++ b/llvm/lib/ObjCopy/ELF/ELFObject.h
@@ -115,13 +115,13 @@ class SectionWriter : public SectionVisitor {
Error visit(const OwnedDataSection &Sec) override;
Error visit(const StringTableSection &Sec) override;
Error visit(const DynamicRelocationSection &Sec) override;
- virtual Error visit(const SymbolTableSection &Sec) override = 0;
- virtual Error visit(const RelocationSection &Sec) override = 0;
- virtual Error visit(const GnuDebugLinkSection &Sec) override = 0;
- virtual Error visit(const GroupSection &Sec) override = 0;
- virtual Error visit(const SectionIndexSection &Sec) override = 0;
- virtual Error visit(const CompressedSection &Sec) override = 0;
- virtual Error visit(const DecompressedSection &Sec) override = 0;
+ Error visit(const SymbolTableSection &Sec) override = 0;
+ Error visit(const RelocationSection &Sec) override = 0;
+ Error visit(const GnuDebugLinkSection &Sec) override = 0;
+ Error visit(const GroupSection &Sec) override = 0;
+ Error visit(const SectionIndexSection &Sec) override = 0;
+ Error visit(const CompressedSection &Sec) override = 0;
+ Error visit(const DecompressedSection &Sec) override = 0;
explicit SectionWriter(WritableMemoryBuffer &Buf) : Out(Buf) {}
};
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
index 04bc91318da85..d655caa80ba82 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
@@ -66,8 +66,8 @@ class AArch64O0PreLegalizerCombinerInfo : public CombinerInfo {
report_fatal_error("Invalid rule identifier");
}
- virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
- MachineIRBuilder &B) const override;
+ bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
+ MachineIRBuilder &B) const override;
};
bool AArch64O0PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
index ba206bac68d10..dfb531cda7e98 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
@@ -355,8 +355,8 @@ class AArch64PostLegalizerCombinerInfo : public CombinerInfo {
report_fatal_error("Invalid rule identifier");
}
- virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
- MachineIRBuilder &B) const override;
+ bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
+ MachineIRBuilder &B) const override;
};
bool AArch64PostLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
index d7959a82c484d..eab1de94e9c8f 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
@@ -997,8 +997,8 @@ class AArch64PostLegalizerLoweringInfo : public CombinerInfo {
report_fatal_error("Invalid rule identifier");
}
- virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
- MachineIRBuilder &B) const override;
+ bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
+ MachineIRBuilder &B) const override;
};
bool AArch64PostLegalizerLoweringInfo::combine(GISelChangeObserver &Observer,
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
index 275949c5ee642..50bae68b4d33a 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
@@ -370,8 +370,8 @@ class AArch64PreLegalizerCombinerInfo : public CombinerInfo {
report_fatal_error("Invalid rule identifier");
}
- virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
- MachineIRBuilder &B) const override;
+ bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
+ MachineIRBuilder &B) const override;
};
bool AArch64PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h b/llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h
index 753f7edc93856..98b5031071cf4 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h
@@ -29,7 +29,7 @@ class AMDGPUMIRFormatter final : public MIRFormatter {
virtual ~AMDGPUMIRFormatter() = default;
/// Implement target specific parsing of target custom pseudo source value.
- virtual bool
+ bool
parseCustomPseudoSourceValue(StringRef Src, MachineFunction &MF,
PerFunctionMIParsingState &PFS,
const PseudoSourceValue *&PSV,
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
index bfe2e9b66ed4c..98e9907068f20 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
@@ -191,8 +191,8 @@ class AMDGPUPreLegalizerCombinerInfo final : public CombinerInfo {
report_fatal_error("Invalid rule identifier");
}
- virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
- MachineIRBuilder &B) const override;
+ bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
+ MachineIRBuilder &B) const override;
};
bool AMDGPUPreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,
diff --git a/llvm/lib/Target/AMDGPU/R600ISelLowering.h b/llvm/lib/Target/AMDGPU/R600ISelLowering.h
index e7706fa0ef5ce..1ed79add64c98 100644
--- a/llvm/lib/Target/AMDGPU/R600ISelLowering.h
+++ b/llvm/lib/Target/AMDGPU/R600ISelLowering.h
@@ -54,8 +54,8 @@ class R600TargetLowering final : public AMDGPUTargetLowering {
MachineMemOperand::Flags Flags = MachineMemOperand::MONone,
bool *IsFast = nullptr) const override;
- virtual bool canCombineTruncStore(EVT ValVT, EVT MemVT,
- bool LegalOperations) const override {
+ bool canCombineTruncStore(EVT ValVT, EVT MemVT,
+ bool LegalOperations) const override {
// R600 has "custom" lowering for truncating stores despite not supporting
// those instructions. If we allow that custom lowering in the DAG combiner
// then all truncates are merged into truncating stores, giving worse code
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.h b/llvm/lib/Target/AMDGPU/SIISelLowering.h
index d1fecc1afc7fe..e0101f53880f4 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.h
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.h
@@ -487,10 +487,10 @@ class SITargetLowering final : public AMDGPUTargetLowering {
AtomicExpansionKind
shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override;
- virtual const TargetRegisterClass *
- getRegClassFor(MVT VT, bool isDivergent) const override;
- virtual bool requiresUniformRegister(MachineFunction &MF,
- const Value *V) const override;
+ const TargetRegisterClass *getRegClassFor(MVT VT,
+ bool isDivergent) const override;
+ bool requiresUniformRegister(MachineFunction &MF,
+ const Value *V) const override;
Align getPrefLoopAlignment(MachineLoop *ML) const override;
void allocateHSAUserSGPRs(CCState &CCInfo,
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.h b/llvm/lib/Target/RISCV/RISCVInstrInfo.h
index 4aa9ded5b3a26..506a0a4946650 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfo.h
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.h
@@ -134,14 +134,13 @@ class RISCVInstrInfo : public RISCVGenInstrInfo {
getSerializableDirectMachineOperandTargetFlags() const override;
// Return true if the function can safely be outlined from.
- virtual bool
- isFunctionSafeToOutlineFrom(MachineFunction &MF,
- bool OutlineFromLinkOnceODRs) const override;
+ bool isFunctionSafeToOutlineFrom(MachineFunction &MF,
+ bool OutlineFromLinkOnceODRs) const override;
// Return true if MBB is safe to outline from, and return any target-specific
// information in Flags.
- virtual bool isMBBSafeToOutlineFrom(MachineBasicBlock &MBB,
- unsigned &Flags) const override;
+ bool isMBBSafeToOutlineFrom(MachineBasicBlock &MBB,
+ unsigned &Flags) const override;
bool shouldOutlineFromFunctionByDefault(MachineFunction &MF) const override;
diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.h b/llvm/lib/Target/RISCV/RISCVTargetMachine.h
index 087646fb5ed93..4b2a403c5c5b5 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetMachine.h
+++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.h
@@ -44,8 +44,7 @@ class RISCVTargetMachine : public LLVMTargetMachine {
TargetTransformInfo getTargetTransformInfo(const Function &F) const override;
- virtual bool isNoopAddrSpaceCast(unsigned SrcAS,
- unsigned DstAS) const override;
+ bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DstAS) const override;
yaml::MachineFunctionInfo *createDefaultFuncInfoYAML() const override;
yaml::MachineFunctionInfo *
diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h
index af110884049b3..85e5d0ba4c34f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.h
+++ b/llvm/lib/Target/X86/X86ISelLowering.h
@@ -1409,7 +1409,7 @@ namespace llvm {
Register
getExceptionSelectorRegister(const Constant *PersonalityFn) const override;
- virtual bool needsFixedCatchObjects() const override;
+ bool needsFixedCatchObjects() const override;
/// This method returns a target specific FastISel object,
/// or null if the target does not support "fast" ISel.
diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 660ff3ee95636..589bcb414e101 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -3328,7 +3328,7 @@ struct AANoAliasReturned final : AANoAliasImpl {
}
/// See AbstractAttribute::updateImpl(...).
- virtual ChangeStatus updateImpl(Attributor &A) override {
+ ChangeStatus updateImpl(Attributor &A) override {
auto CheckReturnValue = [&](Value &RV) -> bool {
if (Constant *C = dyn_cast<Constant>(&RV))
@@ -3427,7 +3427,7 @@ struct AAIsDeadValueImpl : public AAIsDead {
}
/// See AbstractAttribute::getAsStr().
- virtual const std::string getAsStr() const override {
+ const std::string getAsStr() const override {
return isAssumedDead() ? "assumed-dead" : "assumed-live";
}
@@ -4709,7 +4709,7 @@ struct AANoReturnImpl : public AANoReturn {
}
/// See AbstractAttribute::updateImpl(Attributor &A).
- virtual ChangeStatus updateImpl(Attributor &A) override {
+ ChangeStatus updateImpl(Attributor &A) override {
auto CheckForNoReturn = [](Instruction &) { return false; };
bool UsedAssumedInformation = false;
if (!A.checkForAllInstructions(CheckForNoReturn, *this,
@@ -6848,7 +6848,7 @@ struct AAPrivatizablePtrFloating : public AAPrivatizablePtrImpl {
: AAPrivatizablePtrImpl(IRP, A) {}
/// See AbstractAttribute::initialize(...).
- virtual void initialize(Attributor &A) override {
+ void initialize(Attributor &A) override {
// TODO: We can privatize more than arguments.
indicatePessimisticFixpoint();
}
@@ -7222,7 +7222,7 @@ struct AAMemoryBehaviorFunction final : public AAMemoryBehaviorImpl {
: AAMemoryBehaviorImpl(IRP, A) {}
/// See AbstractAttribute::updateImpl(Attributor &A).
- virtual ChangeStatus updateImpl(Attributor &A) override;
+ ChangeStatus updateImpl(Attributor &A) override;
/// See AbstractAttribute::manifest(...).
ChangeStatus manifest(Attributor &A) override {
@@ -7934,7 +7934,7 @@ struct AAMemoryLocationFunction final : public AAMemoryLocationImpl {
: AAMemoryLocationImpl(IRP, A) {}
/// See AbstractAttribute::updateImpl(Attributor &A).
- virtual ChangeStatus updateImpl(Attributor &A) override {
+ ChangeStatus updateImpl(Attributor &A) override {
const auto &MemBehaviorAA =
A.getAAFor<AAMemoryBehavior>(*this, getIRPosition(), DepClassTy::NONE);
@@ -9332,13 +9332,13 @@ struct AANoUndefCallSiteReturned final
struct AACallEdgesImpl : public AACallEdges {
AACallEdgesImpl(const IRPosition &IRP, Attributor &A) : AACallEdges(IRP, A) {}
- virtual const SetVector<Function *> &getOptimisticEdges() const override {
+ const SetVector<Function *> &getOptimisticEdges() const override {
return CalledFunctions;
}
- virtual bool hasUnknownCallee() const override { return HasUnknownCallee; }
+ bool hasUnknownCallee() const override { return HasUnknownCallee; }
- virtual bool hasNonAsmUnknownCallee() const override {
+ bool hasNonAsmUnknownCallee() const override {
return HasUnknownCalleeNonAsm;
}
diff --git a/llvm/lib/Transforms/IPO/SCCP.cpp b/llvm/lib/Transforms/IPO/SCCP.cpp
index 26fb7d676429c..0453af184a729 100644
--- a/llvm/lib/Transforms/IPO/SCCP.cpp
+++ b/llvm/lib/Transforms/IPO/SCCP.cpp
@@ -148,7 +148,7 @@ struct FunctionSpecializationLegacyPass : public ModulePass {
AU.addRequired<TargetTransformInfoWrapperPass>();
}
- virtual bool runOnModule(Module &M) override {
+ bool runOnModule(Module &M) override {
if (skipModule(M))
return false;
diff --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.h b/llvm/tools/dsymutil/DwarfLinkerForBinary.h
index f6aa7295379b7..623441c749a5d 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.h
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.h
@@ -137,7 +137,7 @@ class DwarfLinkerForBinary {
int64_t(Mapping.BinaryAddress) - *Mapping.ObjectAddress);
}
}
- virtual ~AddressManager() override { clear(); }
+ ~AddressManager() override { clear(); }
bool hasValidRelocs() override {
return !ValidDebugInfoRelocs.empty() || !ValidDebugAddrRelocs.empty();
diff --git a/llvm/tools/dsymutil/Reproducer.h b/llvm/tools/dsymutil/Reproducer.h
index c88e1dd111912..b53b485fbea6c 100644
--- a/llvm/tools/dsymutil/Reproducer.h
+++ b/llvm/tools/dsymutil/Reproducer.h
@@ -53,7 +53,7 @@ class ReproducerGenerate : public Reproducer {
bool GenerateOnExit);
~ReproducerGenerate() override;
- virtual void generate() override;
+ void generate() override;
private:
/// The path to the reproducer.
diff --git a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
index cb8e1822ee303..cdecfba9a375a 100644
--- a/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
+++ b/llvm/tools/llvm-mca/CodeRegionGenerator.cpp
@@ -48,8 +48,8 @@ class MCStreamerWrapper final : public MCStreamer {
: MCStreamer(Context), Regions(R) {}
// We only want to intercept the emission of new instructions.
- virtual void emitInstruction(const MCInst &Inst,
- const MCSubtargetInfo & /* unused */) override {
+ void emitInstruction(const MCInst &Inst,
+ const MCSubtargetInfo & /* unused */) override {
Regions.addInstruction(Inst);
}
diff --git a/llvm/tools/llvm-profgen/PerfReader.h b/llvm/tools/llvm-profgen/PerfReader.h
index 6b5f39056d182..3ffed99187317 100644
--- a/llvm/tools/llvm-profgen/PerfReader.h
+++ b/llvm/tools/llvm-profgen/PerfReader.h
@@ -598,7 +598,7 @@ class PerfScriptReader : public PerfReaderBase {
: PerfReaderBase(B, PerfTrace), PIDFilter(PID){};
// Entry of the reader to parse multiple perf traces
- virtual void parsePerfTraces() override;
+ void parsePerfTraces() override;
// Generate perf script from perf data
static PerfInputFile convertPerfDataToTrace(ProfiledBinary *Binary,
PerfInputFile &File,
@@ -678,7 +678,7 @@ class LBRPerfReader : public PerfScriptReader {
Optional<uint32_t> PID)
: PerfScriptReader(Binary, PerfTrace, PID){};
// Parse the LBR only sample.
- virtual void parseSample(TraceStream &TraceIt, uint64_t Count) override;
+ void parseSample(TraceStream &TraceIt, uint64_t Count) override;
};
/*
diff --git a/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h b/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h
index 08e541b76a5a5..96fef21b76276 100644
--- a/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h
+++ b/llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h
@@ -96,7 +96,7 @@ class GIMatchDagOpcodePredicate : public GIMatchDagPredicate {
void printDescription(raw_ostream &OS) const override;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
- virtual LLVM_DUMP_METHOD void dump() const override { print(errs()); }
+ LLVM_DUMP_METHOD void dump() const override { print(errs()); }
#endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
};
@@ -119,7 +119,7 @@ class GIMatchDagOneOfOpcodesPredicate : public GIMatchDagPredicate {
void printDescription(raw_ostream &OS) const override;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
- virtual LLVM_DUMP_METHOD void dump() const override { print(errs()); }
+ LLVM_DUMP_METHOD void dump() const override { print(errs()); }
#endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
};
@@ -134,7 +134,7 @@ class GIMatchDagSameMOPredicate : public GIMatchDagPredicate {
void printDescription(raw_ostream &OS) const override;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
- virtual LLVM_DUMP_METHOD void dump() const override { print(errs()); }
+ LLVM_DUMP_METHOD void dump() const override { print(errs()); }
#endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
};
More information about the llvm-commits
mailing list