]> granicus.if.org Git - clang/commitdiff
Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)
authorMehdi Amini <mehdi.amini@apple.com>
Sat, 19 Nov 2016 18:19:41 +0000 (18:19 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Sat, 19 Nov 2016 18:19:41 +0000 (18:19 +0000)
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

index 6961f011505e2d9b08e879ce5056f7a61ff460f1..da8f372441fa0ec9dac7174503c2c3a093d862eb 100644 (file)
@@ -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);