From: Justin Bogner Date: Mon, 24 Mar 2014 21:30:55 +0000 (+0000) Subject: Support: Document Endian.h functions X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=2563e201c14bfd45605e151a68e0ce11e1fc0ee9;p=oota-llvm.git Support: Document Endian.h functions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204671 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Endian.h b/include/llvm/Support/Endian.h index 5256ef9fce5..81690605e87 100644 --- a/include/llvm/Support/Endian.h +++ b/include/llvm/Support/Endian.h @@ -34,6 +34,7 @@ namespace detail { } // end namespace detail namespace endian { +/// Swap the bytes of value to match the given endianness. template 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 @@ -54,6 +56,7 @@ inline value_type read(const void *memory) { return byte_swap(ret); } +/// Write a value to memory with a particular endianness. template