diff --git a/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h b/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h --- a/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h +++ b/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h @@ -110,7 +110,7 @@ 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 @@ return isPreceededBySpecialInstruction(Insn); } - virtual bool isSpecialInstruction(const Instruction *Insn) const; + bool isSpecialInstruction(const Instruction *Insn) const override; }; } // llvm diff --git a/llvm/include/llvm/Analysis/MustExecute.h b/llvm/include/llvm/Analysis/MustExecute.h --- a/llvm/include/llvm/Analysis/MustExecute.h +++ b/llvm/include/llvm/Analysis/MustExecute.h @@ -111,17 +111,15 @@ 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 @@ 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 @@ /// 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); diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h --- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h +++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h @@ -313,8 +313,8 @@ 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 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 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; diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h --- a/llvm/include/llvm/IR/DiagnosticInfo.h +++ b/llvm/include/llvm/IR/DiagnosticInfo.h @@ -213,7 +213,7 @@ }; 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 @@ /// 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 @@ /// 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 @@ /// 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 @@ /// 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 diff --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h --- a/llvm/include/llvm/MC/MCELFObjectWriter.h +++ b/llvm/include/llvm/MC/MCELFObjectWriter.h @@ -65,7 +65,7 @@ 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; } diff --git a/llvm/include/llvm/MC/MCMachObjectWriter.h b/llvm/include/llvm/MC/MCMachObjectWriter.h --- a/llvm/include/llvm/MC/MCMachObjectWriter.h +++ b/llvm/include/llvm/MC/MCMachObjectWriter.h @@ -45,7 +45,7 @@ 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; } diff --git a/llvm/include/llvm/MC/MCWasmObjectWriter.h b/llvm/include/llvm/MC/MCWasmObjectWriter.h --- a/llvm/include/llvm/MC/MCWasmObjectWriter.h +++ b/llvm/include/llvm/MC/MCWasmObjectWriter.h @@ -28,7 +28,7 @@ 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; } diff --git a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h --- a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h +++ b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h @@ -31,7 +31,7 @@ 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; } diff --git a/llvm/include/llvm/Object/Error.h b/llvm/include/llvm/Object/Error.h --- a/llvm/include/llvm/Object/Error.h +++ b/llvm/include/llvm/Object/Error.h @@ -51,7 +51,7 @@ /// Currently inherits from ECError for easy interoperability with /// std::error_code, but this will be removed in the future. class BinaryError : public ErrorInfo { - virtual void anchor(); + void anchor() override; public: static char ID; BinaryError() { diff --git a/llvm/include/llvm/Support/FormatAdapters.h b/llvm/include/llvm/Support/FormatAdapters.h --- a/llvm/include/llvm/Support/FormatAdapters.h +++ b/llvm/include/llvm/Support/FormatAdapters.h @@ -34,7 +34,7 @@ : FormatAdapter(std::forward(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(this->Item)); FmtAlign(Adapter, Where, Amount, Fill).format(Stream, Style); } @@ -48,7 +48,7 @@ PadAdapter(T &&Item, size_t Left, size_t Right) : FormatAdapter(std::forward(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(this->Item)); Stream.indent(Left); Adapter.format(Stream, Style); @@ -63,7 +63,7 @@ RepeatAdapter(T &&Item, size_t Count) : FormatAdapter(std::forward(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(this->Item)); for (size_t I = 0; I < Count; ++I) { Adapter.format(Stream, Style); @@ -76,7 +76,9 @@ 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; + } }; } diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -330,11 +330,11 @@ 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 { diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -101,21 +101,21 @@ 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()) diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp @@ -47,7 +47,7 @@ /// Encode the instruction and write it to the OS. void encodeInstruction(const MCInst &MI, raw_ostream &OS, SmallVectorImpl &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, diff --git a/llvm/lib/Target/AVR/AVRFrameLowering.cpp b/llvm/lib/Target/AVR/AVRFrameLowering.cpp --- a/llvm/lib/Target/AVR/AVRFrameLowering.cpp +++ b/llvm/lib/Target/AVR/AVRFrameLowering.cpp @@ -405,7 +405,7 @@ static char ID; AVRFrameAnalyzer() : MachineFunctionPass(ID) {} - bool runOnMachineFunction(MachineFunction &MF) { + bool runOnMachineFunction(MachineFunction &MF) override { const MachineFrameInfo &MFI = MF.getFrameInfo(); AVRMachineFunctionInfo *FuncInfo = MF.getInfo(); @@ -457,7 +457,7 @@ 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 @@ 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 @@ return true; } - StringRef getPassName() const { + StringRef getPassName() const override { return "AVR dynalloca stack pointer save/restore"; } }; diff --git a/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp b/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp --- a/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp +++ b/llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp @@ -178,10 +178,10 @@ 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 @@ 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 @@ 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() << "\""; diff --git a/llvm/lib/Target/BPF/BTFDebug.h b/llvm/lib/Target/BPF/BTFDebug.h --- a/llvm/lib/Target/BPF/BTFDebug.h +++ b/llvm/lib/Target/BPF/BTFDebug.h @@ -63,8 +63,8 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ public: BTFTypeFuncProto(const DISubroutineType *STy, uint32_t NumParams, const std::unordered_map &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 @@ 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 @@ 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 @@ 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. diff --git a/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp b/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp --- a/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp +++ b/llvm/lib/Target/MSP430/AsmParser/MSP430AsmParser.cpp @@ -156,12 +156,12 @@ 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 @@ return Tok; } - unsigned getReg() const { + unsigned getReg() const override { assert(Kind == k_Reg && "Invalid access!"); return Reg; } @@ -222,10 +222,10 @@ return std::make_unique(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; diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h @@ -28,7 +28,7 @@ }; class PPCXCOFFMCAsmInfo : public MCAsmInfoXCOFF { - virtual void anchor(); + void anchor() override; public: explicit PPCXCOFFMCAsmInfo(bool is64Bit, const Triple &); diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.h b/llvm/lib/Target/X86/X86TargetTransformInfo.h --- a/llvm/lib/Target/X86/X86TargetTransformInfo.h +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.h @@ -105,9 +105,9 @@ /// \name Cache TTI Implementation /// @{ llvm::Optional getCacheSize( - TargetTransformInfo::CacheLevel Level) const; + TargetTransformInfo::CacheLevel Level) const override; llvm::Optional getCacheAssociativity( - TargetTransformInfo::CacheLevel Level) const; + TargetTransformInfo::CacheLevel Level) const override; /// @} /// \name Vector TTI Implementations diff --git a/llvm/lib/Transforms/Utils/FixIrreducible.cpp b/llvm/lib/Transforms/Utils/FixIrreducible.cpp --- a/llvm/lib/Transforms/Utils/FixIrreducible.cpp +++ b/llvm/lib/Transforms/Utils/FixIrreducible.cpp @@ -84,7 +84,7 @@ initializeFixIrreduciblePass(*PassRegistry::getPassRegistry()); } - void getAnalysisUsage(AnalysisUsage &AU) const { + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequiredID(LowerSwitchID); AU.addRequired(); AU.addRequired(); @@ -93,7 +93,7 @@ AU.addPreserved(); } - bool runOnFunction(Function &F); + bool runOnFunction(Function &F) override; }; } // namespace diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -885,11 +885,11 @@ 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(PI)) { diff --git a/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp b/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp --- a/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp +++ b/llvm/lib/Transforms/Utils/UnifyLoopExits.cpp @@ -33,7 +33,7 @@ initializeUnifyLoopExitsPass(*PassRegistry::getPassRegistry()); } - void getAnalysisUsage(AnalysisUsage &AU) const { + void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequiredID(LowerSwitchID); AU.addRequired(); AU.addRequired(); @@ -42,7 +42,7 @@ AU.addPreserved(); } - bool runOnFunction(Function &F); + bool runOnFunction(Function &F) override; }; } // namespace