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

llvm-svn: 287449
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index d2f964e..146ad45 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -511,7 +511,7 @@
       return false;
     }
     Context.setDiagnosticsOutputFile(
-        new yaml::Output(DiagnosticOutputFile->os()));
+        llvm::make_unique<yaml::Output>(DiagnosticOutputFile->os()));
   }
   return true;
 }