[Support][Endian] Define |= and &= for u{big,little}{16,32,64}_t.
authorRui Ueyama <ruiu@google.com>
Mon, 15 Jun 2015 03:00:15 +0000 (03:00 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 15 Jun 2015 03:00:15 +0000 (03:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239716 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Endian.h

index e9fe22e5eda828a050fe10b8d09e10953a2e87dd..fd59009e0d3a60f843c4573c255f5294b66b56eb 100644 (file)
@@ -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;