summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-01-03 13:57:27 -0800
committerGabe Black <gabeblack@google.com>2019-01-09 01:35:51 +0000
commit29318390b5163c973878c859b8e769c96fa205e8 (patch)
treefb26ea313a8797e440c825351db1621a25dde632 /src
parent5701aab0f17aec5d2f857fa00a75b8f5db617ec1 (diff)
downloadgem5-29318390b5163c973878c859b8e769c96fa205e8.tar.xz
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 <anthony.gutierrez@amd.com> Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/systemc/ext/tlm_core/2/sockets/base_socket_if.hh3
-rw-r--r--src/systemc/ext/tlm_core/2/sockets/initiator_socket.hh4
-rw-r--r--src/systemc/ext/tlm_core/2/sockets/target_socket.hh4
-rw-r--r--src/systemc/tlm_core/2/generic_payload/gp.cc7
-rw-r--r--src/systemc/tlm_core/2/generic_payload/phase.cc6
-rw-r--r--src/systemc/tlm_utils/instance_specific_extensions.cc5
6 files changed, 17 insertions, 12 deletions
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 <systemc>
+#include <typeindex>
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 <typeindex>
+
#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 <typeindex>
+
#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 <map>
#include <systemc>
#include <tlm>
-
-using sc_core::sc_type_index;
+#include <typeindex>
namespace tlm
{
@@ -39,7 +38,7 @@ namespace
class tlm_extension_registry
{
typedef unsigned int key_type;
- typedef std::map<sc_core::sc_type_index, key_type> type_map;
+ typedef std::map<std::type_index, key_type> 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 <map>
#include <systemc>
#include <tlm>
+#include <typeindex>
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<sc_type_index, key_type> type_map;
+ typedef std::map<std::type_index, key_type> type_map;
typedef std::vector<std::string> 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 <map>
#include <systemc>
#include <tlm>
+#include <typeindex>
namespace tlm
{
@@ -40,7 +41,7 @@ namespace
class ispex_registry // Copied from tlm_gp.cpp.
{
typedef unsigned int key_type;
- typedef std::map<sc_core::sc_type_index, key_type> type_map;
+ typedef std::map<std::type_index, key_type> 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);