[BinaryStream] Defaultify copy and move constructors.

The various BinaryStream classes had explicit copy constructors
which resulted in deleted move constructors.  This was causing
the internal std::shared_ptr to get copied rather than moved
very frequently, since these classes are often used as return
values.

Patch by Alex Telishev
Differential Revision: https://reviews.llvm.org/D36942

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner
2017-08-21 19:46:46 +00:00
parent 5aca549a9a
commit f6ac6bc248
2 changed files with 15 additions and 14 deletions
-6
View File
@@ -77,9 +77,6 @@ BinaryStreamRef::BinaryStreamRef(StringRef Data, endianness Endian)
: BinaryStreamRef(makeArrayRef(Data.bytes_begin(), Data.bytes_end()),
Endian) {}
BinaryStreamRef::BinaryStreamRef(const BinaryStreamRef &Other)
: BinaryStreamRefBase(Other) {}
Error BinaryStreamRef::readBytes(uint32_t Offset, uint32_t Size,
ArrayRef<uint8_t> &Buffer) const {
if (auto EC = checkOffset(Offset, Size))
@@ -117,9 +114,6 @@ WritableBinaryStreamRef::WritableBinaryStreamRef(MutableArrayRef<uint8_t> Data,
: BinaryStreamRefBase(std::make_shared<MutableArrayRefImpl>(Data, Endian),
0, Data.size()) {}
WritableBinaryStreamRef::WritableBinaryStreamRef(
const WritableBinaryStreamRef &Other)
: BinaryStreamRefBase(Other) {}
Error WritableBinaryStreamRef::writeBytes(uint32_t Offset,
ArrayRef<uint8_t> Data) const {