mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[llvm][NFC] Add missing 'override's in unittests/
This commit is contained in:
parent
9627b7997d
commit
951866abd5
@ -105,7 +105,7 @@ TEST(TwineTest, LazyEvaluation) {
|
||||
explicit formatter(int &Count) : FormatAdapter(0), Count(Count) {}
|
||||
int &Count;
|
||||
|
||||
void format(raw_ostream &OS, StringRef Style) { ++Count; }
|
||||
void format(raw_ostream &OS, StringRef Style) override { ++Count; }
|
||||
};
|
||||
|
||||
int Count = 0;
|
||||
|
@ -64,11 +64,11 @@ namespace {
|
||||
|
||||
class MockCallbacks : public TypeVisitorCallbacks {
|
||||
public:
|
||||
virtual Error visitTypeBegin(CVType &CVR, TypeIndex Index) {
|
||||
Error visitTypeBegin(CVType &CVR, TypeIndex Index) override {
|
||||
Indices.push_back(Index);
|
||||
return Error::success();
|
||||
}
|
||||
virtual Error visitKnownRecord(CVType &CVR, ArrayRecord &AR) {
|
||||
Error visitKnownRecord(CVType &CVR, ArrayRecord &AR) override {
|
||||
VisitedRecords.push_back(AR);
|
||||
RawRecords.push_back(CVR);
|
||||
return Error::success();
|
||||
|
@ -126,7 +126,7 @@ struct DebugLineBasicFixture : public Test, public CommonFixture {};
|
||||
struct DebugLineParameterisedFixture
|
||||
: public TestWithParam<std::pair<uint16_t, DwarfFormat>>,
|
||||
public CommonFixture {
|
||||
void SetUp() { std::tie(Version, Format) = GetParam(); }
|
||||
void SetUp() override { std::tie(Version, Format) = GetParam(); }
|
||||
|
||||
uint16_t Version;
|
||||
DwarfFormat Format;
|
||||
@ -328,7 +328,7 @@ TEST_F(DebugLineBasicFixture, ErrorForReservedLength) {
|
||||
|
||||
struct DebugLineUnsupportedVersionFixture : public TestWithParam<uint16_t>,
|
||||
public CommonFixture {
|
||||
void SetUp() { Version = GetParam(); }
|
||||
void SetUp() override { Version = GetParam(); }
|
||||
|
||||
uint16_t Version;
|
||||
};
|
||||
@ -1384,7 +1384,7 @@ struct TruncatedPrologueFixture
|
||||
: public TestWithParam<
|
||||
std::tuple<uint64_t, uint64_t, uint16_t, DwarfFormat, StringRef>>,
|
||||
public CommonFixture {
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
std::tie(Length, ExpectedOffset, Version, Format, ExpectedErr) = GetParam();
|
||||
}
|
||||
|
||||
@ -1554,7 +1554,7 @@ struct TruncatedStandardOpcodeFixture
|
||||
: public TestWithParam<
|
||||
std::tuple<uint64_t, uint8_t, ValueAndLengths, StringRef, StringRef>>,
|
||||
public TruncatedOpcodeFixtureBase {
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
std::tie(BodyLength, Opcode, Operands, ExpectedOutput, ExpectedErr) =
|
||||
GetParam();
|
||||
}
|
||||
@ -1564,7 +1564,7 @@ struct TruncatedExtendedOpcodeFixture
|
||||
: public TestWithParam<std::tuple<uint64_t, uint64_t, uint8_t,
|
||||
ValueAndLengths, StringRef, StringRef>>,
|
||||
public TruncatedOpcodeFixtureBase {
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
std::tie(BodyLength, OpcodeLength, Opcode, Operands, ExpectedOutput,
|
||||
ExpectedErr) = GetParam();
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ using ParamType = std::tuple<Form, uint16_t, uint8_t, DwarfFormat,
|
||||
ArrayRef<uint8_t>, uint64_t, bool>;
|
||||
|
||||
struct FormSkipValueFixtureBase : public testing::TestWithParam<ParamType> {
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
std::tie(Fm, Version, AddrSize, Dwarf, InitialData, ExpectedSkipped,
|
||||
ExpectedResult) = GetParam();
|
||||
}
|
||||
|
@ -1044,7 +1044,7 @@ TEST_F(CoreAPIsStandardTest, GeneratorTest) {
|
||||
TestGenerator(SymbolMap Symbols) : Symbols(std::move(Symbols)) {}
|
||||
Error tryToGenerate(LookupKind K, JITDylib &JD,
|
||||
JITDylibLookupFlags JDLookupFlags,
|
||||
const SymbolLookupSet &Names) {
|
||||
const SymbolLookupSet &Names) override {
|
||||
SymbolMap NewDefs;
|
||||
|
||||
for (const auto &KV : Names) {
|
||||
|
@ -17,7 +17,7 @@ namespace {
|
||||
|
||||
class DummyTrampolinePool : public orc::TrampolinePool {
|
||||
public:
|
||||
Expected<JITTargetAddress> getTrampoline() {
|
||||
Expected<JITTargetAddress> getTrampoline() override {
|
||||
llvm_unreachable("Unimplemented");
|
||||
}
|
||||
};
|
||||
|
@ -117,7 +117,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestOverrideObjectFlags) {
|
||||
public:
|
||||
FunkySimpleCompiler(TargetMachine &TM) : SimpleCompiler(TM) {}
|
||||
|
||||
Expected<CompileResult> operator()(Module &M) {
|
||||
Expected<CompileResult> operator()(Module &M) override {
|
||||
auto *Foo = M.getFunction("foo");
|
||||
assert(Foo && "Expected function Foo not found");
|
||||
Foo->setVisibility(GlobalValue::HiddenVisibility);
|
||||
@ -187,7 +187,7 @@ TEST(RTDyldObjectLinkingLayerTest, TestAutoClaimResponsibilityForSymbols) {
|
||||
public:
|
||||
FunkySimpleCompiler(TargetMachine &TM) : SimpleCompiler(TM) {}
|
||||
|
||||
Expected<CompileResult> operator()(Module &M) {
|
||||
Expected<CompileResult> operator()(Module &M) override {
|
||||
Function *BarImpl = Function::Create(
|
||||
FunctionType::get(Type::getVoidTy(M.getContext()), {}, false),
|
||||
GlobalValue::ExternalLinkage, "bar", &M);
|
||||
|
@ -355,12 +355,12 @@ namespace llvm {
|
||||
struct CustomOptPassGate : public OptPassGate {
|
||||
bool Skip;
|
||||
CustomOptPassGate(bool Skip) : Skip(Skip) { }
|
||||
bool shouldRunPass(const Pass *P, StringRef IRDescription) {
|
||||
bool shouldRunPass(const Pass *P, StringRef IRDescription) override {
|
||||
if (P->getPassKind() == PT_Module)
|
||||
return !Skip;
|
||||
return OptPassGate::shouldRunPass(P, IRDescription);
|
||||
}
|
||||
bool isEnabled() const { return true; }
|
||||
bool isEnabled() const override { return true; }
|
||||
};
|
||||
|
||||
// Optional module pass.
|
||||
|
@ -56,7 +56,7 @@ TEST(ModuleTest, randomNumberGenerator) {
|
||||
static char ID;
|
||||
struct DummyPass : ModulePass {
|
||||
DummyPass() : ModulePass(ID) {}
|
||||
bool runOnModule(Module &) { return true; }
|
||||
bool runOnModule(Module &) override { return true; }
|
||||
} DP;
|
||||
|
||||
Module M("R", Context);
|
||||
|
@ -39,7 +39,7 @@ struct InstrProfTest : ::testing::Test {
|
||||
InstrProfWriter Writer;
|
||||
std::unique_ptr<IndexedInstrProfReader> Reader;
|
||||
|
||||
void SetUp() { Writer.setOutputSparse(false); }
|
||||
void SetUp() override { Writer.setOutputSparse(false); }
|
||||
|
||||
void readProfile(std::unique_ptr<MemoryBuffer> Profile,
|
||||
std::unique_ptr<MemoryBuffer> Remapping = nullptr) {
|
||||
@ -51,12 +51,12 @@ struct InstrProfTest : ::testing::Test {
|
||||
};
|
||||
|
||||
struct SparseInstrProfTest : public InstrProfTest {
|
||||
void SetUp() { Writer.setOutputSparse(true); }
|
||||
void SetUp() override { Writer.setOutputSparse(true); }
|
||||
};
|
||||
|
||||
struct MaybeSparseInstrProfTest : public InstrProfTest,
|
||||
public ::testing::WithParamInterface<bool> {
|
||||
void SetUp() { Writer.setOutputSparse(GetParam()); }
|
||||
void SetUp() override { Writer.setOutputSparse(GetParam()); }
|
||||
};
|
||||
|
||||
TEST_P(MaybeSparseInstrProfTest, write_and_read_empty_profile) {
|
||||
|
@ -39,7 +39,7 @@ TEST(CrashRecoveryTest, Basic) {
|
||||
struct IncrementGlobalCleanup : CrashRecoveryContextCleanup {
|
||||
IncrementGlobalCleanup(CrashRecoveryContext *CRC)
|
||||
: CrashRecoveryContextCleanup(CRC) {}
|
||||
virtual void recoverResources() { ++GlobalInt; }
|
||||
void recoverResources() override { ++GlobalInt; }
|
||||
};
|
||||
|
||||
static void noop() {}
|
||||
|
@ -17,7 +17,7 @@ static const TagNameMap emptyTagNameMap;
|
||||
|
||||
// This class is used to test the common part of the ELF attribute section.
|
||||
class AttributeHeaderParser : public ELFAttributeParser {
|
||||
Error handler(uint64_t tag, bool &handled) {
|
||||
Error handler(uint64_t tag, bool &handled) override {
|
||||
// Treat all attributes as handled.
|
||||
handled = true;
|
||||
return Error::success();
|
||||
|
@ -104,7 +104,7 @@ struct ExpressionFormatParameterisedFixture
|
||||
|
||||
SourceMgr SM;
|
||||
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
ExpressionFormat::Kind Kind = GetParam();
|
||||
AllowHex = Kind == ExpressionFormat::Kind::HexLower ||
|
||||
Kind == ExpressionFormat::Kind::HexUpper;
|
||||
|
@ -489,7 +489,7 @@ struct SalvageDebugInfoTest : ::testing::Test {
|
||||
std::unique_ptr<Module> M;
|
||||
Function *F = nullptr;
|
||||
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
M = parseIR(C,
|
||||
R"(
|
||||
define void @f() !dbg !8 {
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
BasicFileAnalysisTest(StringRef Trip)
|
||||
: SuccessfullyInitialised(false), Analysis(Trip) {}
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
IgnoreDWARFFlag = true;
|
||||
SuccessfullyInitialised = true;
|
||||
if (auto Err = Analysis.initialiseDisassemblyMembers()) {
|
||||
|
@ -124,7 +124,7 @@ public:
|
||||
|
||||
class BasicGraphBuilderTest : public ::testing::Test {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
IgnoreDWARFFlag = true;
|
||||
SuccessfullyInitialised = true;
|
||||
if (auto Err = Analysis.initialiseDisassemblyMembers()) {
|
||||
|
@ -29,7 +29,7 @@ using testing::UnorderedElementsAre;
|
||||
|
||||
class X86SnippetRepetitorTest : public X86TestBase {
|
||||
protected:
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
TM = State.createTargetMachine();
|
||||
Context = std::make_unique<LLVMContext>();
|
||||
Mod = std::make_unique<Module>("X86SnippetRepetitorTest", *Context);
|
||||
|
Loading…
x
Reference in New Issue
Block a user