Make Diagnostic reference-counted, which is simpler than juggling

maybe-ownership vs. ownership.

llvm-svn: 100498
This commit is contained in:
Douglas Gregor
2010-04-05 23:52:57 +00:00
parent 1a9b3f3484
commit 7f95d26e53
9 changed files with 41 additions and 63 deletions

View File

@@ -12,6 +12,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/ASTImporter.h"
#include "clang/Basic/Diagnostic.h"
using namespace clang;
@@ -36,10 +37,9 @@ void ASTMergeAction::ExecuteAction() {
CI.getASTContext().getLangOptions());
CI.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
&CI.getASTContext());
llvm::IntrusiveRefCntPtr<Diagnostic> Diags(&CI.getDiagnostics());
for (unsigned I = 0, N = ASTFiles.size(); I != N; ++I) {
ASTUnit *Unit = ASTUnit::LoadFromPCHFile(ASTFiles[I],
UnownedDiag(CI.getDiagnostics()),
false);
ASTUnit *Unit = ASTUnit::LoadFromPCHFile(ASTFiles[I], Diags, false);
if (!Unit)
continue;