summaryrefslogtreecommitdiff
path: root/lib/ProfileData
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-21 20:42:34 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-21 20:42:34 +0000
commitbc2740a5981161bec9d81be36cb135428cb26b6d (patch)
treeda4558a000140b788f1e6902c7c2058f8edeaf5a /lib/ProfileData
parentbb56c4808ef72a6329a599bde994c89abbfc2b34 (diff)
downloadllvm-bc2740a5981161bec9d81be36cb135428cb26b6d.tar.gz
llvm-bc2740a5981161bec9d81be36cb135428cb26b6d.tar.bz2
llvm-bc2740a5981161bec9d81be36cb135428cb26b6d.tar.xz
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
Diffstat (limited to 'lib/ProfileData')
-rw-r--r--lib/ProfileData/InstrProfReader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ProfileData/InstrProfReader.cpp b/lib/ProfileData/InstrProfReader.cpp
index c317a457bb..a95d9bc3b0 100644
--- a/lib/ProfileData/InstrProfReader.cpp
+++ b/lib/ProfileData/InstrProfReader.cpp
@@ -31,9 +31,9 @@ error_code InstrProfReader::create(std::string Path,
// Create the reader.
if (RawInstrProfReader::hasFormat(*Buffer))
- Result.reset(new RawInstrProfReader(Buffer));
+ Result.reset(new RawInstrProfReader(std::move(Buffer)));
else
- Result.reset(new TextInstrProfReader(Buffer));
+ Result.reset(new TextInstrProfReader(std::move(Buffer)));
// Read the header and return the result.
return Result->readHeader();
@@ -85,8 +85,8 @@ error_code TextInstrProfReader::readNextRecord(InstrProfRecord &Record) {
return success();
}
-RawInstrProfReader::RawInstrProfReader(std::unique_ptr<MemoryBuffer> &DataBuffer)
- : DataBuffer(DataBuffer.release()) { }
+RawInstrProfReader::RawInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer)
+ : DataBuffer(std::move(DataBuffer)) { }
static uint64_t getRawMagic() {
return