1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[benchmark] Silence 'suggest override' and 'missing override' warnings

When building with Clang 11 on Windows, silence the following:

F:\aganea\llvm-project\llvm\utils\benchmark\include\benchmark/benchmark.h(955,8): warning: 'Run' overrides a member function but is not marked 'override' [-Wsuggest-override]
  void Run(State& st);
       ^
F:\aganea\llvm-project\llvm\utils\benchmark\include\benchmark/benchmark.h(895,16): note: overridden virtual function is here
  virtual void Run(State& state) = 0;
               ^
1 warning generated.
This commit is contained in:
Alexandre Ganea 2021-05-25 18:03:55 -04:00
parent 21ada5fffa
commit 27303db33a

View File

@ -952,7 +952,7 @@ class FunctionBenchmark : public Benchmark {
FunctionBenchmark(const char* name, Function* func)
: Benchmark(name), func_(func) {}
virtual void Run(State& st);
void Run(State& st) override;
private:
Function* func_;
@ -962,7 +962,7 @@ class FunctionBenchmark : public Benchmark {
template <class Lambda>
class LambdaBenchmark : public Benchmark {
public:
virtual void Run(State& st) { lambda_(st); }
void Run(State& st) override { lambda_(st); }
private:
template <class OLambda>
@ -1013,7 +1013,7 @@ class Fixture : public internal::Benchmark {
public:
Fixture() : internal::Benchmark("") {}
virtual void Run(State& st) {
void Run(State& st) override {
this->SetUp(st);
this->BenchmarkCase(st);
this->TearDown(st);
@ -1399,8 +1399,8 @@ public:
: output_options_(opts_), name_field_width_(0),
prev_counters_(), printed_header_(false) {}
virtual bool ReportContext(const Context& context);
virtual void ReportRuns(const std::vector<Run>& reports);
bool ReportContext(const Context& context) override;
void ReportRuns(const std::vector<Run>& reports) override;
protected:
virtual void PrintRunData(const Run& report);
@ -1415,9 +1415,9 @@ public:
class JSONReporter : public BenchmarkReporter {
public:
JSONReporter() : first_report_(true) {}
virtual bool ReportContext(const Context& context);
virtual void ReportRuns(const std::vector<Run>& reports);
virtual void Finalize();
bool ReportContext(const Context& context) override;
void ReportRuns(const std::vector<Run>& reports) override;
void Finalize() override;
private:
void PrintRunData(const Run& report);
@ -1428,8 +1428,8 @@ class JSONReporter : public BenchmarkReporter {
class CSVReporter : public BenchmarkReporter {
public:
CSVReporter() : printed_header_(false) {}
virtual bool ReportContext(const Context& context);
virtual void ReportRuns(const std::vector<Run>& reports);
bool ReportContext(const Context& context) override;
void ReportRuns(const std::vector<Run>& reports) override;
private:
void PrintRunData(const Run& report);