summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-01-07 19:56:25 -0800
committerGabe Black <gabeblack@google.com>2018-01-20 07:31:50 +0000
commitb1ade08b2da4a0b398b69ea4eb2de35b08941826 (patch)
tree11bab348366bff951e63c7ed85da60567bec9aff
parent6a98856affaaec393dfc6c8f67750c27858cc94c (diff)
downloadgem5-b1ade08b2da4a0b398b69ea4eb2de35b08941826.tar.xz
base: Hide the BitUnion::__StorageType type.
Since this type is now accessible through a clean interface, hide it from anybody that tries to peak around the curtain. Change-Id: I1257b6675a45b8648be459ad8e8d0f27a6feee6b Reviewed-on: https://gem5-review.googlesource.com/7205 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/base/bitunion.hh10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/base/bitunion.hh b/src/base/bitunion.hh
index 10fa00508..6e7d223d2 100644
--- a/src/base/bitunion.hh
+++ b/src/base/bitunion.hh
@@ -291,8 +291,14 @@ namespace BitfieldBackend
class BitfieldUnderlyingClasses##name : \
public BitfieldBackend::BitfieldTypes<type> \
{ \
- public: \
+ protected: \
typedef type __StorageType; \
+ friend BitfieldBackend::BitUnionBaseType< \
+ BitfieldBackend::BitUnionOperators< \
+ BitfieldUnderlyingClasses##name> >; \
+ friend BitfieldBackend::BitUnionBaseType< \
+ BitfieldUnderlyingClasses##name>; \
+ public: \
union { \
type __storage;
@@ -388,6 +394,8 @@ namespace BitfieldBackend
template <typename T>
using BitUnionBaseType = typename BitfieldBackend::BitUnionBaseType<T>::Type;
+
+//An STL style hash structure for hashing BitUnions based on their base type.
namespace std
{
template <typename T>