Return a std::unique_ptr when creating a new MemoryBuffer.
[oota-llvm.git] / lib / MC / MCParser / AsmParser.cpp
index c82e1183aaf94e282659f8bd910c6323fbcb5fe9..a1b469d6797e89fdcd6c68e96c1e131488afdc99 100644 (file)
@@ -2118,8 +2118,8 @@ bool AsmParser::handleMacroEntry(const MCAsmMacro *M, SMLoc NameLoc) {
   // instantiation.
   OS << ".endmacro\n";
 
-  std::unique_ptr<MemoryBuffer> Instantiation(
-      MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>"));
+  std::unique_ptr<MemoryBuffer> Instantiation =
+      MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>");
 
   // Create the macro instantiation object and add to the current macro
   // instantiation stack.
@@ -4304,8 +4304,8 @@ void AsmParser::instantiateMacroLikeBody(MCAsmMacro *M, SMLoc DirectiveLoc,
                                          raw_svector_ostream &OS) {
   OS << ".endr\n";
 
-  std::unique_ptr<MemoryBuffer> Instantiation(
-      MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>"));
+  std::unique_ptr<MemoryBuffer> Instantiation =
+      MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>");
 
   // Create the macro instantiation object and add to the current macro
   // instantiation stack.