Skip to content

Commit 31eb834

Browse files
committed
[llvm][NFC] Add missing 'override's in unittests/
1 parent 1bbed69 commit 31eb834

File tree

17 files changed

+26
-26
lines changed

17 files changed

+26
-26
lines changed

llvm/unittests/ADT/TwineTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ TEST(TwineTest, LazyEvaluation) {
105105
explicit formatter(int &Count) : FormatAdapter(0), Count(Count) {}
106106
int &Count;
107107

108-
void format(raw_ostream &OS, StringRef Style) { ++Count; }
108+
void format(raw_ostream &OS, StringRef Style) override { ++Count; }
109109
};
110110

111111
int Count = 0;

llvm/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ namespace {
6464

6565
class MockCallbacks : public TypeVisitorCallbacks {
6666
public:
67-
virtual Error visitTypeBegin(CVType &CVR, TypeIndex Index) {
67+
Error visitTypeBegin(CVType &CVR, TypeIndex Index) override {
6868
Indices.push_back(Index);
6969
return Error::success();
7070
}
71-
virtual Error visitKnownRecord(CVType &CVR, ArrayRecord &AR) {
71+
Error visitKnownRecord(CVType &CVR, ArrayRecord &AR) override {
7272
VisitedRecords.push_back(AR);
7373
RawRecords.push_back(CVR);
7474
return Error::success();

llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct DebugLineBasicFixture : public Test, public CommonFixture {};
126126
struct DebugLineParameterisedFixture
127127
: public TestWithParam<std::pair<uint16_t, DwarfFormat>>,
128128
public CommonFixture {
129-
void SetUp() { std::tie(Version, Format) = GetParam(); }
129+
void SetUp() override { std::tie(Version, Format) = GetParam(); }
130130

131131
uint16_t Version;
132132
DwarfFormat Format;
@@ -328,7 +328,7 @@ TEST_F(DebugLineBasicFixture, ErrorForReservedLength) {
328328

329329
struct DebugLineUnsupportedVersionFixture : public TestWithParam<uint16_t>,
330330
public CommonFixture {
331-
void SetUp() { Version = GetParam(); }
331+
void SetUp() override { Version = GetParam(); }
332332

333333
uint16_t Version;
334334
};
@@ -1384,7 +1384,7 @@ struct TruncatedPrologueFixture
13841384
: public TestWithParam<
13851385
std::tuple<uint64_t, uint64_t, uint16_t, DwarfFormat, StringRef>>,
13861386
public CommonFixture {
1387-
void SetUp() {
1387+
void SetUp() override {
13881388
std::tie(Length, ExpectedOffset, Version, Format, ExpectedErr) = GetParam();
13891389
}
13901390

@@ -1554,7 +1554,7 @@ struct TruncatedStandardOpcodeFixture
15541554
: public TestWithParam<
15551555
std::tuple<uint64_t, uint8_t, ValueAndLengths, StringRef, StringRef>>,
15561556
public TruncatedOpcodeFixtureBase {
1557-
void SetUp() {
1557+
void SetUp() override {
15581558
std::tie(BodyLength, Opcode, Operands, ExpectedOutput, ExpectedErr) =
15591559
GetParam();
15601560
}
@@ -1564,7 +1564,7 @@ struct TruncatedExtendedOpcodeFixture
15641564
: public TestWithParam<std::tuple<uint64_t, uint64_t, uint8_t,
15651565
ValueAndLengths, StringRef, StringRef>>,
15661566
public TruncatedOpcodeFixtureBase {
1567-
void SetUp() {
1567+
void SetUp() override {
15681568
std::tie(BodyLength, OpcodeLength, Opcode, Operands, ExpectedOutput,
15691569
ExpectedErr) = GetParam();
15701570
}

llvm/unittests/DebugInfo/DWARF/DWARFFormValueTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ using ParamType = std::tuple<Form, uint16_t, uint8_t, DwarfFormat,
125125
ArrayRef<uint8_t>, uint64_t, bool>;
126126

127127
struct FormSkipValueFixtureBase : public testing::TestWithParam<ParamType> {
128-
void SetUp() {
128+
void SetUp() override {
129129
std::tie(Fm, Version, AddrSize, Dwarf, InitialData, ExpectedSkipped,
130130
ExpectedResult) = GetParam();
131131
}

llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ TEST_F(CoreAPIsStandardTest, GeneratorTest) {
10441044
TestGenerator(SymbolMap Symbols) : Symbols(std::move(Symbols)) {}
10451045
Error tryToGenerate(LookupKind K, JITDylib &JD,
10461046
JITDylibLookupFlags JDLookupFlags,
1047-
const SymbolLookupSet &Names) {
1047+
const SymbolLookupSet &Names) override {
10481048
SymbolMap NewDefs;
10491049

10501050
for (const auto &KV : Names) {

llvm/unittests/ExecutionEngine/Orc/LegacyCompileOnDemandLayerTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace {
1717

1818
class DummyTrampolinePool : public orc::TrampolinePool {
1919
public:
20-
Expected<JITTargetAddress> getTrampoline() {
20+
Expected<JITTargetAddress> getTrampoline() override {
2121
llvm_unreachable("Unimplemented");
2222
}
2323
};

llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) {
117117
public:
118118
FunkySimpleCompiler(TargetMachine &TM) : SimpleCompiler(TM) {}
119119

120-
Expected<CompileResult> operator()(Module &M) {
120+
Expected<CompileResult> operator()(Module &M) override {
121121
auto *Foo = M.getFunction("foo");
122122
assert(Foo && "Expected function Foo not found");
123123
Foo->setVisibility(GlobalValue::HiddenVisibility);
@@ -187,7 +187,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) {
187187
public:
188188
FunkySimpleCompiler(TargetMachine &TM) : SimpleCompiler(TM) {}
189189

190-
Expected<CompileResult> operator()(Module &M) {
190+
Expected<CompileResult> operator()(Module &M) override {
191191
Function *BarImpl = Function::Create(
192192
FunctionType::get(Type::getVoidTy(M.getContext()), {}, false),
193193
GlobalValue::ExternalLinkage, "bar", &M);

llvm/unittests/IR/LegacyPassManagerTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,12 @@ namespace llvm {
355355
struct CustomOptPassGate : public OptPassGate {
356356
bool Skip;
357357
CustomOptPassGate(bool Skip) : Skip(Skip) { }
358-
bool shouldRunPass(const Pass *P, StringRef IRDescription) {
358+
bool shouldRunPass(const Pass *P, StringRef IRDescription) override {
359359
if (P->getPassKind() == PT_Module)
360360
return !Skip;
361361
return OptPassGate::shouldRunPass(P, IRDescription);
362362
}
363-
bool isEnabled() const { return true; }
363+
bool isEnabled() const override { return true; }
364364
};
365365

366366
// Optional module pass.

llvm/unittests/IR/ModuleTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TEST(ModuleTest, randomNumberGenerator) {
5656
static char ID;
5757
struct DummyPass : ModulePass {
5858
DummyPass() : ModulePass(ID) {}
59-
bool runOnModule(Module &) { return true; }
59+
bool runOnModule(Module &) override { return true; }
6060
} DP;
6161

6262
Module M("R", Context);

llvm/unittests/ProfileData/InstrProfTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct InstrProfTest : ::testing::Test {
3939
InstrProfWriter Writer;
4040
std::unique_ptr<IndexedInstrProfReader> Reader;
4141

42-
void SetUp() { Writer.setOutputSparse(false); }
42+
void SetUp() override { Writer.setOutputSparse(false); }
4343

4444
void readProfile(std::unique_ptr<MemoryBuffer> Profile,
4545
std::unique_ptr<MemoryBuffer> Remapping = nullptr) {
@@ -51,12 +51,12 @@ struct InstrProfTest : ::testing::Test {
5151
};
5252

5353
struct SparseInstrProfTest : public InstrProfTest {
54-
void SetUp() { Writer.setOutputSparse(true); }
54+
void SetUp() override { Writer.setOutputSparse(true); }
5555
};
5656

5757
struct MaybeSparseInstrProfTest : public InstrProfTest,
5858
public ::testing::WithParamInterface<bool> {
59-
void SetUp() { Writer.setOutputSparse(GetParam()); }
59+
void SetUp() override { Writer.setOutputSparse(GetParam()); }
6060
};
6161

6262
TEST_P(MaybeSparseInstrProfTest, write_and_read_empty_profile) {

0 commit comments

Comments
 (0)