diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-23 22:26:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-23 22:26:28 +0000 |
commit | 811db4eac4e036de3705570a46e28bf7d993dbab (patch) | |
tree | a3c03c187e25f995d854d175faaa3d793f12bee1 /clang/tools/libclang/CIndexCodeCompletion.cpp | |
parent | 7fcf0c131bc198de245e65f35b380af02b085dde (diff) | |
download | bcm5719-llvm-811db4eac4e036de3705570a46e28bf7d993dbab.tar.gz bcm5719-llvm-811db4eac4e036de3705570a46e28bf7d993dbab.zip |
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
Diffstat (limited to 'clang/tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r-- | clang/tools/libclang/CIndexCodeCompletion.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndexCodeCompletion.cpp b/clang/tools/libclang/CIndexCodeCompletion.cpp index 2676b5346c4..46af661d0e5 100644 --- a/clang/tools/libclang/CIndexCodeCompletion.cpp +++ b/clang/tools/libclang/CIndexCodeCompletion.cpp @@ -246,6 +246,8 @@ struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults { /// \brief Diagnostics produced while performing code completion. SmallVector<StoredDiagnostic, 8> Diagnostics; + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; + /// \brief Diag object IntrusiveRefCntPtr<DiagnosticsEngine> Diag; @@ -305,8 +307,10 @@ static llvm::sys::cas_flag CodeCompletionResultObjects; AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults( const FileSystemOptions& FileSystemOpts) : CXCodeCompleteResults(), + DiagOpts(new DiagnosticOptions), Diag(new DiagnosticsEngine( - IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs))), + IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), + &*DiagOpts)), FileSystemOpts(FileSystemOpts), FileMgr(new FileManager(FileSystemOpts)), SourceMgr(new SourceManager(*Diag, *FileMgr)), |