From: Peter Collingbourne Date: Fri, 18 Nov 2016 03:20:36 +0000 (+0000) Subject: Object: Simplify; remove unnecessary use of unique_ptr. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63e10c9c96af3d1b352ade216aa3bb6b5ff1c3e4;p=platform%2Fupstream%2Fllvm.git Object: Simplify; remove unnecessary use of unique_ptr. llvm-svn: 287305 --- diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp index 3aa9b75..a2d2e196 100644 --- a/llvm/lib/Object/IRObjectFile.cpp +++ b/llvm/lib/Object/IRObjectFile.cpp @@ -76,14 +76,14 @@ void IRObjectFile::CollectAsmUndefinedRefs( MCObjectFileInfo MOFI; MCContext MCCtx(MAI.get(), MRI.get(), &MOFI); MOFI.InitMCObjectFileInfo(TT, /*PIC*/ false, CodeModel::Default, MCCtx); - std::unique_ptr Streamer(new RecordStreamer(MCCtx)); - T->createNullTargetStreamer(*Streamer); + RecordStreamer Streamer(MCCtx); + T->createNullTargetStreamer(Streamer); std::unique_ptr Buffer(MemoryBuffer::getMemBuffer(InlineAsm)); SourceMgr SrcMgr; SrcMgr.AddNewSourceBuffer(std::move(Buffer), SMLoc()); std::unique_ptr Parser( - createMCAsmParser(SrcMgr, MCCtx, *Streamer, *MAI)); + createMCAsmParser(SrcMgr, MCCtx, Streamer, *MAI)); MCTargetOptions MCOptions; std::unique_ptr TAP( @@ -95,7 +95,7 @@ void IRObjectFile::CollectAsmUndefinedRefs( 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;