mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-13 08:35:46 +00:00
Support: Document Endian.h functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204671 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f4ec1889db
commit
2563e201c1
@ -34,6 +34,7 @@ namespace detail {
|
||||
} // end namespace detail
|
||||
|
||||
namespace endian {
|
||||
/// Swap the bytes of value to match the given endianness.
|
||||
template<typename value_type, endianness endian>
|
||||
inline value_type byte_swap(value_type value) {
|
||||
if (endian != native && sys::IsBigEndianHost != (endian == big))
|
||||
@ -41,6 +42,7 @@ inline value_type byte_swap(value_type value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
/// Read a value of a particular endianness from memory.
|
||||
template<typename value_type,
|
||||
endianness endian,
|
||||
std::size_t alignment>
|
||||
@ -54,6 +56,7 @@ inline value_type read(const void *memory) {
|
||||
return byte_swap<value_type, endian>(ret);
|
||||
}
|
||||
|
||||
/// Write a value to memory with a particular endianness.
|
||||
template<typename value_type,
|
||||
endianness endian,
|
||||
std::size_t alignment>
|
||||
|
Loading…
x
Reference in New Issue
Block a user