Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 07a3b97

Browse files
committed
Re-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
Except the changes that defined virtual destructors as =default, because that ran into problems with GCC 4.7 and overriding methods that weren't noexcept. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247298 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d4c5df7 commit 07a3b97

File tree

9 files changed

+89
-90
lines changed

9 files changed

+89
-90
lines changed

include/llvm/CodeGen/MIRParser/MIRParser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- MIRParser.h - MIR serialization format parser ----------------------===//
1+
//===- MIRParser.h - MIR serialization format parser ------------*- C++ -*-===//
22
//
33
// The LLVM Compiler Infrastructure
44
//
@@ -37,7 +37,7 @@ class MIRParser : public MachineFunctionInitializer {
3737
public:
3838
MIRParser(std::unique_ptr<MIRParserImpl> Impl);
3939
MIRParser(const MIRParser &) = delete;
40-
~MIRParser();
40+
~MIRParser() override;
4141

4242
/// Parse the optional LLVM IR module that's embedded in the MIR file.
4343
///
@@ -78,4 +78,4 @@ createMIRParser(std::unique_ptr<MemoryBuffer> Contents, LLVMContext &Context);
7878

7979
} // end namespace llvm
8080

81-
#endif
81+
#endif // LLVM_CODEGEN_MIRPARSER_MIRPARSER_H

include/llvm/ExecutionEngine/RuntimeDyld.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ class RuntimeDyld {
6969
virtual object::OwningBinary<object::ObjectFile>
7070
getObjectForDebug(const object::ObjectFile &Obj) const = 0;
7171

72-
uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const;
72+
uint64_t
73+
getSectionLoadAddress(const object::SectionRef &Sec) const override;
7374

7475
protected:
7576
virtual void anchor();
@@ -252,4 +253,4 @@ class RuntimeDyld {
252253

253254
} // end namespace llvm
254255

255-
#endif
256+
#endif // LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H

include/llvm/Support/raw_ostream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,9 @@ class buffer_ostream : public raw_svector_ostream {
536536

537537
public:
538538
buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
539-
~buffer_ostream() { OS << str(); }
539+
~buffer_ostream() override { OS << str(); }
540540
};
541541

542542
} // end llvm namespace
543543

544-
#endif
544+
#endif // LLVM_SUPPORT_RAW_OSTREAM_H

include/llvm/TableGen/Record.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ class TypedInit : public Init {
366366

367367
protected:
368368
explicit TypedInit(InitKind K, RecTy *T) : Init(K), Ty(T) {}
369-
~TypedInit() {
369+
~TypedInit() override {
370370
// If this is a DefInit we need to delete the RecordRecTy.
371371
if (getKind() == IK_DefInit)
372372
delete Ty;
@@ -1587,6 +1587,6 @@ Init *QualifyName(Record &CurRec, MultiClass *CurMultiClass,
15871587
Init *QualifyName(Record &CurRec, MultiClass *CurMultiClass,
15881588
const std::string &Name, const std::string &Scoper);
15891589

1590-
} // End llvm namespace
1590+
} // end llvm namespace
15911591

1592-
#endif
1592+
#endif // LLVM_TABLEGEN_RECORD_H

lib/CodeGen/MIRPrintingPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ struct MIRPrintingPass : public MachineFunctionPass {
4040
MachineFunctionPass::getAnalysisUsage(AU);
4141
}
4242

43-
virtual bool runOnMachineFunction(MachineFunction &MF) override {
43+
bool runOnMachineFunction(MachineFunction &MF) override {
4444
std::string Str;
4545
raw_string_ostream StrOS(Str);
4646
printMIR(StrOS, MF);
4747
MachineFunctions.append(StrOS.str());
4848
return false;
4949
}
5050

51-
virtual bool doFinalization(Module &M) override {
51+
bool doFinalization(Module &M) override {
5252
printMIR(OS, M);
5353
OS << MachineFunctions;
5454
return false;

lib/ExecutionEngine/MCJIT/MCJIT.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,13 @@ class MCJIT : public ExecutionEngine {
223223
/// FindFunctionNamed - Search all of the active modules to find the function that
224224
/// defines FnName. This is very slow operation and shouldn't be used for
225225
/// general code.
226-
virtual Function *FindFunctionNamed(const char *FnName) override;
226+
Function *FindFunctionNamed(const char *FnName) override;
227227

228-
/// FindGlobalVariableNamed - Search all of the active modules to find the global variable
229-
/// that defines Name. This is very slow operation and shouldn't be used for
230-
/// general code.
231-
virtual GlobalVariable *FindGlobalVariableNamed(const char *Name, bool AllowInternal = false) override;
228+
/// FindGlobalVariableNamed - Search all of the active modules to find the
229+
/// global variable that defines Name. This is very slow operation and
230+
/// shouldn't be used for general code.
231+
GlobalVariable *FindGlobalVariableNamed(const char *Name,
232+
bool AllowInternal = false) override;
232233

233234
/// Sets the object manager that MCJIT should use to avoid compilation.
234235
void setObjectCache(ObjectCache *manager) override;
@@ -335,6 +336,6 @@ class MCJIT : public ExecutionEngine {
335336
bool CheckFunctionsOnly);
336337
};
337338

338-
} // End llvm namespace
339+
} // end llvm namespace
339340

340-
#endif
341+
#endif // LLVM_LIB_EXECUTIONENGINE_MCJIT_MCJIT_H

lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ class X86AddressSanitizer : public X86AsmInstrumentation {
185185
X86AddressSanitizer(const MCSubtargetInfo &STI)
186186
: X86AsmInstrumentation(STI), RepPrefix(false), OrigSPOffset(0) {}
187187

188-
virtual ~X86AddressSanitizer() {}
188+
~X86AddressSanitizer() override {}
189189

190190
// X86AsmInstrumentation implementation:
191-
virtual void InstrumentAndEmitInstruction(const MCInst &Inst,
192-
OperandVector &Operands,
193-
MCContext &Ctx,
194-
const MCInstrInfo &MII,
195-
MCStreamer &Out) override {
191+
void InstrumentAndEmitInstruction(const MCInst &Inst,
192+
OperandVector &Operands,
193+
MCContext &Ctx,
194+
const MCInstrInfo &MII,
195+
MCStreamer &Out) override {
196196
InstrumentMOVS(Inst, Operands, Ctx, MII, Out);
197197
if (RepPrefix)
198198
EmitInstruction(Out, MCInstBuilder(X86::REP_PREFIX));
@@ -506,7 +506,7 @@ class X86AddressSanitizer32 : public X86AddressSanitizer {
506506
X86AddressSanitizer32(const MCSubtargetInfo &STI)
507507
: X86AddressSanitizer(STI) {}
508508

509-
virtual ~X86AddressSanitizer32() {}
509+
~X86AddressSanitizer32() override {}
510510

511511
unsigned GetFrameReg(const MCContext &Ctx, MCStreamer &Out) {
512512
unsigned FrameReg = GetFrameRegGeneric(Ctx, Out);
@@ -535,9 +535,9 @@ class X86AddressSanitizer32 : public X86AddressSanitizer {
535535
OrigSPOffset += 4;
536536
}
537537

538-
virtual void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
539-
MCContext &Ctx,
540-
MCStreamer &Out) override {
538+
void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
539+
MCContext &Ctx,
540+
MCStreamer &Out) override {
541541
unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i32);
542542
assert(LocalFrameReg != X86::NoRegister);
543543

@@ -565,9 +565,9 @@ class X86AddressSanitizer32 : public X86AddressSanitizer {
565565
StoreFlags(Out);
566566
}
567567

568-
virtual void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
569-
MCContext &Ctx,
570-
MCStreamer &Out) override {
568+
void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
569+
MCContext &Ctx,
570+
MCStreamer &Out) override {
571571
unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i32);
572572
assert(LocalFrameReg != X86::NoRegister);
573573

@@ -586,18 +586,18 @@ class X86AddressSanitizer32 : public X86AddressSanitizer {
586586
}
587587
}
588588

589-
virtual void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
590-
bool IsWrite,
591-
const RegisterContext &RegCtx,
592-
MCContext &Ctx,
593-
MCStreamer &Out) override;
594-
virtual void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
595-
bool IsWrite,
596-
const RegisterContext &RegCtx,
597-
MCContext &Ctx,
598-
MCStreamer &Out) override;
599-
virtual void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
600-
MCStreamer &Out) override;
589+
void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
590+
bool IsWrite,
591+
const RegisterContext &RegCtx,
592+
MCContext &Ctx,
593+
MCStreamer &Out) override;
594+
void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
595+
bool IsWrite,
596+
const RegisterContext &RegCtx,
597+
MCContext &Ctx,
598+
MCStreamer &Out) override;
599+
void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
600+
MCStreamer &Out) override;
601601

602602
private:
603603
void EmitCallAsanReport(unsigned AccessSize, bool IsWrite, MCContext &Ctx,
@@ -763,7 +763,7 @@ class X86AddressSanitizer64 : public X86AddressSanitizer {
763763
X86AddressSanitizer64(const MCSubtargetInfo &STI)
764764
: X86AddressSanitizer(STI) {}
765765

766-
virtual ~X86AddressSanitizer64() {}
766+
~X86AddressSanitizer64() override {}
767767

768768
unsigned GetFrameReg(const MCContext &Ctx, MCStreamer &Out) {
769769
unsigned FrameReg = GetFrameRegGeneric(Ctx, Out);
@@ -792,9 +792,9 @@ class X86AddressSanitizer64 : public X86AddressSanitizer {
792792
OrigSPOffset += 8;
793793
}
794794

795-
virtual void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
796-
MCContext &Ctx,
797-
MCStreamer &Out) override {
795+
void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
796+
MCContext &Ctx,
797+
MCStreamer &Out) override {
798798
unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i64);
799799
assert(LocalFrameReg != X86::NoRegister);
800800

@@ -823,9 +823,9 @@ class X86AddressSanitizer64 : public X86AddressSanitizer {
823823
StoreFlags(Out);
824824
}
825825

826-
virtual void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
827-
MCContext &Ctx,
828-
MCStreamer &Out) override {
826+
void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
827+
MCContext &Ctx,
828+
MCStreamer &Out) override {
829829
unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i64);
830830
assert(LocalFrameReg != X86::NoRegister);
831831

@@ -845,18 +845,18 @@ class X86AddressSanitizer64 : public X86AddressSanitizer {
845845
}
846846
}
847847

848-
virtual void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
849-
bool IsWrite,
850-
const RegisterContext &RegCtx,
851-
MCContext &Ctx,
852-
MCStreamer &Out) override;
853-
virtual void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
854-
bool IsWrite,
855-
const RegisterContext &RegCtx,
856-
MCContext &Ctx,
857-
MCStreamer &Out) override;
858-
virtual void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
859-
MCStreamer &Out) override;
848+
void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
849+
bool IsWrite,
850+
const RegisterContext &RegCtx,
851+
MCContext &Ctx,
852+
MCStreamer &Out) override;
853+
void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
854+
bool IsWrite,
855+
const RegisterContext &RegCtx,
856+
MCContext &Ctx,
857+
MCStreamer &Out) override;
858+
void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
859+
MCStreamer &Out) override;
860860

861861
private:
862862
void EmitAdjustRSP(MCContext &Ctx, MCStreamer &Out, long Offset) {
@@ -1080,4 +1080,4 @@ CreateX86AsmInstrumentation(const MCTargetOptions &MCOptions,
10801080
return new X86AsmInstrumentation(STI);
10811081
}
10821082

1083-
} // End llvm namespace
1083+
} // end llvm namespace

lib/Transforms/Instrumentation/SafeStack.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ class SafeStack : public FunctionPass {
220220
initializeSafeStackPass(*PassRegistry::getPassRegistry());
221221
}
222222

223-
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
223+
void getAnalysisUsage(AnalysisUsage &AU) const override {
224224
AU.addRequired<AAResultsWrapperPass>();
225225
}
226226

227-
virtual bool doInitialization(Module &M) {
227+
bool doInitialization(Module &M) override {
228228
DL = &M.getDataLayout();
229229

230230
StackPtrTy = Type::getInt8PtrTy(M.getContext());
@@ -235,8 +235,7 @@ class SafeStack : public FunctionPass {
235235
return false;
236236
}
237237

238-
bool runOnFunction(Function &F);
239-
238+
bool runOnFunction(Function &F) override;
240239
}; // class SafeStack
241240

242241
Constant *SafeStack::getOrCreateUnsafeStackPtr(Module &M) {

0 commit comments

Comments
 (0)