[llvm] r287305 - Object: Simplify; remove unnecessary use of unique_ptr.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 19:20:37 PST 2016


Author: pcc
Date: Thu Nov 17 21:20:36 2016
New Revision: 287305

URL: http://llvm.org/viewvc/llvm-project?rev=287305&view=rev
Log:
Object: Simplify; remove unnecessary use of unique_ptr.

Modified:
    llvm/trunk/lib/Object/IRObjectFile.cpp

Modified: llvm/trunk/lib/Object/IRObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=287305&r1=287304&r2=287305&view=diff
==============================================================================
--- llvm/trunk/lib/Object/IRObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/IRObjectFile.cpp Thu Nov 17 21:20:36 2016
@@ -76,14 +76,14 @@ void IRObjectFile::CollectAsmUndefinedRe
   MCObjectFileInfo MOFI;
   MCContext MCCtx(MAI.get(), MRI.get(), &MOFI);
   MOFI.InitMCObjectFileInfo(TT, /*PIC*/ false, CodeModel::Default, MCCtx);
-  std::unique_ptr<RecordStreamer> Streamer(new RecordStreamer(MCCtx));
-  T->createNullTargetStreamer(*Streamer);
+  RecordStreamer Streamer(MCCtx);
+  T->createNullTargetStreamer(Streamer);
 
   std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer(InlineAsm));
   SourceMgr SrcMgr;
   SrcMgr.AddNewSourceBuffer(std::move(Buffer), SMLoc());
   std::unique_ptr<MCAsmParser> Parser(
-      createMCAsmParser(SrcMgr, MCCtx, *Streamer, *MAI));
+      createMCAsmParser(SrcMgr, MCCtx, Streamer, *MAI));
 
   MCTargetOptions MCOptions;
   std::unique_ptr<MCTargetAsmParser> TAP(
@@ -95,7 +95,7 @@ void IRObjectFile::CollectAsmUndefinedRe
   if (Parser->Run(false))
     return;
 
-  for (auto &KV : *Streamer) {
+  for (auto &KV : Streamer) {
     StringRef Key = KV.first();
     RecordStreamer::State Value = KV.second;
     uint32_t Res = BasicSymbolRef::SF_None;




More information about the llvm-commits mailing list