[llvm] r204671 - Support: Document Endian.h functions

Justin Bogner mail at justinbogner.com
Mon Mar 24 14:30:56 PDT 2014


Author: bogner
Date: Mon Mar 24 16:30:55 2014
New Revision: 204671

URL: http://llvm.org/viewvc/llvm-project?rev=204671&view=rev
Log:
Support: Document Endian.h functions

Modified:
    llvm/trunk/include/llvm/Support/Endian.h

Modified: llvm/trunk/include/llvm/Support/Endian.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Endian.h?rev=204671&r1=204670&r2=204671&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Endian.h (original)
+++ llvm/trunk/include/llvm/Support/Endian.h Mon Mar 24 16:30:55 2014
@@ -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 v
   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 *memor
   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>





More information about the llvm-commits mailing list