From b806c5ad660436db46eba99b8d26081324bc2af4 Mon Sep 17 00:00:00 2001 From: Mehdi Amini <mehdi.amini@apple.com> Date: Sat, 19 Nov 2016 18:19:41 +0000 Subject: [PATCH] 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 --- lib/CodeGen/CodeGenAction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 6961f011505..da8f372441f 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<yaml::Output>(OptRecordFile->os())); if (CodeGenOpts.getProfileUse() != CodeGenOptions::ProfileNone) Ctx.setDiagnosticHotnessRequested(true); -- GitLab