1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +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) FunctionBenchmark(const char* name, Function* func)
: Benchmark(name), func_(func) {} : Benchmark(name), func_(func) {}
virtual void Run(State& st); void Run(State& st) override;
private: private:
Function* func_; Function* func_;
@ -962,7 +962,7 @@ class FunctionBenchmark : public Benchmark {
template <class Lambda> template <class Lambda>
class LambdaBenchmark : public Benchmark { class LambdaBenchmark : public Benchmark {
public: public:
virtual void Run(State& st) { lambda_(st); } void Run(State& st) override { lambda_(st); }
private: private:
template <class OLambda> template <class OLambda>
@ -1013,7 +1013,7 @@ class Fixture : public internal::Benchmark {
public: public:
Fixture() : internal::Benchmark("") {} Fixture() : internal::Benchmark("") {}
virtual void Run(State& st) { void Run(State& st) override {
this->SetUp(st); this->SetUp(st);
this->BenchmarkCase(st); this->BenchmarkCase(st);
this->TearDown(st); this->TearDown(st);
@ -1399,8 +1399,8 @@ public:
: output_options_(opts_), name_field_width_(0), : output_options_(opts_), name_field_width_(0),
prev_counters_(), printed_header_(false) {} prev_counters_(), printed_header_(false) {}
virtual bool ReportContext(const Context& context); bool ReportContext(const Context& context) override;
virtual void ReportRuns(const std::vector<Run>& reports); void ReportRuns(const std::vector<Run>& reports) override;
protected: protected:
virtual void PrintRunData(const Run& report); virtual void PrintRunData(const Run& report);
@ -1415,9 +1415,9 @@ public:
class JSONReporter : public BenchmarkReporter { class JSONReporter : public BenchmarkReporter {
public: public:
JSONReporter() : first_report_(true) {} JSONReporter() : first_report_(true) {}
virtual bool ReportContext(const Context& context); bool ReportContext(const Context& context) override;
virtual void ReportRuns(const std::vector<Run>& reports); void ReportRuns(const std::vector<Run>& reports) override;
virtual void Finalize(); void Finalize() override;
private: private:
void PrintRunData(const Run& report); void PrintRunData(const Run& report);
@ -1428,8 +1428,8 @@ class JSONReporter : public BenchmarkReporter {
class CSVReporter : public BenchmarkReporter { class CSVReporter : public BenchmarkReporter {
public: public:
CSVReporter() : printed_header_(false) {} CSVReporter() : printed_header_(false) {}
virtual bool ReportContext(const Context& context); bool ReportContext(const Context& context) override;
virtual void ReportRuns(const std::vector<Run>& reports); void ReportRuns(const std::vector<Run>& reports) override;
private: private:
void PrintRunData(const Run& report); void PrintRunData(const Run& report);