r287449 - Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)

Mehdi Amini via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 19 10:19:41 PST 2016


Author: mehdi_amini
Date: Sat Nov 19 12:19:41 2016
New Revision: 287449

URL: http://llvm.org/viewvc/llvm-project?rev=287449&view=rev
Log:
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

Modified:
    cfe/trunk/lib/CodeGen/CodeGenAction.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenAction.cpp?rev=287449&r1=287448&r2=287449&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenAction.cpp Sat Nov 19 12:19:41 2016
@@ -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);




More information about the cfe-commits mailing list