From: Mehdi Amini Date: Sat, 19 Nov 2016 18:19:41 +0000 (+0000) Subject: Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b806c5ad660436db46eba99b8d26081324bc2af4;p=clang Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC) Summary: This makes it explicit that ownership is taken. Also replace all `new` with make_unique<> at call sites. Reviewers: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26884 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287449 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 6961f01150..da8f372441 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -195,7 +195,8 @@ namespace clang { return; } - Ctx.setDiagnosticsOutputFile(new yaml::Output(OptRecordFile->os())); + Ctx.setDiagnosticsOutputFile( + llvm::make_unique(OptRecordFile->os())); if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone) Ctx.setDiagnosticHotnessRequested(true);