From: Gabe Black Date: Thu, 3 Jan 2019 21:57:27 +0000 (-0800) Subject: systemc: Replace sc_core::sc_type_index with std::type_index. X-Git-Tag: v19.0.0.0~1296 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29318390b5163c973878c859b8e769c96fa205e8;p=gem5.git systemc: Replace sc_core::sc_type_index with std::type_index. The former is either the same as the later, or a custom wrapper if C++11 isn't supported. Since we generally expect C++11 support, we can skip the indirection. Change-Id: I9a45e3854bb7cc56d094e3fe2773fe4b5c94403b Reviewed-on: https://gem5-review.googlesource.com/c/15297 Reviewed-by: Anthony Gutierrez Maintainer: Anthony Gutierrez --- diff --git a/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh b/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh index 29f3397b9..a494b683f 100644 --- a/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh +++ b/src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh @@ -21,6 +21,7 @@ #define __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_BASE_SOCKET_IF_H__ #include +#include namespace tlm { @@ -45,7 +46,7 @@ class tlm_base_socket_if virtual sc_core::sc_export_base &get_export_base() = 0; virtual sc_core::sc_export_base const &get_export_base() const = 0; virtual unsigned int get_bus_width() const = 0; - virtual sc_core::sc_type_index get_protocol_types() const = 0; + virtual std::type_index get_protocol_types() const = 0; virtual tlm_socket_category get_socket_category() const = 0; protected: diff --git a/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh b/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh index 91c147bc9..a7c53cc33 100644 --- a/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh +++ b/src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh @@ -20,6 +20,8 @@ #ifndef __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_INITIATOR_SOCKET_HH__ #define __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_INITIATOR_SOCKET_HH__ +#include + #include "tlm_core/2/interfaces/fw_bw_ifs.hh" #include "tlm_core/2/sockets/base_socket_if.hh" @@ -192,7 +194,7 @@ class tlm_initiator_socket : public tlm_base_initiator_socket< virtual const char *kind() const { return "tlm_initiator_socket"; } - virtual sc_core::sc_type_index + virtual std::type_index get_protocol_types() const { return typeid(TYPES); diff --git a/src/systemc/ext/tlm_core/2/sockets/target_socket.hh b/src/systemc/ext/tlm_core/2/sockets/target_socket.hh index b412a7d5c..4ca31c9b9 100644 --- a/src/systemc/ext/tlm_core/2/sockets/target_socket.hh +++ b/src/systemc/ext/tlm_core/2/sockets/target_socket.hh @@ -20,6 +20,8 @@ #ifndef __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_TARGET_SOCKET_HH__ #define __SYSTEMC_EXT_TLM_CORE_2_SOCKETS_TARGET_SOCKET_HH__ +#include + #include "tlm_core/2/interfaces/fw_bw_ifs.hh" #include "tlm_core/2/sockets/base_socket_if.hh" @@ -211,7 +213,7 @@ class tlm_target_socket : virtual const char* kind() const { return "tlm_target_socket"; } - virtual sc_core::sc_type_index + virtual std::type_index get_protocol_types() const { return typeid(TYPES); diff --git a/src/systemc/tlm_core/2/generic_payload/gp.cc b/src/systemc/tlm_core/2/generic_payload/gp.cc index ff3c92bd9..b42bdb836 100644 --- a/src/systemc/tlm_core/2/generic_payload/gp.cc +++ b/src/systemc/tlm_core/2/generic_payload/gp.cc @@ -21,8 +21,7 @@ #include #include #include - -using sc_core::sc_type_index; +#include namespace tlm { @@ -39,7 +38,7 @@ namespace class tlm_extension_registry { typedef unsigned int key_type; - typedef std::map type_map; + typedef std::map type_map; public: static tlm_extension_registry & instance() @@ -52,7 +51,7 @@ class tlm_extension_registry } unsigned int - register_extension(sc_type_index type) + register_extension(std::type_index type) { type_map::const_iterator it = ids_.find(type); diff --git a/src/systemc/tlm_core/2/generic_payload/phase.cc b/src/systemc/tlm_core/2/generic_payload/phase.cc index 2c8b1e1a0..a3fb93749 100644 --- a/src/systemc/tlm_core/2/generic_payload/phase.cc +++ b/src/systemc/tlm_core/2/generic_payload/phase.cc @@ -21,9 +21,9 @@ #include #include #include +#include using sc_core::sc_string_view; -using sc_core::sc_type_index; namespace tlm { @@ -43,7 +43,7 @@ struct tlm_phase_registry } unsigned int - register_phase(sc_type_index type, sc_string_view name) + register_phase(std::type_index type, sc_string_view name) { type_map::const_iterator it = ids_.find(type); @@ -77,7 +77,7 @@ struct tlm_phase_registry } private: - typedef std::map type_map; + typedef std::map type_map; typedef std::vector name_table; type_map ids_; diff --git a/src/systemc/tlm_utils/instance_specific_extensions.cc b/src/systemc/tlm_utils/instance_specific_extensions.cc index c0836cd67..91610dd02 100644 --- a/src/systemc/tlm_utils/instance_specific_extensions.cc +++ b/src/systemc/tlm_utils/instance_specific_extensions.cc @@ -23,6 +23,7 @@ #include #include #include +#include namespace tlm { @@ -40,7 +41,7 @@ namespace class ispex_registry // Copied from tlm_gp.cpp. { typedef unsigned int key_type; - typedef std::map type_map; + typedef std::map type_map; public: static ispex_registry & @@ -54,7 +55,7 @@ class ispex_registry // Copied from tlm_gp.cpp. } unsigned int - register_extension(sc_core::sc_type_index type) + register_extension(std::type_index type) { type_map::const_iterator it = ids_.find(type);