[llvm] r239716 - [Support][Endian] Define |= and &= for u{big, little}{16, 32, 64}_t.

Rui Ueyama ruiu at google.com
Sun Jun 14 20:00:15 PDT 2015


Author: ruiu
Date: Sun Jun 14 22:00:15 2015
New Revision: 239716

URL: http://llvm.org/viewvc/llvm-project?rev=239716&view=rev
Log:
[Support][Endian] Define |= and &= for u{big,little}{16,32,64}_t.


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=239716&r1=239715&r2=239716&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Endian.h (original)
+++ llvm/trunk/include/llvm/Support/Endian.h Sun Jun 14 22:00:15 2015
@@ -104,6 +104,16 @@ struct packed_endian_specific_integral {
     return *this;
   }
 
+  packed_endian_specific_integral &operator|=(value_type newValue) {
+    *this = *this | newValue;
+    return *this;
+  }
+
+  packed_endian_specific_integral &operator&=(value_type newValue) {
+    *this = *this & newValue;
+    return *this;
+  }
+
 private:
   AlignedCharArray<PickAlignment<value_type, alignment>::value,
                    sizeof(value_type)> Value;





More information about the llvm-commits mailing list