Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndexCodeCompletion.cpp b/tools/CIndex/CIndexCodeCompletion.cpp
index 264e506..d11b8df 100644
--- a/tools/CIndex/CIndexCodeCompletion.cpp
+++ b/tools/CIndex/CIndexCodeCompletion.cpp
@@ -231,8 +231,8 @@
// Configure the diagnostics.
DiagnosticOptions DiagOpts;
- llvm::OwningPtr<Diagnostic> Diags;
- Diags.reset(CompilerInstance::createDiagnostics(DiagOpts, 0, 0));
+ llvm::IntrusiveRefCntPtr<Diagnostic> Diags;
+ Diags = CompilerInstance::createDiagnostics(DiagOpts, 0, 0);
// The set of temporary files that we've built.
std::vector<llvm::sys::Path> TemporaryFiles;