aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ASTMerge.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/ASTMerge.cpp')
-rw-r--r--clang/lib/Frontend/ASTMerge.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Frontend/ASTMerge.cpp b/clang/lib/Frontend/ASTMerge.cpp
index ff6434c..95cfe248 100644
--- a/clang/lib/Frontend/ASTMerge.cpp
+++ b/clang/lib/Frontend/ASTMerge.cpp
@@ -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();