[llvm] Remove redundaunt virtual specifiers (NFC)

Identified with modernize-use-override.
This commit is contained in:
Kazu Hirata 2022-07-24 21:50:35 -07:00
parent 3650615fb2
commit b5188591a0
34 changed files with 112 additions and 125 deletions

View File

@ -39,14 +39,14 @@ public:
class CSEConfigFull : public CSEConfigBase { class CSEConfigFull : public CSEConfigBase {
public: public:
virtual ~CSEConfigFull() = default; virtual ~CSEConfigFull() = default;
virtual bool shouldCSEOpc(unsigned Opc) override; bool shouldCSEOpc(unsigned Opc) override;
}; };
// Commonly used for O0 config. // Commonly used for O0 config.
class CSEConfigConstantOnly : public CSEConfigBase { class CSEConfigConstantOnly : public CSEConfigBase {
public: public:
virtual ~CSEConfigConstantOnly() = default; virtual ~CSEConfigConstantOnly() = default;
virtual bool shouldCSEOpc(unsigned Opc) override; bool shouldCSEOpc(unsigned Opc) override;
}; };
// Returns the standard expected CSEConfig for the given optimization level. // Returns the standard expected CSEConfig for the given optimization level.

View File

@ -590,7 +590,7 @@ private:
assert(irt && "irt is null!"); assert(irt && "irt is null!");
} }
virtual void addSuccessorWithProb( void addSuccessorWithProb(
MachineBasicBlock *Src, MachineBasicBlock *Dst, MachineBasicBlock *Src, MachineBasicBlock *Dst,
BranchProbability Prob = BranchProbability::getUnknown()) override { BranchProbability Prob = BranchProbability::getUnknown()) override {
IRT->addSuccessorWithProb(Src, Dst, Prob); IRT->addSuccessorWithProb(Src, Dst, Prob);

View File

@ -32,15 +32,12 @@ public:
template <typename ChildType> template <typename ChildType>
class NullEnumerator : public IPDBEnumChildren<ChildType> { class NullEnumerator : public IPDBEnumChildren<ChildType> {
virtual uint32_t getChildCount() const override { return 0; } uint32_t getChildCount() const override { return 0; }
virtual std::unique_ptr<ChildType> std::unique_ptr<ChildType> getChildAtIndex(uint32_t Index) const override {
getChildAtIndex(uint32_t Index) const override {
return nullptr; return nullptr;
} }
virtual std::unique_ptr<ChildType> getNext() override { std::unique_ptr<ChildType> getNext() override { return nullptr; }
return nullptr; void reset() override {}
}
virtual void reset() override {}
}; };
} // end namespace pdb } // end namespace pdb

View File

@ -381,13 +381,13 @@ public:
protected: protected:
// Create a representation of the IR. // Create a representation of the IR.
virtual void generateIRRepresentation(Any IR, StringRef PassID, void generateIRRepresentation(Any IR, StringRef PassID,
IRDataT<EmptyData> &Output) override; IRDataT<EmptyData> &Output) override;
// Called when an interesting IR has changed. // Called when an interesting IR has changed.
virtual void handleAfter(StringRef PassID, std::string &Name, void handleAfter(StringRef PassID, std::string &Name,
const IRDataT<EmptyData> &Before, const IRDataT<EmptyData> &Before,
const IRDataT<EmptyData> &After, Any) override; const IRDataT<EmptyData> &After, Any) override;
void handleFunctionCompare(StringRef Name, StringRef Prefix, StringRef PassID, void handleFunctionCompare(StringRef Name, StringRef Prefix, StringRef PassID,
StringRef Divider, bool InModule, unsigned Minor, StringRef Divider, bool InModule, unsigned Minor,

View File

@ -585,14 +585,14 @@ public:
: SampleProfileReader(std::move(B), C, Format) {} : SampleProfileReader(std::move(B), C, Format) {}
/// Read and validate the file header. /// Read and validate the file header.
virtual std::error_code readHeader() override; std::error_code readHeader() override;
/// Read sample profiles from the associated file. /// Read sample profiles from the associated file.
std::error_code readImpl() override; std::error_code readImpl() override;
/// It includes all the names that have samples either in outline instance /// It includes all the names that have samples either in outline instance
/// or inline instance. /// or inline instance.
virtual std::vector<StringRef> *getNameTable() override { return &NameTable; } std::vector<StringRef> *getNameTable() override { return &NameTable; }
protected: protected:
/// Read a numeric value of type T from the profile. /// Read a numeric value of type T from the profile.
@ -656,7 +656,7 @@ private:
class SampleProfileReaderRawBinary : public SampleProfileReaderBinary { class SampleProfileReaderRawBinary : public SampleProfileReaderBinary {
private: private:
virtual std::error_code verifySPMagic(uint64_t Magic) override; std::error_code verifySPMagic(uint64_t Magic) override;
public: public:
SampleProfileReaderRawBinary(std::unique_ptr<MemoryBuffer> B, LLVMContext &C, SampleProfileReaderRawBinary(std::unique_ptr<MemoryBuffer> B, LLVMContext &C,
@ -710,14 +710,14 @@ protected:
std::error_code readCSNameTableSec(); std::error_code readCSNameTableSec();
std::error_code readProfileSymbolList(); std::error_code readProfileSymbolList();
virtual std::error_code readHeader() override; std::error_code readHeader() override;
virtual std::error_code verifySPMagic(uint64_t Magic) override = 0; std::error_code verifySPMagic(uint64_t Magic) override = 0;
virtual std::error_code readOneSection(const uint8_t *Start, uint64_t Size, virtual std::error_code readOneSection(const uint8_t *Start, uint64_t Size,
const SecHdrTableEntry &Entry); const SecHdrTableEntry &Entry);
// placeholder for subclasses to dispatch their own section readers. // placeholder for subclasses to dispatch their own section readers.
virtual std::error_code readCustomSection(const SecHdrTableEntry &Entry) = 0; virtual std::error_code readCustomSection(const SecHdrTableEntry &Entry) = 0;
virtual ErrorOr<StringRef> readStringFromTable() override; ErrorOr<StringRef> readStringFromTable() override;
virtual ErrorOr<SampleContext> readSampleContextFromTable() override; ErrorOr<SampleContext> readSampleContextFromTable() override;
ErrorOr<SampleContextFrames> readContextFromTable(); ErrorOr<SampleContextFrames> readContextFromTable();
std::unique_ptr<ProfileSymbolList> ProfSymList; std::unique_ptr<ProfileSymbolList> ProfSymList;
@ -770,27 +770,26 @@ public:
uint64_t getSectionSize(SecType Type); uint64_t getSectionSize(SecType Type);
/// Get the total size of header and all sections. /// Get the total size of header and all sections.
uint64_t getFileSize(); 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 /// Collect functions with definitions in Module M. Return true if
/// the reader has been given a module. /// the reader has been given a module.
bool collectFuncsFromModule() override; bool collectFuncsFromModule() override;
/// Return whether names in the profile are all MD5 numbers. /// 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); return std::move(ProfSymList);
}; };
virtual void setSkipFlatProf(bool Skip) override { SkipFlatProf = Skip; } void setSkipFlatProf(bool Skip) override { SkipFlatProf = Skip; }
}; };
class SampleProfileReaderExtBinary : public SampleProfileReaderExtBinaryBase { class SampleProfileReaderExtBinary : public SampleProfileReaderExtBinaryBase {
private: private:
virtual std::error_code verifySPMagic(uint64_t Magic) override; std::error_code verifySPMagic(uint64_t Magic) override;
virtual std::error_code std::error_code readCustomSection(const SecHdrTableEntry &Entry) override {
readCustomSection(const SecHdrTableEntry &Entry) override {
// Update the data reader pointer to the end of the section. // Update the data reader pointer to the end of the section.
Data = End; Data = End;
return sampleprof_error::success; return sampleprof_error::success;
@ -814,11 +813,11 @@ private:
DenseMap<StringRef, uint64_t> FuncOffsetTable; DenseMap<StringRef, uint64_t> FuncOffsetTable;
/// The set containing the functions to use when compiling a module. /// The set containing the functions to use when compiling a module.
DenseSet<StringRef> FuncsToUse; DenseSet<StringRef> FuncsToUse;
virtual std::error_code verifySPMagic(uint64_t Magic) override; std::error_code verifySPMagic(uint64_t Magic) override;
virtual std::error_code readNameTable() override; std::error_code readNameTable() override;
/// Read a string indirectly via the name table. /// Read a string indirectly via the name table.
virtual ErrorOr<StringRef> readStringFromTable() override; ErrorOr<StringRef> readStringFromTable() override;
virtual std::error_code readHeader() override; std::error_code readHeader() override;
std::error_code readFuncOffsetTable(); std::error_code readFuncOffsetTable();
public: public:
@ -837,7 +836,7 @@ public:
bool collectFuncsFromModule() override; bool collectFuncsFromModule() override;
/// Return whether names in the profile are all MD5 numbers. /// 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>; using InlineCallStack = SmallVector<FunctionSamples *, 10>;

View File

@ -122,14 +122,13 @@ public:
SampleProfileWriterBinary(std::unique_ptr<raw_ostream> &OS) SampleProfileWriterBinary(std::unique_ptr<raw_ostream> &OS)
: SampleProfileWriter(OS) {} : SampleProfileWriter(OS) {}
virtual std::error_code writeSample(const FunctionSamples &S) override; std::error_code writeSample(const FunctionSamples &S) override;
protected: protected:
virtual MapVector<StringRef, uint32_t> &getNameTable() { return NameTable; } virtual MapVector<StringRef, uint32_t> &getNameTable() { return NameTable; }
virtual std::error_code writeMagicIdent(SampleProfileFormat Format); virtual std::error_code writeMagicIdent(SampleProfileFormat Format);
virtual std::error_code writeNameTable(); virtual std::error_code writeNameTable();
virtual std::error_code std::error_code writeHeader(const SampleProfileMap &ProfileMap) override;
writeHeader(const SampleProfileMap &ProfileMap) override;
std::error_code writeSummary(); std::error_code writeSummary();
virtual std::error_code writeContextIdx(const SampleContext &Context); virtual std::error_code writeContextIdx(const SampleContext &Context);
std::error_code writeNameIdx(StringRef FName); std::error_code writeNameIdx(StringRef FName);
@ -187,14 +186,14 @@ const std::array<SmallVector<SecHdrTableEntry, 8>, NumOfLayout>
class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary { class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
using SampleProfileWriterBinary::SampleProfileWriterBinary; using SampleProfileWriterBinary::SampleProfileWriterBinary;
public: 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); 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. // Set to use MD5 to represent string in NameTable.
virtual void setUseMD5() override { void setUseMD5() override {
UseMD5 = true; UseMD5 = true;
addSectionFlag(SecNameTable, SecNameTableFlags::SecFlagMD5Name); addSectionFlag(SecNameTable, SecNameTableFlags::SecFlagMD5Name);
// MD5 will be stored as plain uint64_t instead of variable-length // MD5 will be stored as plain uint64_t instead of variable-length
@ -205,15 +204,15 @@ public:
// Set the profile to be partial. It means the profile is for // Set the profile to be partial. It means the profile is for
// common/shared code. The common profile is usually merged from // common/shared code. The common profile is usually merged from
// profiles collected from running other targets. // profiles collected from running other targets.
virtual void setPartialProfile() override { void setPartialProfile() override {
addSectionFlag(SecProfSummary, SecProfSummaryFlags::SecFlagPartial); addSectionFlag(SecProfSummary, SecProfSummaryFlags::SecFlagPartial);
} }
virtual void setProfileSymbolList(ProfileSymbolList *PSL) override { void setProfileSymbolList(ProfileSymbolList *PSL) override {
ProfSymList = PSL; ProfSymList = PSL;
}; };
virtual void resetSecLayout(SectionLayout SL) override { void resetSecLayout(SectionLayout SL) override {
verifySecLayout(SL); verifySecLayout(SL);
#ifndef NDEBUG #ifndef NDEBUG
// Make sure resetSecLayout is called before any flag setting. // Make sure resetSecLayout is called before any flag setting.
@ -242,7 +241,7 @@ protected:
addSecFlag(SectionHdrLayout[SectionIdx], Flag); 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. // placeholder for subclasses to dispatch their own section writers.
virtual std::error_code writeCustomSection(SecType Type) = 0; virtual std::error_code writeCustomSection(SecType Type) = 0;
@ -258,9 +257,8 @@ protected:
const SampleProfileMap &ProfileMap); const SampleProfileMap &ProfileMap);
// Helper function to write name table. // Helper function to write name table.
virtual std::error_code writeNameTable() override; std::error_code writeNameTable() override;
virtual std::error_code std::error_code writeContextIdx(const SampleContext &Context) override;
writeContextIdx(const SampleContext &Context) override;
std::error_code writeCSNameIdx(const SampleContext &Context); std::error_code writeCSNameIdx(const SampleContext &Context);
std::error_code writeCSNameTableSection(); std::error_code writeCSNameTableSection();
@ -288,8 +286,7 @@ protected:
private: private:
void allocSecHdrTable(); void allocSecHdrTable();
std::error_code writeSecHdrTable(); std::error_code writeSecHdrTable();
virtual std::error_code std::error_code writeHeader(const SampleProfileMap &ProfileMap) override;
writeHeader(const SampleProfileMap &ProfileMap) override;
std::error_code compressAndOutput(); std::error_code compressAndOutput();
// We will swap the raw_ostream held by LocalBufStream and that // We will swap the raw_ostream held by LocalBufStream and that
@ -334,14 +331,13 @@ private:
std::error_code writeDefaultLayout(const SampleProfileMap &ProfileMap); std::error_code writeDefaultLayout(const SampleProfileMap &ProfileMap);
std::error_code writeCtxSplitLayout(const SampleProfileMap &ProfileMap); std::error_code writeCtxSplitLayout(const SampleProfileMap &ProfileMap);
virtual std::error_code std::error_code writeSections(const SampleProfileMap &ProfileMap) override;
writeSections(const SampleProfileMap &ProfileMap) override;
virtual std::error_code writeCustomSection(SecType Type) override { std::error_code writeCustomSection(SecType Type) override {
return sampleprof_error::success; return sampleprof_error::success;
}; };
virtual void verifySecLayout(SectionLayout SL) override { void verifySecLayout(SectionLayout SL) override {
assert((SL == DefaultLayout || SL == CtxSplitLayout) && assert((SL == DefaultLayout || SL == CtxSplitLayout) &&
"Unsupported layout"); "Unsupported layout");
} }
@ -381,8 +377,8 @@ class SampleProfileWriterCompactBinary : public SampleProfileWriterBinary {
using SampleProfileWriterBinary::SampleProfileWriterBinary; using SampleProfileWriterBinary::SampleProfileWriterBinary;
public: public:
virtual std::error_code writeSample(const FunctionSamples &S) override; std::error_code writeSample(const FunctionSamples &S) override;
virtual std::error_code write(const SampleProfileMap &ProfileMap) override; std::error_code write(const SampleProfileMap &ProfileMap) override;
protected: protected:
/// The table mapping from function name to the offset of its FunctionSample /// The table mapping from function name to the offset of its FunctionSample
@ -391,9 +387,8 @@ protected:
/// The offset of the slot to be filled with the offset of FuncOffsetTable /// The offset of the slot to be filled with the offset of FuncOffsetTable
/// towards profile start. /// towards profile start.
uint64_t TableOffset; uint64_t TableOffset;
virtual std::error_code writeNameTable() override; std::error_code writeNameTable() override;
virtual std::error_code std::error_code writeHeader(const SampleProfileMap &ProfileMap) override;
writeHeader(const SampleProfileMap &ProfileMap) override;
std::error_code writeFuncOffsetTable(); std::error_code writeFuncOffsetTable();
}; };

View File

@ -192,9 +192,7 @@ public:
Error commit() override { return Error::success(); } Error commit() override { return Error::success(); }
/// Return the properties of this stream. /// Return the properties of this stream.
virtual BinaryStreamFlags getFlags() const override { BinaryStreamFlags getFlags() const override { return BSF_Write | BSF_Append; }
return BSF_Write | BSF_Append;
}
MutableArrayRef<uint8_t> data() { return Data; } MutableArrayRef<uint8_t> data() { return Data; }
}; };

View File

@ -1141,7 +1141,7 @@ private:
class ECError : public ErrorInfo<ECError> { class ECError : public ErrorInfo<ECError> {
friend Error errorCodeToError(std::error_code); friend Error errorCodeToError(std::error_code);
virtual void anchor() override; void anchor() override;
public: public:
void setErrorCode(std::error_code EC) { this->EC = EC; } void setErrorCode(std::error_code EC) { this->EC = EC; }

View File

@ -710,7 +710,7 @@ class buffer_ostream : public raw_svector_ostream {
raw_ostream &OS; raw_ostream &OS;
SmallVector<char, 0> Buffer; SmallVector<char, 0> Buffer;
virtual void anchor() override; void anchor() override;
public: public:
buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {} 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; std::unique_ptr<raw_ostream> OS;
SmallVector<char, 0> Buffer; SmallVector<char, 0> Buffer;
virtual void anchor() override; void anchor() override;
public: public:
buffer_unique_ostream(std::unique_ptr<raw_ostream> OS) buffer_unique_ostream(std::unique_ptr<raw_ostream> OS)

View File

@ -2837,7 +2837,7 @@ struct IRAttribute : public BaseType {
IRAttribute(const IRPosition &IRP) : BaseType(IRP) {} IRAttribute(const IRPosition &IRP) : BaseType(IRP) {}
/// See AbstractAttribute::initialize(...). /// See AbstractAttribute::initialize(...).
virtual void initialize(Attributor &A) override { void initialize(Attributor &A) override {
const IRPosition &IRP = this->getIRPosition(); const IRPosition &IRP = this->getIRPosition();
if (isa<UndefValue>(IRP.getAssociatedValue()) || if (isa<UndefValue>(IRP.getAssociatedValue()) ||
this->hasAttr(getAttrKind(), /* IgnoreSubsumingPositions */ false, this->hasAttr(getAttrKind(), /* IgnoreSubsumingPositions */ false,

View File

@ -102,9 +102,9 @@ struct AutoInitRemark : public MemoryOpRemark {
static bool canHandle(const Instruction *I); static bool canHandle(const Instruction *I);
protected: protected:
virtual std::string explainSource(StringRef Type) const override; std::string explainSource(StringRef Type) const override;
virtual StringRef remarkName(RemarkKind RK) const override; StringRef remarkName(RemarkKind RK) const override;
virtual DiagnosticKind diagnosticKind() const override { DiagnosticKind diagnosticKind() const override {
return DK_OptimizationRemarkMissed; return DK_OptimizationRemarkMissed;
} }
}; };

View File

@ -185,8 +185,8 @@ private:
public: public:
InlineCostAnnotationWriter(InlineCostCallAnalyzer *ICCA) : ICCA(ICCA) {} InlineCostAnnotationWriter(InlineCostCallAnalyzer *ICCA) : ICCA(ICCA) {}
virtual void emitInstructionAnnot(const Instruction *I, void emitInstructionAnnot(const Instruction *I,
formatted_raw_ostream &OS) override; formatted_raw_ostream &OS) override;
}; };
/// Carry out call site analysis, in order to evaluate inlinability. /// Carry out call site analysis, in order to evaluate inlinability.

View File

@ -28,7 +28,7 @@ public:
void endModule() override; void endModule() override;
void beginFunction(const MachineFunction *MF) override {} void beginFunction(const MachineFunction *MF) override {}
virtual void markFunctionEnd() override; void markFunctionEnd() override;
void endFunction(const MachineFunction *MF) override; void endFunction(const MachineFunction *MF) override;
protected: protected:

View File

@ -47,7 +47,7 @@ public:
bool runOnMachineFunction(MachineFunction &MF) override; bool runOnMachineFunction(MachineFunction &MF) override;
virtual MachineFunctionProperties getRequiredProperties() const override { MachineFunctionProperties getRequiredProperties() const override {
return MachineFunctionProperties().set( return MachineFunctionProperties().set(
MachineFunctionProperties::Property::IsSSA); MachineFunctionProperties::Property::IsSSA);
} }

View File

@ -253,7 +253,7 @@ class XCOFFObjectWriter : public MCObjectWriter {
CsectGroup &getCsectGroup(const MCSectionXCOFF *MCSec); CsectGroup &getCsectGroup(const MCSectionXCOFF *MCSec);
virtual void reset() override; void reset() override;
void executePostLayoutBinding(MCAssembler &, const MCAsmLayout &) override; void executePostLayoutBinding(MCAssembler &, const MCAsmLayout &) override;

View File

@ -115,13 +115,13 @@ public:
Error visit(const OwnedDataSection &Sec) override; Error visit(const OwnedDataSection &Sec) override;
Error visit(const StringTableSection &Sec) override; Error visit(const StringTableSection &Sec) override;
Error visit(const DynamicRelocationSection &Sec) override; Error visit(const DynamicRelocationSection &Sec) override;
virtual Error visit(const SymbolTableSection &Sec) override = 0; Error visit(const SymbolTableSection &Sec) override = 0;
virtual Error visit(const RelocationSection &Sec) override = 0; Error visit(const RelocationSection &Sec) override = 0;
virtual Error visit(const GnuDebugLinkSection &Sec) override = 0; Error visit(const GnuDebugLinkSection &Sec) override = 0;
virtual Error visit(const GroupSection &Sec) override = 0; Error visit(const GroupSection &Sec) override = 0;
virtual Error visit(const SectionIndexSection &Sec) override = 0; Error visit(const SectionIndexSection &Sec) override = 0;
virtual Error visit(const CompressedSection &Sec) override = 0; Error visit(const CompressedSection &Sec) override = 0;
virtual Error visit(const DecompressedSection &Sec) override = 0; Error visit(const DecompressedSection &Sec) override = 0;
explicit SectionWriter(WritableMemoryBuffer &Buf) : Out(Buf) {} explicit SectionWriter(WritableMemoryBuffer &Buf) : Out(Buf) {}
}; };

View File

@ -66,8 +66,8 @@ public:
report_fatal_error("Invalid rule identifier"); report_fatal_error("Invalid rule identifier");
} }
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
MachineIRBuilder &B) const override; MachineIRBuilder &B) const override;
}; };
bool AArch64O0PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer, bool AArch64O0PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,

View File

@ -355,8 +355,8 @@ public:
report_fatal_error("Invalid rule identifier"); report_fatal_error("Invalid rule identifier");
} }
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
MachineIRBuilder &B) const override; MachineIRBuilder &B) const override;
}; };
bool AArch64PostLegalizerCombinerInfo::combine(GISelChangeObserver &Observer, bool AArch64PostLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,

View File

@ -997,8 +997,8 @@ public:
report_fatal_error("Invalid rule identifier"); report_fatal_error("Invalid rule identifier");
} }
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
MachineIRBuilder &B) const override; MachineIRBuilder &B) const override;
}; };
bool AArch64PostLegalizerLoweringInfo::combine(GISelChangeObserver &Observer, bool AArch64PostLegalizerLoweringInfo::combine(GISelChangeObserver &Observer,

View File

@ -370,8 +370,8 @@ public:
report_fatal_error("Invalid rule identifier"); report_fatal_error("Invalid rule identifier");
} }
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
MachineIRBuilder &B) const override; MachineIRBuilder &B) const override;
}; };
bool AArch64PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer, bool AArch64PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,

View File

@ -29,7 +29,7 @@ public:
virtual ~AMDGPUMIRFormatter() = default; virtual ~AMDGPUMIRFormatter() = default;
/// Implement target specific parsing of target custom pseudo source value. /// Implement target specific parsing of target custom pseudo source value.
virtual bool bool
parseCustomPseudoSourceValue(StringRef Src, MachineFunction &MF, parseCustomPseudoSourceValue(StringRef Src, MachineFunction &MF,
PerFunctionMIParsingState &PFS, PerFunctionMIParsingState &PFS,
const PseudoSourceValue *&PSV, const PseudoSourceValue *&PSV,

View File

@ -191,8 +191,8 @@ public:
report_fatal_error("Invalid rule identifier"); report_fatal_error("Invalid rule identifier");
} }
virtual bool combine(GISelChangeObserver &Observer, MachineInstr &MI, bool combine(GISelChangeObserver &Observer, MachineInstr &MI,
MachineIRBuilder &B) const override; MachineIRBuilder &B) const override;
}; };
bool AMDGPUPreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer, bool AMDGPUPreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,

View File

@ -54,8 +54,8 @@ public:
MachineMemOperand::Flags Flags = MachineMemOperand::MONone, MachineMemOperand::Flags Flags = MachineMemOperand::MONone,
bool *IsFast = nullptr) const override; bool *IsFast = nullptr) const override;
virtual bool canCombineTruncStore(EVT ValVT, EVT MemVT, bool canCombineTruncStore(EVT ValVT, EVT MemVT,
bool LegalOperations) const override { bool LegalOperations) const override {
// R600 has "custom" lowering for truncating stores despite not supporting // R600 has "custom" lowering for truncating stores despite not supporting
// those instructions. If we allow that custom lowering in the DAG combiner // those instructions. If we allow that custom lowering in the DAG combiner
// then all truncates are merged into truncating stores, giving worse code // then all truncates are merged into truncating stores, giving worse code

View File

@ -487,10 +487,10 @@ public:
AtomicExpansionKind AtomicExpansionKind
shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override; shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const override;
virtual const TargetRegisterClass * const TargetRegisterClass *getRegClassFor(MVT VT,
getRegClassFor(MVT VT, bool isDivergent) const override; bool isDivergent) const override;
virtual bool requiresUniformRegister(MachineFunction &MF, bool requiresUniformRegister(MachineFunction &MF,
const Value *V) const override; const Value *V) const override;
Align getPrefLoopAlignment(MachineLoop *ML) const override; Align getPrefLoopAlignment(MachineLoop *ML) const override;
void allocateHSAUserSGPRs(CCState &CCInfo, void allocateHSAUserSGPRs(CCState &CCInfo,

View File

@ -134,14 +134,13 @@ public:
getSerializableDirectMachineOperandTargetFlags() const override; getSerializableDirectMachineOperandTargetFlags() const override;
// Return true if the function can safely be outlined from. // Return true if the function can safely be outlined from.
virtual bool bool isFunctionSafeToOutlineFrom(MachineFunction &MF,
isFunctionSafeToOutlineFrom(MachineFunction &MF, bool OutlineFromLinkOnceODRs) const override;
bool OutlineFromLinkOnceODRs) const override;
// Return true if MBB is safe to outline from, and return any target-specific // Return true if MBB is safe to outline from, and return any target-specific
// information in Flags. // information in Flags.
virtual bool isMBBSafeToOutlineFrom(MachineBasicBlock &MBB, bool isMBBSafeToOutlineFrom(MachineBasicBlock &MBB,
unsigned &Flags) const override; unsigned &Flags) const override;
bool shouldOutlineFromFunctionByDefault(MachineFunction &MF) const override; bool shouldOutlineFromFunctionByDefault(MachineFunction &MF) const override;

View File

@ -44,8 +44,7 @@ public:
TargetTransformInfo getTargetTransformInfo(const Function &F) const override; TargetTransformInfo getTargetTransformInfo(const Function &F) const override;
virtual bool isNoopAddrSpaceCast(unsigned SrcAS, bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DstAS) const override;
unsigned DstAS) const override;
yaml::MachineFunctionInfo *createDefaultFuncInfoYAML() const override; yaml::MachineFunctionInfo *createDefaultFuncInfoYAML() const override;
yaml::MachineFunctionInfo * yaml::MachineFunctionInfo *

View File

@ -1409,7 +1409,7 @@ namespace llvm {
Register Register
getExceptionSelectorRegister(const Constant *PersonalityFn) const override; getExceptionSelectorRegister(const Constant *PersonalityFn) const override;
virtual bool needsFixedCatchObjects() const override; bool needsFixedCatchObjects() const override;
/// This method returns a target specific FastISel object, /// This method returns a target specific FastISel object,
/// or null if the target does not support "fast" ISel. /// or null if the target does not support "fast" ISel.

View File

@ -3328,7 +3328,7 @@ struct AANoAliasReturned final : AANoAliasImpl {
} }
/// See AbstractAttribute::updateImpl(...). /// See AbstractAttribute::updateImpl(...).
virtual ChangeStatus updateImpl(Attributor &A) override { ChangeStatus updateImpl(Attributor &A) override {
auto CheckReturnValue = [&](Value &RV) -> bool { auto CheckReturnValue = [&](Value &RV) -> bool {
if (Constant *C = dyn_cast<Constant>(&RV)) if (Constant *C = dyn_cast<Constant>(&RV))
@ -3427,7 +3427,7 @@ struct AAIsDeadValueImpl : public AAIsDead {
} }
/// See AbstractAttribute::getAsStr(). /// See AbstractAttribute::getAsStr().
virtual const std::string getAsStr() const override { const std::string getAsStr() const override {
return isAssumedDead() ? "assumed-dead" : "assumed-live"; return isAssumedDead() ? "assumed-dead" : "assumed-live";
} }
@ -4709,7 +4709,7 @@ struct AANoReturnImpl : public AANoReturn {
} }
/// See AbstractAttribute::updateImpl(Attributor &A). /// See AbstractAttribute::updateImpl(Attributor &A).
virtual ChangeStatus updateImpl(Attributor &A) override { ChangeStatus updateImpl(Attributor &A) override {
auto CheckForNoReturn = [](Instruction &) { return false; }; auto CheckForNoReturn = [](Instruction &) { return false; };
bool UsedAssumedInformation = false; bool UsedAssumedInformation = false;
if (!A.checkForAllInstructions(CheckForNoReturn, *this, if (!A.checkForAllInstructions(CheckForNoReturn, *this,
@ -6848,7 +6848,7 @@ struct AAPrivatizablePtrFloating : public AAPrivatizablePtrImpl {
: AAPrivatizablePtrImpl(IRP, A) {} : AAPrivatizablePtrImpl(IRP, A) {}
/// See AbstractAttribute::initialize(...). /// See AbstractAttribute::initialize(...).
virtual void initialize(Attributor &A) override { void initialize(Attributor &A) override {
// TODO: We can privatize more than arguments. // TODO: We can privatize more than arguments.
indicatePessimisticFixpoint(); indicatePessimisticFixpoint();
} }
@ -7222,7 +7222,7 @@ struct AAMemoryBehaviorFunction final : public AAMemoryBehaviorImpl {
: AAMemoryBehaviorImpl(IRP, A) {} : AAMemoryBehaviorImpl(IRP, A) {}
/// See AbstractAttribute::updateImpl(Attributor &A). /// See AbstractAttribute::updateImpl(Attributor &A).
virtual ChangeStatus updateImpl(Attributor &A) override; ChangeStatus updateImpl(Attributor &A) override;
/// See AbstractAttribute::manifest(...). /// See AbstractAttribute::manifest(...).
ChangeStatus manifest(Attributor &A) override { ChangeStatus manifest(Attributor &A) override {
@ -7934,7 +7934,7 @@ struct AAMemoryLocationFunction final : public AAMemoryLocationImpl {
: AAMemoryLocationImpl(IRP, A) {} : AAMemoryLocationImpl(IRP, A) {}
/// See AbstractAttribute::updateImpl(Attributor &A). /// See AbstractAttribute::updateImpl(Attributor &A).
virtual ChangeStatus updateImpl(Attributor &A) override { ChangeStatus updateImpl(Attributor &A) override {
const auto &MemBehaviorAA = const auto &MemBehaviorAA =
A.getAAFor<AAMemoryBehavior>(*this, getIRPosition(), DepClassTy::NONE); A.getAAFor<AAMemoryBehavior>(*this, getIRPosition(), DepClassTy::NONE);
@ -9332,13 +9332,13 @@ struct AANoUndefCallSiteReturned final
struct AACallEdgesImpl : public AACallEdges { struct AACallEdgesImpl : public AACallEdges {
AACallEdgesImpl(const IRPosition &IRP, Attributor &A) : AACallEdges(IRP, A) {} AACallEdgesImpl(const IRPosition &IRP, Attributor &A) : AACallEdges(IRP, A) {}
virtual const SetVector<Function *> &getOptimisticEdges() const override { const SetVector<Function *> &getOptimisticEdges() const override {
return CalledFunctions; 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; return HasUnknownCalleeNonAsm;
} }

View File

@ -148,7 +148,7 @@ struct FunctionSpecializationLegacyPass : public ModulePass {
AU.addRequired<TargetTransformInfoWrapperPass>(); AU.addRequired<TargetTransformInfoWrapperPass>();
} }
virtual bool runOnModule(Module &M) override { bool runOnModule(Module &M) override {
if (skipModule(M)) if (skipModule(M))
return false; return false;

View File

@ -137,7 +137,7 @@ private:
int64_t(Mapping.BinaryAddress) - *Mapping.ObjectAddress); int64_t(Mapping.BinaryAddress) - *Mapping.ObjectAddress);
} }
} }
virtual ~AddressManager() override { clear(); } ~AddressManager() override { clear(); }
bool hasValidRelocs() override { bool hasValidRelocs() override {
return !ValidDebugInfoRelocs.empty() || !ValidDebugAddrRelocs.empty(); return !ValidDebugInfoRelocs.empty() || !ValidDebugAddrRelocs.empty();

View File

@ -53,7 +53,7 @@ public:
bool GenerateOnExit); bool GenerateOnExit);
~ReproducerGenerate() override; ~ReproducerGenerate() override;
virtual void generate() override; void generate() override;
private: private:
/// The path to the reproducer. /// The path to the reproducer.

View File

@ -48,8 +48,8 @@ public:
: MCStreamer(Context), Regions(R) {} : MCStreamer(Context), Regions(R) {}
// We only want to intercept the emission of new instructions. // We only want to intercept the emission of new instructions.
virtual void emitInstruction(const MCInst &Inst, void emitInstruction(const MCInst &Inst,
const MCSubtargetInfo & /* unused */) override { const MCSubtargetInfo & /* unused */) override {
Regions.addInstruction(Inst); Regions.addInstruction(Inst);
} }

View File

@ -598,7 +598,7 @@ public:
: PerfReaderBase(B, PerfTrace), PIDFilter(PID){}; : PerfReaderBase(B, PerfTrace), PIDFilter(PID){};
// Entry of the reader to parse multiple perf traces // Entry of the reader to parse multiple perf traces
virtual void parsePerfTraces() override; void parsePerfTraces() override;
// Generate perf script from perf data // Generate perf script from perf data
static PerfInputFile convertPerfDataToTrace(ProfiledBinary *Binary, static PerfInputFile convertPerfDataToTrace(ProfiledBinary *Binary,
PerfInputFile &File, PerfInputFile &File,
@ -678,7 +678,7 @@ public:
Optional<uint32_t> PID) Optional<uint32_t> PID)
: PerfScriptReader(Binary, PerfTrace, PID){}; : PerfScriptReader(Binary, PerfTrace, PID){};
// Parse the LBR only sample. // Parse the LBR only sample.
virtual void parseSample(TraceStream &TraceIt, uint64_t Count) override; void parseSample(TraceStream &TraceIt, uint64_t Count) override;
}; };
/* /*

View File

@ -96,7 +96,7 @@ public:
void printDescription(raw_ostream &OS) const override; void printDescription(raw_ostream &OS) const override;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #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) #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
}; };
@ -119,7 +119,7 @@ public:
void printDescription(raw_ostream &OS) const override; void printDescription(raw_ostream &OS) const override;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #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) #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
}; };
@ -134,7 +134,7 @@ public:
void printDescription(raw_ostream &OS) const override; void printDescription(raw_ostream &OS) const override;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #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) #endif // if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
}; };