diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp b/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp index ff6434c..216ac6a 100644 --- a/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp +++ b/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp @@ -16,8 +16,8 @@ using namespace clang; -ASTConsumer *ASTMergeAction::CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) { +std::unique_ptr<ASTConsumer> +ASTMergeAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { return AdaptedAction->CreateASTConsumer(CI, InFile); } @@ -45,8 +45,8 @@ void ASTMergeAction::ExecuteAction() { new ForwardingDiagnosticConsumer( *CI.getDiagnostics().getClient()), /*ShouldOwnClient=*/true)); - ASTUnit *Unit = ASTUnit::LoadFromASTFile(ASTFiles[I], Diags, - CI.getFileSystemOpts(), false); + std::unique_ptr<ASTUnit> Unit = ASTUnit::LoadFromASTFile( + ASTFiles[I], Diags, CI.getFileSystemOpts(), false); if (!Unit) continue; @@ -66,8 +66,6 @@ void ASTMergeAction::ExecuteAction() { Importer.Import(D); } - - delete Unit; } AdaptedAction->ExecuteAction(); |