mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 01:11:44 +00:00
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
This commit is contained in:
parent
cd4d111105
commit
dbccde2834
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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...
|
||||
|
Loading…
Reference in New Issue
Block a user