Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 3b89e52

Browse files
committed
[C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203444 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 49e139b commit 3b89e52

File tree

8 files changed

+131
-138
lines changed

8 files changed

+131
-138
lines changed

include/llvm/IR/InstrTypes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class BinaryOperator : public Instruction {
143143
const Twine &Name, Instruction *InsertBefore);
144144
BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
145145
const Twine &Name, BasicBlock *InsertAtEnd);
146-
virtual BinaryOperator *clone_impl() const override;
146+
BinaryOperator *clone_impl() const override;
147147
public:
148148
// allocate space for exactly two operands
149149
void *operator new(size_t s) {
@@ -385,7 +385,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryOperator, Value)
385385
/// if (isa<CastInst>(Instr)) { ... }
386386
/// @brief Base class of casting instructions.
387387
class CastInst : public UnaryInstruction {
388-
virtual void anchor() override;
388+
void anchor() override;
389389
protected:
390390
/// @brief Constructor with insert-before-instruction semantics for subclasses
391391
CastInst(Type *Ty, unsigned iType, Value *S,
@@ -647,7 +647,7 @@ class CmpInst : public Instruction {
647647
Value *LHS, Value *RHS, const Twine &Name,
648648
BasicBlock *InsertAtEnd);
649649

650-
virtual void anchor() override; // Out of line virtual method.
650+
void anchor() override; // Out of line virtual method.
651651
public:
652652
/// This enumeration lists the possible predicates for CmpInst subclasses.
653653
/// Values in the range 0-31 are reserved for FCmpInst, while values in the

include/llvm/MC/MCAssembler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class MCDataFragment : public MCEncodedFragmentWithFixups {
221221
}
222222

223223
SmallVectorImpl<char> &getContents() override { return Contents; }
224-
virtual const SmallVectorImpl<char> &getContents() const override {
224+
const SmallVectorImpl<char> &getContents() const override {
225225
return Contents;
226226
}
227227

lib/CodeGen/BasicTargetTransformInfo.cpp

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -43,76 +43,73 @@ class BasicTTI final : public ImmutablePass, public TargetTransformInfo {
4343
initializeBasicTTIPass(*PassRegistry::getPassRegistry());
4444
}
4545

46-
virtual void initializePass() override {
46+
void initializePass() override {
4747
pushTTIStack(this);
4848
}
4949

50-
virtual void getAnalysisUsage(AnalysisUsage &AU) const override {
50+
void getAnalysisUsage(AnalysisUsage &AU) const override {
5151
TargetTransformInfo::getAnalysisUsage(AU);
5252
}
5353

5454
/// Pass identification.
5555
static char ID;
5656

5757
/// Provide necessary pointer adjustments for the two base classes.
58-
virtual void *getAdjustedAnalysisPointer(const void *ID) override {
58+
void *getAdjustedAnalysisPointer(const void *ID) override {
5959
if (ID == &TargetTransformInfo::ID)
6060
return (TargetTransformInfo*)this;
6161
return this;
6262
}
6363

64-
virtual bool hasBranchDivergence() const override;
64+
bool hasBranchDivergence() const override;
6565

6666
/// \name Scalar TTI Implementations
6767
/// @{
6868

69-
virtual bool isLegalAddImmediate(int64_t imm) const override;
70-
virtual bool isLegalICmpImmediate(int64_t imm) const override;
71-
virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
72-
int64_t BaseOffset, bool HasBaseReg,
73-
int64_t Scale) const override;
74-
virtual int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV,
75-
int64_t BaseOffset, bool HasBaseReg,
76-
int64_t Scale) const override;
77-
virtual bool isTruncateFree(Type *Ty1, Type *Ty2) const override;
78-
virtual bool isTypeLegal(Type *Ty) const override;
79-
virtual unsigned getJumpBufAlignment() const override;
80-
virtual unsigned getJumpBufSize() const override;
81-
virtual bool shouldBuildLookupTables() const override;
82-
virtual bool haveFastSqrt(Type *Ty) const override;
83-
virtual void getUnrollingPreferences(
84-
Loop *L, UnrollingPreferences &UP) const override;
69+
bool isLegalAddImmediate(int64_t imm) const override;
70+
bool isLegalICmpImmediate(int64_t imm) const override;
71+
bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV,
72+
int64_t BaseOffset, bool HasBaseReg,
73+
int64_t Scale) const override;
74+
int getScalingFactorCost(Type *Ty, GlobalValue *BaseGV,
75+
int64_t BaseOffset, bool HasBaseReg,
76+
int64_t Scale) const override;
77+
bool isTruncateFree(Type *Ty1, Type *Ty2) const override;
78+
bool isTypeLegal(Type *Ty) const override;
79+
unsigned getJumpBufAlignment() const override;
80+
unsigned getJumpBufSize() const override;
81+
bool shouldBuildLookupTables() const override;
82+
bool haveFastSqrt(Type *Ty) const override;
83+
void getUnrollingPreferences(Loop *L,
84+
UnrollingPreferences &UP) const override;
8585

8686
/// @}
8787

8888
/// \name Vector TTI Implementations
8989
/// @{
9090

91-
virtual unsigned getNumberOfRegisters(bool Vector) const override;
92-
virtual unsigned getMaximumUnrollFactor() const override;
93-
virtual unsigned getRegisterBitWidth(bool Vector) const override;
94-
virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty,
95-
OperandValueKind,
96-
OperandValueKind) const override;
97-
virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
98-
int Index, Type *SubTp) const override;
99-
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
100-
Type *Src) const override;
101-
virtual unsigned getCFInstrCost(unsigned Opcode) const override;
102-
virtual unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
103-
Type *CondTy) const override;
104-
virtual unsigned getVectorInstrCost(unsigned Opcode, Type *Val,
105-
unsigned Index) const override;
106-
virtual unsigned getMemoryOpCost(unsigned Opcode, Type *Src,
107-
unsigned Alignment,
108-
unsigned AddressSpace) const override;
109-
virtual unsigned getIntrinsicInstrCost(
110-
Intrinsic::ID, Type *RetTy, ArrayRef<Type*> Tys) const override;
111-
virtual unsigned getNumberOfParts(Type *Tp) const override;
112-
virtual unsigned getAddressComputationCost(
113-
Type *Ty, bool IsComplex) const override;
114-
virtual unsigned getReductionCost(unsigned Opcode, Type *Ty,
115-
bool IsPairwise) const override;
91+
unsigned getNumberOfRegisters(bool Vector) const override;
92+
unsigned getMaximumUnrollFactor() const override;
93+
unsigned getRegisterBitWidth(bool Vector) const override;
94+
unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind,
95+
OperandValueKind) const override;
96+
unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
97+
int Index, Type *SubTp) const override;
98+
unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
99+
Type *Src) const override;
100+
unsigned getCFInstrCost(unsigned Opcode) const override;
101+
unsigned getCmpSelInstrCost(unsigned Opcode, Type *ValTy,
102+
Type *CondTy) const override;
103+
unsigned getVectorInstrCost(unsigned Opcode, Type *Val,
104+
unsigned Index) const override;
105+
unsigned getMemoryOpCost(unsigned Opcode, Type *Src, unsigned Alignment,
106+
unsigned AddressSpace) const override;
107+
unsigned getIntrinsicInstrCost(Intrinsic::ID, Type *RetTy,
108+
ArrayRef<Type*> Tys) const override;
109+
unsigned getNumberOfParts(Type *Tp) const override;
110+
unsigned getAddressComputationCost( Type *Ty, bool IsComplex) const override;
111+
unsigned getReductionCost(unsigned Opcode, Type *Ty,
112+
bool IsPairwise) const override;
116113

117114
/// @}
118115
};

lib/CodeGen/MachineScheduler.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,29 +2444,29 @@ class GenericScheduler : public GenericSchedulerBase {
24442444
GenericSchedulerBase(C), DAG(0), Top(SchedBoundary::TopQID, "TopQ"),
24452445
Bot(SchedBoundary::BotQID, "BotQ") {}
24462446

2447-
virtual void initPolicy(MachineBasicBlock::iterator Begin,
2448-
MachineBasicBlock::iterator End,
2449-
unsigned NumRegionInstrs) override;
2447+
void initPolicy(MachineBasicBlock::iterator Begin,
2448+
MachineBasicBlock::iterator End,
2449+
unsigned NumRegionInstrs) override;
24502450

2451-
virtual bool shouldTrackPressure() const override {
2451+
bool shouldTrackPressure() const override {
24522452
return RegionPolicy.ShouldTrackPressure;
24532453
}
24542454

2455-
virtual void initialize(ScheduleDAGMI *dag) override;
2455+
void initialize(ScheduleDAGMI *dag) override;
24562456

2457-
virtual SUnit *pickNode(bool &IsTopNode) override;
2457+
SUnit *pickNode(bool &IsTopNode) override;
24582458

2459-
virtual void schedNode(SUnit *SU, bool IsTopNode) override;
2459+
void schedNode(SUnit *SU, bool IsTopNode) override;
24602460

2461-
virtual void releaseTopNode(SUnit *SU) override {
2461+
void releaseTopNode(SUnit *SU) override {
24622462
Top.releaseTopNode(SU);
24632463
}
24642464

2465-
virtual void releaseBottomNode(SUnit *SU) override {
2465+
void releaseBottomNode(SUnit *SU) override {
24662466
Bot.releaseBottomNode(SU);
24672467
}
24682468

2469-
virtual void registerRoots() override;
2469+
void registerRoots() override;
24702470

24712471
protected:
24722472
void checkAcyclicLatency();
@@ -3037,16 +3037,16 @@ class PostGenericScheduler : public GenericSchedulerBase {
30373037

30383038
virtual ~PostGenericScheduler() {}
30393039

3040-
virtual void initPolicy(MachineBasicBlock::iterator Begin,
3041-
MachineBasicBlock::iterator End,
3042-
unsigned NumRegionInstrs) override {
3040+
void initPolicy(MachineBasicBlock::iterator Begin,
3041+
MachineBasicBlock::iterator End,
3042+
unsigned NumRegionInstrs) override {
30433043
/* no configurable policy */
30443044
};
30453045

30463046
/// PostRA scheduling does not track pressure.
3047-
virtual bool shouldTrackPressure() const override { return false; }
3047+
bool shouldTrackPressure() const override { return false; }
30483048

3049-
virtual void initialize(ScheduleDAGMI *Dag) override {
3049+
void initialize(ScheduleDAGMI *Dag) override {
30503050
DAG = Dag;
30513051
SchedModel = DAG->getSchedModel();
30523052
TRI = DAG->TRI;
@@ -3065,22 +3065,22 @@ class PostGenericScheduler : public GenericSchedulerBase {
30653065
}
30663066
}
30673067

3068-
virtual void registerRoots() override;
3068+
void registerRoots() override;
30693069

3070-
virtual SUnit *pickNode(bool &IsTopNode) override;
3070+
SUnit *pickNode(bool &IsTopNode) override;
30713071

3072-
virtual void scheduleTree(unsigned SubtreeID) override {
3072+
void scheduleTree(unsigned SubtreeID) override {
30733073
llvm_unreachable("PostRA scheduler does not support subtree analysis.");
30743074
}
30753075

3076-
virtual void schedNode(SUnit *SU, bool IsTopNode) override;
3076+
void schedNode(SUnit *SU, bool IsTopNode) override;
30773077

3078-
virtual void releaseTopNode(SUnit *SU) override {
3078+
void releaseTopNode(SUnit *SU) override {
30793079
Top.releaseTopNode(SU);
30803080
}
30813081

30823082
// Only called for roots.
3083-
virtual void releaseBottomNode(SUnit *SU) override {
3083+
void releaseBottomNode(SUnit *SU) override {
30843084
BotRoots.push_back(SU);
30853085
}
30863086

lib/Target/ARM/ARMAsmPrinter.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,36 +49,36 @@ class LLVM_LIBRARY_VISIBILITY ARMAsmPrinter : public AsmPrinter {
4949
Subtarget = &TM.getSubtarget<ARMSubtarget>();
5050
}
5151

52-
virtual const char *getPassName() const override {
52+
const char *getPassName() const override {
5353
return "ARM Assembly / Object Emitter";
5454
}
5555

5656
void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &O,
5757
const char *Modifier = 0);
5858

59-
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
60-
unsigned AsmVariant, const char *ExtraCode,
61-
raw_ostream &O) override;
62-
virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
63-
unsigned AsmVariant, const char *ExtraCode,
64-
raw_ostream &O) override;
59+
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
60+
unsigned AsmVariant, const char *ExtraCode,
61+
raw_ostream &O) override;
62+
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
63+
unsigned AsmVariant, const char *ExtraCode,
64+
raw_ostream &O) override;
6565

66-
virtual void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
67-
const MCSubtargetInfo *EndInfo) const override;
66+
void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo,
67+
const MCSubtargetInfo *EndInfo) const override;
6868

6969
void EmitJumpTable(const MachineInstr *MI);
7070
void EmitJump2Table(const MachineInstr *MI);
71-
virtual void EmitInstruction(const MachineInstr *MI) override;
72-
virtual bool runOnMachineFunction(MachineFunction &F) override;
71+
void EmitInstruction(const MachineInstr *MI) override;
72+
bool runOnMachineFunction(MachineFunction &F) override;
7373

74-
virtual void EmitConstantPool() override {
74+
void EmitConstantPool() override {
7575
// we emit constant pools customly!
7676
}
77-
virtual void EmitFunctionBodyEnd() override;
78-
virtual void EmitFunctionEntryLabel() override;
79-
virtual void EmitStartOfAsmFile(Module &M) override;
80-
virtual void EmitEndOfAsmFile(Module &M) override;
81-
virtual void EmitXXStructor(const Constant *CV) override;
77+
void EmitFunctionBodyEnd() override;
78+
void EmitFunctionEntryLabel() override;
79+
void EmitStartOfAsmFile(Module &M) override;
80+
void EmitEndOfAsmFile(Module &M) override;
81+
void EmitXXStructor(const Constant *CV) override;
8282

8383
// lowerOperand - Convert a MachineOperand into the equivalent MCOperand.
8484
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp);
@@ -97,7 +97,7 @@ class LLVM_LIBRARY_VISIBILITY ARMAsmPrinter : public AsmPrinter {
9797
const MachineInstr *MI);
9898

9999
public:
100-
virtual unsigned getISAEncoding() override {
100+
unsigned getISAEncoding() override {
101101
// ARM/Darwin adds ISA to the DWARF info for each function.
102102
if (!Subtarget->isTargetMachO())
103103
return 0;
@@ -116,8 +116,7 @@ class LLVM_LIBRARY_VISIBILITY ARMAsmPrinter : public AsmPrinter {
116116
public:
117117
/// EmitMachineConstantPoolValue - Print a machine constantpool value to
118118
/// the .s file.
119-
virtual void
120-
EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
119+
void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) override;
121120
};
122121
} // end namespace llvm
123122

lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ namespace {
2929
X86WinCOFFObjectWriter(bool Is64Bit_);
3030
virtual ~X86WinCOFFObjectWriter();
3131

32-
virtual unsigned getRelocType(const MCValue &Target,
33-
const MCFixup &Fixup,
34-
bool IsCrossSection) const override;
32+
unsigned getRelocType(const MCValue &Target, const MCFixup &Fixup,
33+
bool IsCrossSection) const override;
3534
};
3635
}
3736

lib/Target/X86/X86AsmPrinter.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
3333
Subtarget = &TM.getSubtarget<X86Subtarget>();
3434
}
3535

36-
virtual const char *getPassName() const override {
36+
const char *getPassName() const override {
3737
return "X86 Assembly / Object Emitter";
3838
}
3939

4040
const X86Subtarget &getSubtarget() const { return *Subtarget; }
4141

42-
virtual void EmitStartOfAsmFile(Module &M) override;
42+
void EmitStartOfAsmFile(Module &M) override;
4343

44-
virtual void EmitEndOfAsmFile(Module &M) override;
44+
void EmitEndOfAsmFile(Module &M) override;
4545

46-
virtual void EmitInstruction(const MachineInstr *MI) override;
46+
void EmitInstruction(const MachineInstr *MI) override;
4747

48-
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
49-
unsigned AsmVariant, const char *ExtraCode,
50-
raw_ostream &OS) override;
51-
virtual bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
52-
unsigned AsmVariant, const char *ExtraCode,
53-
raw_ostream &OS) override;
48+
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
49+
unsigned AsmVariant, const char *ExtraCode,
50+
raw_ostream &OS) override;
51+
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
52+
unsigned AsmVariant, const char *ExtraCode,
53+
raw_ostream &OS) override;
5454

55-
virtual bool runOnMachineFunction(MachineFunction &F) override;
55+
bool runOnMachineFunction(MachineFunction &F) override;
5656
};
5757

5858
} // end namespace llvm

0 commit comments

Comments
 (0)