summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit4c5b7cb1fca96d354d355aa633c1bf2f2da76ea4 (patch)
treea068036eef80cc66fa296640f9e1981cabacb052 /llvm/lib
parent09a67f45eeaabe9e0ce021ac329e19fed1feb79f (diff)
downloadbcm5719-llvm-4c5b7cb1fca96d354d355aa633c1bf2f2da76ea4.tar.gz
bcm5719-llvm-4c5b7cb1fca96d354d355aa633c1bf2f2da76ea4.zip
InstrProf: Use move semantics with unique_ptr
<rdar://problem/15950346> llvm-svn: 204512
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index c317a457bb6..a95d9bc3b08 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud