Gabe Black has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/13877 )
Change subject: systemc: Move a function after the class it uses internally.
......................................................................
systemc: Move a function after the class it uses internally.
The class was defined, but only later in the file. By putting the
function definition later, clang stops reporting an error.
Change-Id: Id4dd1ec3f3a06f4d1dc10ef4ff8c545d98a6ae12
Reviewed-on: https://gem5-review.googlesource.com/c/13877
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/ext/core/sc_event.hh
1 file changed, 24 insertions(+), 16 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
diff --git a/src/systemc/ext/core/sc_event.hh
b/src/systemc/ext/core/sc_event.hh
index 56ee24f..e2164f4 100644
--- a/src/systemc/ext/core/sc_event.hh
+++ b/src/systemc/ext/core/sc_event.hh
@@ -236,23 +236,9 @@
virtual ~sc_event_finder_t() {}
- const sc_port_base *port() const { return _port; }
+ const sc_port_base *port() const override { return _port; }
- const sc_event &
- find_event(sc_interface *if_p=NULL) const override
- {
- static const sc_gem5::InternalScEvent none;
- const IF *iface = if_p ? dynamic_cast<const IF *>(if_p) :
- dynamic_cast<const IF *>(_port->get_interface());
- if (!iface) {
- std::ostringstream ss;
- ss << "port is not bound: port '" << _port->name() << "' (" <<
- _port->kind() << ")";
- SC_REPORT_ERROR(SC_ID_FIND_EVENT_, ss.str().c_str());
- return none;
- }
- return (const_cast<IF *>(iface)->*_method)();
- }
+ const sc_event &find_event(sc_interface *if_p=NULL) const override;
private:
const sc_port_b<IF> *_port;
@@ -276,4 +262,26 @@
} // namespace sc_gem5
+namespace sc_core
+{
+
+template <class IF>
+const sc_event &
+sc_event_finder_t<IF>::find_event(sc_interface *if_p) const
+{
+ static const sc_gem5::InternalScEvent none;
+ const IF *iface = if_p ? dynamic_cast<const IF *>(if_p) :
+ dynamic_cast<const IF *>(_port->get_interface());
+ if (!iface) {
+ std::ostringstream ss;
+ ss << "port is not bound: port '" << _port->name() << "' (" <<
+ _port->kind() << ")";
+ SC_REPORT_ERROR(SC_ID_FIND_EVENT_, ss.str().c_str());
+ return none;
+ }
+ return (const_cast<IF *>(iface)->*_method)();
+}
+
+} // namespace sc_core
+
#endif //__SYSTEMC_EXT_CORE_SC_INTERFACE_HH__
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13877
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Id4dd1ec3f3a06f4d1dc10ef4ff8c545d98a6ae12
Gerrit-Change-Number: 13877
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev