misc: Rename BitfieldBackend namespace as bitfield_backend

As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.

::BitfieldBackend became ::bitfield_backend.

Change-Id: Ibf6c5a93baa9b07aab84dc4ee98960a57d925eaf
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45425
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
This commit is contained in:
Daniel R. Carvalho
2021-05-06 20:30:07 -03:00
committed by Daniel Carvalho
parent 450b679374
commit 2feca3388f

View File

@@ -35,6 +35,7 @@
#include <typeinfo>
#include "base/bitfield.hh"
#include "base/compiler.hh"
#include "sim/serialize_handlers.hh"
// The following implements the BitUnion system of defining bitfields
@@ -168,7 +169,7 @@ class BitfieldWOType : public BitfieldTypeImpl<Base>
//This namespace is for classes which implement the backend of the BitUnion
//stuff. Don't use any of these directly.
namespace BitfieldBackend
namespace bitfield_backend
{
template<class Storage, int first, int last>
class Unsigned
@@ -382,7 +383,7 @@ namespace BitfieldBackend
return *this;
}
};
}
} // namespace bitfield_backend
//This macro is a backend for other macros that specialize it slightly.
//First, it creates/extends a namespace "BitfieldUnderlyingClasses" and
@@ -401,14 +402,14 @@ namespace BitfieldBackend
//overhead.
#define __BitUnion(type, name) \
class BitfieldUnderlyingClasses##name : \
public BitfieldBackend::BitfieldTypes<type> \
public bitfield_backend::BitfieldTypes<type> \
{ \
protected: \
typedef type __StorageType; \
friend BitfieldBackend::BitUnionBaseType< \
BitfieldBackend::BitUnionOperators< \
friend bitfield_backend::BitUnionBaseType< \
bitfield_backend::BitUnionOperators< \
BitfieldUnderlyingClasses##name> >; \
friend BitfieldBackend::BitUnionBaseType< \
friend bitfield_backend::BitUnionBaseType< \
BitfieldUnderlyingClasses##name>; \
public: \
union { \
@@ -425,7 +426,7 @@ namespace BitfieldBackend
#define EndBitUnion(name) \
}; \
}; \
typedef BitfieldBackend::BitUnionOperators< \
typedef bitfield_backend::BitUnionOperators< \
BitfieldUnderlyingClasses##name> name;
//This sets up a bitfield which has other bitfields nested inside of it. The
@@ -495,8 +496,8 @@ namespace BitfieldBackend
//These templates make it possible to define other templates related to
//BitUnions without having to refer to internal typedefs or the BitfieldBackend
//namespace.
//BitUnions without having to refer to internal typedefs or the
// bitfield_backend namespace.
//To build a template specialization which works for all BitUnions, accept a
//template argument T, and then use BitUnionType<T> as an argument in the
@@ -513,9 +514,9 @@ namespace BitfieldBackend
* @ingroup api_bitunion
*/
template <typename T>
using BitUnionType = BitfieldBackend::BitUnionOperators<T>;
using BitUnionType = bitfield_backend::BitUnionOperators<T>;
namespace BitfieldBackend
namespace bitfield_backend
{
template<typename T>
struct BitUnionBaseType
@@ -528,13 +529,13 @@ namespace BitfieldBackend
{
typedef typename BitUnionType<T>::__StorageType Type;
};
}
} // namespace bitfield_backend
/**
* @ingroup api_bitunion
*/
template <typename T>
using BitUnionBaseType = typename BitfieldBackend::BitUnionBaseType<T>::Type;
using BitUnionBaseType = typename bitfield_backend::BitUnionBaseType<T>::Type;
//An STL style hash structure for hashing BitUnions based on their base type.
@@ -549,12 +550,10 @@ namespace std
return hash<BitUnionBaseType<T> >::operator()(val);
}
};
}
} // namespace std
namespace BitfieldBackend
namespace bitfield_backend
{
template<typename T>
static inline std::ostream &
bitfieldBackendPrinter(std::ostream &os, const T &t)
@@ -581,11 +580,11 @@ namespace BitfieldBackend
os << (unsigned int)t;
return os;
}
}
} // namespace bitfield_backend
/**
* A default << operator which casts a bitunion to its underlying type and
* passes it to BitfieldBackend::bitfieldBackendPrinter.
* passes it to bitfield_backend::bitfieldBackendPrinter.
*
* @ingroup api_bitunion
*/
@@ -593,7 +592,7 @@ template <typename T>
std::ostream &
operator << (std::ostream &os, const BitUnionType<T> &bu)
{
return BitfieldBackend::bitfieldBackendPrinter(
return bitfield_backend::bitfieldBackendPrinter(
os, (BitUnionBaseType<T>)bu);
}