InstrProf: Use move semantics with unique_ptr

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2014-03-21 20:42:34 +00:00
parent bb56c4808e
commit bc2740a598
2 changed files with 7 additions and 7 deletions

View File

@@ -113,8 +113,8 @@ private:
TextInstrProfReader &operator=(const TextInstrProfReader &)
LLVM_DELETED_FUNCTION;
public:
TextInstrProfReader(std::unique_ptr<MemoryBuffer> &DataBuffer_)
: DataBuffer(DataBuffer_.release()), Line(*DataBuffer, '#') {}
TextInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer_)
: DataBuffer(std::move(DataBuffer_)), Line(*DataBuffer, '#') {}
/// Read the header.
error_code readHeader() override { return success(); }
@@ -161,7 +161,7 @@ private:
RawInstrProfReader &operator=(const TextInstrProfReader &)
LLVM_DELETED_FUNCTION;
public:
RawInstrProfReader(std::unique_ptr<MemoryBuffer> &DataBuffer);
RawInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer);
static bool hasFormat(const MemoryBuffer &DataBuffer);
error_code readHeader() override;