From 78e5caef696b017b15447c2a12311e94961cfdb4 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 27 Nov 2019 04:11:52 -0800 Subject: [PATCH] systemc: Add a bunch of missing overrides to the systemc headers. Change-Id: I664d7b5e7c3b4dd6128d261c95fabaa3d1a97d88 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23125 Reviewed-by: Giacomo Travaglini Maintainer: Gabe Black Tested-by: kokoro --- src/systemc/ext/core/sc_export.hh | 10 +++++----- src/systemc/ext/core/sc_port.hh | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/systemc/ext/core/sc_export.hh b/src/systemc/ext/core/sc_export.hh index 100ce66db..fcbcd31ab 100644 --- a/src/systemc/ext/core/sc_export.hh +++ b/src/systemc/ext/core/sc_export.hh @@ -70,7 +70,7 @@ class sc_export : public sc_export_base {} virtual ~sc_export() {} - virtual const char *kind() const { return "sc_export"; } + virtual const char *kind() const override { return "sc_export"; } void operator () (IF &i) { bind(i); } virtual void @@ -109,9 +109,9 @@ class sc_export : public sc_export_base const sc_interface *get_interface() const override { return interface; } protected: - void before_end_of_elaboration() {} + void before_end_of_elaboration() override {} void - end_of_elaboration() + end_of_elaboration() override { if (!interface) { std::string msg = "export not bound: export '"; @@ -119,8 +119,8 @@ class sc_export : public sc_export_base SC_REPORT_ERROR("(E109) complete binding failed", msg.c_str()); } } - void start_of_simulation() {} - void end_of_simulation() {} + void start_of_simulation() override {} + void end_of_simulation() override {} private: IF *interface; diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh index 99e7ace2d..7399a1691 100644 --- a/src/systemc/ext/core/sc_port.hh +++ b/src/systemc/ext/core/sc_port.hh @@ -180,10 +180,10 @@ class sc_port_b : public sc_port_base } protected: - void before_end_of_elaboration() {} - void end_of_elaboration() {} - void start_of_simulation() {} - void end_of_simulation() {} + void before_end_of_elaboration() override {} + void end_of_elaboration() override {} + void start_of_simulation() override {} + void end_of_simulation() override {} explicit sc_port_b(int n, sc_port_policy p) : sc_port_base(sc_gen_unique_name("port"), n, p) @@ -195,7 +195,7 @@ class sc_port_b : public sc_port_base // Implementation defined, but depended on by the tests. int - vbind(sc_interface &i) + vbind(sc_interface &i) override { IF *interface = dynamic_cast(&i); if (!interface) @@ -204,7 +204,7 @@ class sc_port_b : public sc_port_base return 0; } int - vbind(sc_port_base &pb) + vbind(sc_port_base &pb) override { sc_port_b *p = dynamic_cast *>(&pb); if (!p) @@ -217,7 +217,7 @@ class sc_port_b : public sc_port_base std::vector _interfaces; sc_interface * - _gem5Interface(int n) const + _gem5Interface(int n) const override { if (n < 0 || n >= size()) { report_error(SC_ID_GET_IF_, "index out of range"); @@ -226,7 +226,7 @@ class sc_port_b : public sc_port_base return _interfaces[n]; } void - _gem5AddInterface(sc_interface *iface) + _gem5AddInterface(sc_interface *iface) override { IF *interface = dynamic_cast(iface); sc_assert(interface); @@ -239,7 +239,7 @@ class sc_port_b : public sc_port_base _interfaces.push_back(interface); } - const char *_ifTypeName() const { return typeid(IF).name(); } + const char *_ifTypeName() const override { return typeid(IF).name(); } // Disabled sc_port_b() {} @@ -289,14 +289,14 @@ class sc_port : public sc_port_b sc_port_b::bind(parent); } - virtual const char *kind() const { return "sc_port"; } + virtual const char *kind() const override { return "sc_port"; } private: // Disabled sc_port(const sc_port &) {} sc_port &operator = (const sc_port &) { return *this; } - virtual sc_port_policy _portPolicy() const { return P; } + virtual sc_port_policy _portPolicy() const override { return P; } }; } // namespace sc_core -- 2.30.2