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;
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();
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;
struct DebugLineUnsupportedVersionFixture : public TestWithParam<uint16_t>,
public CommonFixture {
- void SetUp() { Version = GetParam(); }
+ void SetUp() override { Version = GetParam(); }
uint16_t Version;
};
: 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();
}
: 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();
}
: 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();
}
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();
}
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) {
class DummyTrampolinePool : public orc::TrampolinePool {
public:
- Expected<JITTargetAddress> getTrampoline() {
+ Expected<JITTargetAddress> getTrampoline() override {
llvm_unreachable("Unimplemented");
}
};
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);
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);
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.
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);
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) {
};
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) {
struct IncrementGlobalCleanup : CrashRecoveryContextCleanup {
IncrementGlobalCleanup(CrashRecoveryContext *CRC)
: CrashRecoveryContextCleanup(CRC) {}
- virtual void recoverResources() { ++GlobalInt; }
+ void recoverResources() override { ++GlobalInt; }
};
static void noop() {}
// 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();
SourceMgr SM;
- void SetUp() {
+ void SetUp() override {
ExpressionFormat::Kind Kind = GetParam();
AllowHex = Kind == ExpressionFormat::Kind::HexLower ||
Kind == ExpressionFormat::Kind::HexUpper;
std::unique_ptr<Module> M;
Function *F = nullptr;
- void SetUp() {
+ void SetUp() override {
M = parseIR(C,
R"(
define void @f() !dbg !8 {
BasicFileAnalysisTest(StringRef Trip)
: SuccessfullyInitialised(false), Analysis(Trip) {}
protected:
- virtual void SetUp() {
+ void SetUp() override {
IgnoreDWARFFlag = true;
SuccessfullyInitialised = true;
if (auto Err = Analysis.initialiseDisassemblyMembers()) {
class BasicGraphBuilderTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
IgnoreDWARFFlag = true;
SuccessfullyInitialised = true;
if (auto Err = Analysis.initialiseDisassemblyMembers()) {
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);