Answer to Philip Reames comments
[oota-llvm.git] / lib / Transforms / Scalar / SampleProfile.cpp
index 73c97ffeef4f98fdf65558665f589fcaa8eb8b18..56c57373a7673f348c8f21cb9c8ff9f2c8c4b274 100644 (file)
@@ -457,8 +457,8 @@ bool SampleModuleProfile::loadText() {
     M.getContext().diagnose(DiagnosticInfoSampleProfile(Filename.data(), Msg));
     return false;
   }
-  std::unique_ptr<MemoryBuffer> Buffer = std::move(BufferOrErr.get());
-  line_iterator LineIt(*Buffer, '#');
+  MemoryBuffer &Buffer = *BufferOrErr.get();
+  line_iterator LineIt(Buffer, '#');
 
   // Read the profile of each function. Since each function may be
   // mentioned more than once, and we are collecting flat profiles,