1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[NFC] Add 'override' keyword where missing in include/ and lib/.

This fixes warnings raised by Clang's new -Wsuggest-override, in preparation for enabling that warning in the LLVM build. This patch also removes the virtual keyword where redundant, but only in places where doing so improves consistency within a given file. It also removes a couple unnecessary virtual destructor declarations in derived classes where the destructor inherited from the base class is already virtual.

Differential Revision: https://reviews.llvm.org/D83709
This commit is contained in:
Logan Smith 2020-07-14 09:47:29 -07:00
parent 705268c433
commit 25adca40ab
22 changed files with 109 additions and 111 deletions

View File

@ -110,7 +110,7 @@ public:
return isPreceededBySpecialInstruction(Insn);
}
virtual bool isSpecialInstruction(const Instruction *Insn) const;
bool isSpecialInstruction(const Instruction *Insn) const override;
};
class MemoryWriteTracking : public InstructionPrecedenceTracking {
@ -133,7 +133,7 @@ public:
return isPreceededBySpecialInstruction(Insn);
}
virtual bool isSpecialInstruction(const Instruction *Insn) const;
bool isSpecialInstruction(const Instruction *Insn) const override;
};
} // llvm

View File

@ -111,17 +111,15 @@ class SimpleLoopSafetyInfo: public LoopSafetyInfo {
bool HeaderMayThrow = false; // Same as previous, but specific to loop header
public:
virtual bool blockMayThrow(const BasicBlock *BB) const;
bool blockMayThrow(const BasicBlock *BB) const override;
virtual bool anyBlockMayThrow() const;
bool anyBlockMayThrow() const override;
virtual void computeLoopSafetyInfo(const Loop *CurLoop);
void computeLoopSafetyInfo(const Loop *CurLoop) override;
virtual bool isGuaranteedToExecute(const Instruction &Inst,
const DominatorTree *DT,
const Loop *CurLoop) const;
virtual ~SimpleLoopSafetyInfo() {};
bool isGuaranteedToExecute(const Instruction &Inst,
const DominatorTree *DT,
const Loop *CurLoop) const override;
};
/// This implementation of LoopSafetyInfo use ImplicitControlFlowTracking to
@ -138,15 +136,15 @@ class ICFLoopSafetyInfo: public LoopSafetyInfo {
mutable MemoryWriteTracking MW;
public:
virtual bool blockMayThrow(const BasicBlock *BB) const;
bool blockMayThrow(const BasicBlock *BB) const override;
virtual bool anyBlockMayThrow() const;
bool anyBlockMayThrow() const override;
virtual void computeLoopSafetyInfo(const Loop *CurLoop);
void computeLoopSafetyInfo(const Loop *CurLoop) override;
virtual bool isGuaranteedToExecute(const Instruction &Inst,
const DominatorTree *DT,
const Loop *CurLoop) const;
bool isGuaranteedToExecute(const Instruction &Inst,
const DominatorTree *DT,
const Loop *CurLoop) const override;
/// Returns true if we could not execute a memory-modifying instruction before
/// we enter \p BB under assumption that \p CurLoop is entered.
@ -167,8 +165,6 @@ public:
/// from its block. It will make all cache updates to keep it correct after
/// this removal.
void removeInstruction(const Instruction *Inst);
virtual ~ICFLoopSafetyInfo() {};
};
bool mayContainIrreducibleControl(const Function &F, const LoopInfo *LI);

View File

@ -313,8 +313,8 @@ struct PrimitiveTypeNode : public TypeNode {
explicit PrimitiveTypeNode(PrimitiveKind K)
: TypeNode(NodeKind::PrimitiveType), PrimKind(K) {}
void outputPre(OutputStream &OS, OutputFlags Flags) const;
void outputPost(OutputStream &OS, OutputFlags Flags) const {}
void outputPre(OutputStream &OS, OutputFlags Flags) const override;
void outputPost(OutputStream &OS, OutputFlags Flags) const override {}
PrimitiveKind PrimKind;
};
@ -474,8 +474,8 @@ struct PointerTypeNode : public TypeNode {
struct TagTypeNode : public TypeNode {
explicit TagTypeNode(TagKind Tag) : TypeNode(NodeKind::TagType), Tag(Tag) {}
void outputPre(OutputStream &OS, OutputFlags Flags) const;
void outputPost(OutputStream &OS, OutputFlags Flags) const;
void outputPre(OutputStream &OS, OutputFlags Flags) const override;
void outputPost(OutputStream &OS, OutputFlags Flags) const override;
QualifiedNameNode *QualifiedName = nullptr;
TagKind Tag;
@ -484,8 +484,8 @@ struct TagTypeNode : public TypeNode {
struct ArrayTypeNode : public TypeNode {
ArrayTypeNode() : TypeNode(NodeKind::ArrayType) {}
void outputPre(OutputStream &OS, OutputFlags Flags) const;
void outputPost(OutputStream &OS, OutputFlags Flags) const;
void outputPre(OutputStream &OS, OutputFlags Flags) const override;
void outputPost(OutputStream &OS, OutputFlags Flags) const override;
void outputDimensionsImpl(OutputStream &OS, OutputFlags Flags) const;
void outputOneDimension(OutputStream &OS, OutputFlags Flags, Node *N) const;

View File

@ -213,7 +213,7 @@ public:
};
class DiagnosticInfoStackSize : public DiagnosticInfoResourceLimit {
virtual void anchor() override;
void anchor() override;
public:
DiagnosticInfoStackSize(const Function &Fn, uint64_t StackSize,
DiagnosticSeverity Severity = DS_Warning,
@ -364,7 +364,7 @@ public:
/// Common features for diagnostics with an associated location.
class DiagnosticInfoWithLocationBase : public DiagnosticInfo {
virtual void anchor() override;
void anchor() override;
public:
/// \p Fn is the function where the diagnostic is being emitted. \p Loc is
/// the location information to use in the diagnostic.
@ -611,7 +611,7 @@ operator<<(RemarkT &R,
/// Common features for diagnostics dealing with optimization remarks
/// that are used by IR passes.
class DiagnosticInfoIROptimization : public DiagnosticInfoOptimizationBase {
virtual void anchor() override;
void anchor() override;
public:
/// \p PassName is the name of the pass emitting this diagnostic. \p
/// RemarkName is a textual identifier for the remark (single-word,
@ -832,7 +832,7 @@ private:
/// Diagnostic information for optimization analysis remarks related to
/// floating-point non-commutativity.
class OptimizationRemarkAnalysisFPCommute : public OptimizationRemarkAnalysis {
virtual void anchor();
void anchor() override;
public:
/// \p PassName is the name of the pass emitting this diagnostic. If this name
/// matches the regular expression given in -Rpass-analysis=, then the
@ -874,7 +874,7 @@ private:
/// Diagnostic information for optimization analysis remarks related to
/// pointer aliasing.
class OptimizationRemarkAnalysisAliasing : public OptimizationRemarkAnalysis {
virtual void anchor();
void anchor() override;
public:
/// \p PassName is the name of the pass emitting this diagnostic. If this name
/// matches the regular expression given in -Rpass-analysis=, then the

View File

@ -65,7 +65,7 @@ protected:
public:
virtual ~MCELFObjectTargetWriter() = default;
virtual Triple::ObjectFormatType getFormat() const { return Triple::ELF; }
Triple::ObjectFormatType getFormat() const override { return Triple::ELF; }
static bool classof(const MCObjectTargetWriter *W) {
return W->getFormat() == Triple::ELF;
}

View File

@ -45,7 +45,7 @@ protected:
public:
virtual ~MCMachObjectTargetWriter();
virtual Triple::ObjectFormatType getFormat() const { return Triple::MachO; }
Triple::ObjectFormatType getFormat() const override { return Triple::MachO; }
static bool classof(const MCObjectTargetWriter *W) {
return W->getFormat() == Triple::MachO;
}

View File

@ -28,7 +28,7 @@ protected:
public:
virtual ~MCWasmObjectTargetWriter();
virtual Triple::ObjectFormatType getFormat() const { return Triple::Wasm; }
Triple::ObjectFormatType getFormat() const override { return Triple::Wasm; }
static bool classof(const MCObjectTargetWriter *W) {
return W->getFormat() == Triple::Wasm;
}

View File

@ -31,7 +31,7 @@ class raw_pwrite_stream;
public:
virtual ~MCWinCOFFObjectTargetWriter() = default;
virtual Triple::ObjectFormatType getFormat() const { return Triple::COFF; }
Triple::ObjectFormatType getFormat() const override { return Triple::COFF; }
static bool classof(const MCObjectTargetWriter *W) {
return W->getFormat() == Triple::COFF;
}

View File

@ -51,7 +51,7 @@ inline std::error_code make_error_code(object_error e) {
/// Currently inherits from ECError for easy interoperability with
/// std::error_code, but this will be removed in the future.
class BinaryError : public ErrorInfo<BinaryError, ECError> {
virtual void anchor();
void anchor() override;
public:
static char ID;
BinaryError() {

View File

@ -34,7 +34,7 @@ public:
: FormatAdapter<T>(std::forward<T>(Item)), Where(Where), Amount(Amount),
Fill(Fill) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
void format(llvm::raw_ostream &Stream, StringRef Style) override {
auto Adapter = detail::build_format_adapter(std::forward<T>(this->Item));
FmtAlign(Adapter, Where, Amount, Fill).format(Stream, Style);
}
@ -48,7 +48,7 @@ public:
PadAdapter(T &&Item, size_t Left, size_t Right)
: FormatAdapter<T>(std::forward<T>(Item)), Left(Left), Right(Right) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
void format(llvm::raw_ostream &Stream, StringRef Style) override {
auto Adapter = detail::build_format_adapter(std::forward<T>(this->Item));
Stream.indent(Left);
Adapter.format(Stream, Style);
@ -63,7 +63,7 @@ public:
RepeatAdapter(T &&Item, size_t Count)
: FormatAdapter<T>(std::forward<T>(Item)), Count(Count) {}
void format(llvm::raw_ostream &Stream, StringRef Style) {
void format(llvm::raw_ostream &Stream, StringRef Style) override {
auto Adapter = detail::build_format_adapter(std::forward<T>(this->Item));
for (size_t I = 0; I < Count; ++I) {
Adapter.format(Stream, Style);
@ -76,7 +76,9 @@ public:
ErrorAdapter(Error &&Item) : FormatAdapter(std::move(Item)) {}
ErrorAdapter(ErrorAdapter &&) = default;
~ErrorAdapter() { consumeError(std::move(Item)); }
void format(llvm::raw_ostream &Stream, StringRef Style) { Stream << Item; }
void format(llvm::raw_ostream &Stream, StringRef Style) override {
Stream << Item;
}
};
}

View File

@ -330,11 +330,11 @@ public:
LazyValueInfoAnnotatedWriter(LazyValueInfoImpl *L, DominatorTree &DTree)
: LVIImpl(L), DT(DTree) {}
virtual void emitBasicBlockStartAnnot(const BasicBlock *BB,
formatted_raw_ostream &OS);
void emitBasicBlockStartAnnot(const BasicBlock *BB,
formatted_raw_ostream &OS) override;
virtual void emitInstructionAnnot(const Instruction *I,
formatted_raw_ostream &OS);
void emitInstructionAnnot(const Instruction *I,
formatted_raw_ostream &OS) override;
};
}
namespace {

View File

@ -101,21 +101,21 @@ public:
CVMCAdapter(MCStreamer &OS, TypeCollection &TypeTable)
: OS(&OS), TypeTable(TypeTable) {}
void emitBytes(StringRef Data) { OS->emitBytes(Data); }
void emitBytes(StringRef Data) override { OS->emitBytes(Data); }
void emitIntValue(uint64_t Value, unsigned Size) {
void emitIntValue(uint64_t Value, unsigned Size) override {
OS->emitIntValueInHex(Value, Size);
}
void emitBinaryData(StringRef Data) { OS->emitBinaryData(Data); }
void emitBinaryData(StringRef Data) override { OS->emitBinaryData(Data); }
void AddComment(const Twine &T) { OS->AddComment(T); }
void AddComment(const Twine &T) override { OS->AddComment(T); }
void AddRawComment(const Twine &T) { OS->emitRawComment(T); }
void AddRawComment(const Twine &T) override { OS->emitRawComment(T); }
bool isVerboseAsm() { return OS->isVerboseAsm(); }
bool isVerboseAsm() override { return OS->isVerboseAsm(); }
std::string getTypeName(TypeIndex TI) {
std::string getTypeName(TypeIndex TI) override {
std::string TypeName;
if (!TI.isNoneType()) {
if (TI.isSimple())

View File

@ -47,7 +47,7 @@ public:
/// Encode the instruction and write it to the OS.
void encodeInstruction(const MCInst &MI, raw_ostream &OS,
SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const;
const MCSubtargetInfo &STI) const override;
/// \returns the encoding for an MCOperand.
uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,

View File

@ -405,7 +405,7 @@ struct AVRFrameAnalyzer : public MachineFunctionPass {
static char ID;
AVRFrameAnalyzer() : MachineFunctionPass(ID) {}
bool runOnMachineFunction(MachineFunction &MF) {
bool runOnMachineFunction(MachineFunction &MF) override {
const MachineFrameInfo &MFI = MF.getFrameInfo();
AVRMachineFunctionInfo *FuncInfo = MF.getInfo<AVRMachineFunctionInfo>();
@ -457,7 +457,7 @@ struct AVRFrameAnalyzer : public MachineFunctionPass {
return false;
}
StringRef getPassName() const { return "AVR Frame Analyzer"; }
StringRef getPassName() const override { return "AVR Frame Analyzer"; }
};
char AVRFrameAnalyzer::ID = 0;
@ -473,7 +473,7 @@ struct AVRDynAllocaSR : public MachineFunctionPass {
static char ID;
AVRDynAllocaSR() : MachineFunctionPass(ID) {}
bool runOnMachineFunction(MachineFunction &MF) {
bool runOnMachineFunction(MachineFunction &MF) override {
// Early exit when there are no variable sized objects in the function.
if (!MF.getFrameInfo().hasVarSizedObjects()) {
return false;
@ -506,7 +506,7 @@ struct AVRDynAllocaSR : public MachineFunctionPass {
return true;
}
StringRef getPassName() const {
StringRef getPassName() const override {
return "AVR dynalloca stack pointer save/restore";
}
};

View File

@ -178,10 +178,10 @@ public:
return isUInt<8>(Value);
}
bool isReg() const { return Kind == k_Register; }
bool isImm() const { return Kind == k_Immediate; }
bool isToken() const { return Kind == k_Token; }
bool isMem() const { return Kind == k_Memri; }
bool isReg() const override { return Kind == k_Register; }
bool isImm() const override { return Kind == k_Immediate; }
bool isToken() const override { return Kind == k_Token; }
bool isMem() const override { return Kind == k_Memri; }
bool isMemri() const { return Kind == k_Memri; }
StringRef getToken() const {
@ -189,7 +189,7 @@ public:
return Tok;
}
unsigned getReg() const {
unsigned getReg() const override {
assert((Kind == k_Register || Kind == k_Memri) && "Invalid access!");
return RegImm.Reg;
@ -239,10 +239,10 @@ public:
RegImm = {RegNo, Imm};
}
SMLoc getStartLoc() const { return Start; }
SMLoc getEndLoc() const { return End; }
SMLoc getStartLoc() const override { return Start; }
SMLoc getEndLoc() const override { return End; }
virtual void print(raw_ostream &O) const {
void print(raw_ostream &O) const override {
switch (Kind) {
case k_Token:
O << "Token: \"" << getToken() << "\"";

View File

@ -63,8 +63,8 @@ class BTFTypeDerived : public BTFTypeBase {
public:
BTFTypeDerived(const DIDerivedType *Ty, unsigned Tag, bool NeedsFixup);
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
void setPointeeType(uint32_t PointeeType);
};
@ -74,8 +74,8 @@ class BTFTypeFwd : public BTFTypeBase {
public:
BTFTypeFwd(StringRef Name, bool IsUnion);
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle int type.
@ -86,9 +86,9 @@ class BTFTypeInt : public BTFTypeBase {
public:
BTFTypeInt(uint32_t Encoding, uint32_t SizeInBits, uint32_t OffsetInBits,
StringRef TypeName);
uint32_t getSize() { return BTFTypeBase::getSize() + sizeof(uint32_t); }
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
uint32_t getSize() override { return BTFTypeBase::getSize() + sizeof(uint32_t); }
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle enumerate type.
@ -98,11 +98,11 @@ class BTFTypeEnum : public BTFTypeBase {
public:
BTFTypeEnum(const DICompositeType *ETy, uint32_t NumValues);
uint32_t getSize() {
uint32_t getSize() override {
return BTFTypeBase::getSize() + EnumValues.size() * BTF::BTFEnumSize;
}
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle array type.
@ -111,9 +111,9 @@ class BTFTypeArray : public BTFTypeBase {
public:
BTFTypeArray(uint32_t ElemTypeId, uint32_t NumElems);
uint32_t getSize() { return BTFTypeBase::getSize() + BTF::BTFArraySize; }
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
uint32_t getSize() override { return BTFTypeBase::getSize() + BTF::BTFArraySize; }
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle struct/union type.
@ -125,11 +125,11 @@ class BTFTypeStruct : public BTFTypeBase {
public:
BTFTypeStruct(const DICompositeType *STy, bool IsStruct, bool HasBitField,
uint32_t NumMembers);
uint32_t getSize() {
uint32_t getSize() override {
return BTFTypeBase::getSize() + Members.size() * BTF::BTFMemberSize;
}
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
std::string getName();
};
@ -142,11 +142,11 @@ class BTFTypeFuncProto : public BTFTypeBase {
public:
BTFTypeFuncProto(const DISubroutineType *STy, uint32_t NumParams,
const std::unordered_map<uint32_t, StringRef> &FuncArgNames);
uint32_t getSize() {
uint32_t getSize() override {
return BTFTypeBase::getSize() + Parameters.size() * BTF::BTFParamSize;
}
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle subprogram
@ -155,9 +155,9 @@ class BTFTypeFunc : public BTFTypeBase {
public:
BTFTypeFunc(StringRef FuncName, uint32_t ProtoTypeId, uint32_t Scope);
uint32_t getSize() { return BTFTypeBase::getSize(); }
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
uint32_t getSize() override { return BTFTypeBase::getSize(); }
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle variable instances
@ -167,9 +167,9 @@ class BTFKindVar : public BTFTypeBase {
public:
BTFKindVar(StringRef VarName, uint32_t TypeId, uint32_t VarInfo);
uint32_t getSize() { return BTFTypeBase::getSize() + 4; }
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
uint32_t getSize() override { return BTFTypeBase::getSize() + 4; }
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// Handle data sections
@ -180,15 +180,15 @@ class BTFKindDataSec : public BTFTypeBase {
public:
BTFKindDataSec(AsmPrinter *AsmPrt, std::string SecName);
uint32_t getSize() {
uint32_t getSize() override {
return BTFTypeBase::getSize() + BTF::BTFDataSecVarSize * Vars.size();
}
void addVar(uint32_t Id, const MCSymbol *Sym, uint32_t Size) {
Vars.push_back(std::make_tuple(Id, Sym, Size));
}
std::string getName() { return Name; }
void completeType(BTFDebug &BDebug);
void emitType(MCStreamer &OS);
void completeType(BTFDebug &BDebug) override;
void emitType(MCStreamer &OS) override;
};
/// String table.

View File

@ -156,12 +156,12 @@ public:
addExprOperand(Inst, Mem.Offset);
}
bool isReg() const { return Kind == k_Reg; }
bool isImm() const { return Kind == k_Imm; }
bool isToken() const { return Kind == k_Tok; }
bool isMem() const { return Kind == k_Mem; }
bool isIndReg() const { return Kind == k_IndReg; }
bool isPostIndReg() const { return Kind == k_PostIndReg; }
bool isReg() const override { return Kind == k_Reg; }
bool isImm() const override { return Kind == k_Imm; }
bool isToken() const override { return Kind == k_Tok; }
bool isMem() const override { return Kind == k_Mem; }
bool isIndReg() const { return Kind == k_IndReg; }
bool isPostIndReg() const { return Kind == k_PostIndReg; }
bool isCGImm() const {
if (Kind != k_Imm)
@ -182,7 +182,7 @@ public:
return Tok;
}
unsigned getReg() const {
unsigned getReg() const override {
assert(Kind == k_Reg && "Invalid access!");
return Reg;
}
@ -222,10 +222,10 @@ public:
return std::make_unique<MSP430Operand>(k_PostIndReg, RegNum, S, E);
}
SMLoc getStartLoc() const { return Start; }
SMLoc getEndLoc() const { return End; }
SMLoc getStartLoc() const override { return Start; }
SMLoc getEndLoc() const override { return End; }
virtual void print(raw_ostream &O) const {
void print(raw_ostream &O) const override {
switch (Kind) {
case k_Tok:
O << "Token " << Tok;

View File

@ -28,7 +28,7 @@ public:
};
class PPCXCOFFMCAsmInfo : public MCAsmInfoXCOFF {
virtual void anchor();
void anchor() override;
public:
explicit PPCXCOFFMCAsmInfo(bool is64Bit, const Triple &);

View File

@ -105,9 +105,9 @@ public:
/// \name Cache TTI Implementation
/// @{
llvm::Optional<unsigned> getCacheSize(
TargetTransformInfo::CacheLevel Level) const;
TargetTransformInfo::CacheLevel Level) const override;
llvm::Optional<unsigned> getCacheAssociativity(
TargetTransformInfo::CacheLevel Level) const;
TargetTransformInfo::CacheLevel Level) const override;
/// @}
/// \name Vector TTI Implementations

View File

@ -84,7 +84,7 @@ struct FixIrreducible : public FunctionPass {
initializeFixIrreduciblePass(*PassRegistry::getPassRegistry());
}
void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(LowerSwitchID);
AU.addRequired<DominatorTreeWrapperPass>();
AU.addRequired<LoopInfoWrapperPass>();
@ -93,7 +93,7 @@ struct FixIrreducible : public FunctionPass {
AU.addPreserved<LoopInfoWrapperPass>();
}
bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
};
} // namespace

View File

@ -885,11 +885,11 @@ class PredicateInfoAnnotatedWriter : public AssemblyAnnotationWriter {
public:
PredicateInfoAnnotatedWriter(const PredicateInfo *M) : PredInfo(M) {}
virtual void emitBasicBlockStartAnnot(const BasicBlock *BB,
formatted_raw_ostream &OS) {}
void emitBasicBlockStartAnnot(const BasicBlock *BB,
formatted_raw_ostream &OS) override {}
virtual void emitInstructionAnnot(const Instruction *I,
formatted_raw_ostream &OS) {
void emitInstructionAnnot(const Instruction *I,
formatted_raw_ostream &OS) override {
if (const auto *PI = PredInfo->getPredicateInfoFor(I)) {
OS << "; Has predicate info\n";
if (const auto *PB = dyn_cast<PredicateBranch>(PI)) {

View File

@ -33,7 +33,7 @@ struct UnifyLoopExits : public FunctionPass {
initializeUnifyLoopExitsPass(*PassRegistry::getPassRegistry());
}
void getAnalysisUsage(AnalysisUsage &AU) const {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequiredID(LowerSwitchID);
AU.addRequired<LoopInfoWrapperPass>();
AU.addRequired<DominatorTreeWrapperPass>();
@ -42,7 +42,7 @@ struct UnifyLoopExits : public FunctionPass {
AU.addPreserved<DominatorTreeWrapperPass>();
}
bool runOnFunction(Function &F);
bool runOnFunction(Function &F) override;
};
} // namespace