From: Rui Ueyama Date: Thu, 11 Sep 2014 22:55:25 +0000 (+0000) Subject: [Support][Endian] Overload += and -= X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d76b9eff066e44f200832ab20cfb702339966280;p=oota-llvm.git [Support][Endian] Overload += and -= This patch is to overload operator+= and operator-= for {u}{little}{big}{16,32,64}_t. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217637 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Endian.h b/include/llvm/Support/Endian.h index 75f3292ac4a..47b82fdc497 100644 --- a/include/llvm/Support/Endian.h +++ b/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::value, sizeof(value_type)> Value;