summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp3
-rw-r--r--llvm/include/llvm/IR/LLVMContext.h2
-rw-r--r--llvm/lib/IR/LLVMContext.cpp4
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp2
-rw-r--r--llvm/tools/opt/opt.cpp3
5 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 6961f011505..da8f372441f 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/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);
diff --git a/llvm/include/llvm/IR/LLVMContext.h b/llvm/include/llvm/IR/LLVMContext.h
index 16286d73289..2b537ebf1fe 100644
--- a/llvm/include/llvm/IR/LLVMContext.h
+++ b/llvm/include/llvm/IR/LLVMContext.h
@@ -194,7 +194,7 @@ public:
/// By default or if invoked with null, diagnostics are not saved in a file
/// but only emitted via the diagnostic handler. Even if an output file is
/// set, the handler is invoked for each diagnostic message.
- void setDiagnosticsOutputFile(yaml::Output *F);
+ void setDiagnosticsOutputFile(std::unique_ptr<yaml::Output> F);
/// \brief Get the prefix that should be printed in front of a diagnostic of
/// the given \p Severity
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 9dac6151499..94934b385de 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -212,8 +212,8 @@ yaml::Output *LLVMContext::getDiagnosticsOutputFile() {
return pImpl->DiagnosticsOutputFile.get();
}
-void LLVMContext::setDiagnosticsOutputFile(yaml::Output *F) {
- pImpl->DiagnosticsOutputFile.reset(F);
+void LLVMContext::setDiagnosticsOutputFile(std::unique_ptr<yaml::Output> F) {
+ pImpl->DiagnosticsOutputFile = std::move(F);
}
LLVMContext::DiagnosticHandlerTy LLVMContext::getDiagnosticHandler() const {
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index d2f964e4d24..146ad454a0d 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -511,7 +511,7 @@ bool LTOCodeGenerator::setupOptimizationRemarks() {
return false;
}
Context.setDiagnosticsOutputFile(
- new yaml::Output(DiagnosticOutputFile->os()));
+ llvm::make_unique<yaml::Output>(DiagnosticOutputFile->os()));
}
return true;
}
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 0a42c13898a..035629a8aa4 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -424,7 +424,8 @@ int main(int argc, char **argv) {
errs() << EC.message() << '\n';
return 1;
}
- Context.setDiagnosticsOutputFile(new yaml::Output(YamlFile->os()));
+ Context.setDiagnosticsOutputFile(
+ llvm::make_unique<yaml::Output>(YamlFile->os()));
}
// Load the input module...
OpenPOWER on IntegriCloud