Make DiagnosticOptions intrusively reference-counted, and make sure

the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.

llvm-svn: 166508
This commit is contained in:
Douglas Gregor
2012-10-23 22:26:28 +00:00
parent 7fcf0c131b
commit 811db4eac4
38 changed files with 196 additions and 159 deletions

View File

@@ -41,8 +41,9 @@ void ASTMergeAction::ExecuteAction() {
DiagIDs(CI.getDiagnostics().getDiagnosticIDs());
for (unsigned I = 0, N = ASTFiles.size(); I != N; ++I) {
IntrusiveRefCntPtr<DiagnosticsEngine>
Diags(new DiagnosticsEngine(DiagIDs, CI.getDiagnostics().getClient(),
/*ShouldOwnClient=*/false));
Diags(new DiagnosticsEngine(DiagIDs, &CI.getDiagnosticOpts(),
CI.getDiagnostics().getClient(),
/*ShouldOwnClient=*/false));
ASTUnit *Unit = ASTUnit::LoadFromASTFile(ASTFiles[I], Diags,
CI.getFileSystemOpts(), false);
if (!Unit)