summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-09-11 22:55:25 +0000
committerRui Ueyama <ruiu@google.com>2014-09-11 22:55:25 +0000
commit7b6cff8f7bd0522b4e813a95441a9727944a89b5 (patch)
treefdcc033ccea55e0355427da04ccd7af1964b91da /llvm
parent362f345babb19f77f3b3e385281042758fe81de0 (diff)
downloadbcm5719-llvm-7b6cff8f7bd0522b4e813a95441a9727944a89b5.tar.gz
bcm5719-llvm-7b6cff8f7bd0522b4e813a95441a9727944a89b5.zip
[Support][Endian] Overload += and -=
This patch is to overload operator+= and operator-= for {u}{little}{big}{16,32,64}_t. llvm-svn: 217637
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Endian.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/Endian.h b/llvm/include/llvm/Support/Endian.h
index 75f3292ac4a..47b82fdc497 100644
--- a/llvm/include/llvm/Support/Endian.h
+++ b/llvm/include/llvm/Support/Endian.h
@@ -93,6 +93,16 @@ struct packed_endian_specific_integral {
(void*)Value.buffer, newValue);
}
+ 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;
OpenPOWER on IntegriCloud