summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/Indexing.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-23 22:26:28 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-23 22:26:28 +0000
commit811db4eac4e036de3705570a46e28bf7d993dbab (patch)
treea3c03c187e25f995d854d175faaa3d793f12bee1 /clang/tools/libclang/Indexing.cpp
parent7fcf0c131bc198de245e65f35b380af02b085dde (diff)
downloadbcm5719-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/Indexing.cpp')
-rw-r--r--clang/tools/libclang/Indexing.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp
index 36442fa2324..714a36ebddf 100644
--- a/clang/tools/libclang/Indexing.cpp
+++ b/clang/tools/libclang/Indexing.cpp
@@ -290,13 +290,13 @@ static void clang_indexSourceFile_Impl(void *UserData) {
CaptureDiagnosticConsumer *CaptureDiag = new CaptureDiagnosticConsumer();
// Configure the diagnostics.
- DiagnosticOptions DiagOpts;
IntrusiveRefCntPtr<DiagnosticsEngine>
- Diags(CompilerInstance::createDiagnostics(DiagOpts, num_command_line_args,
- command_line_args,
- CaptureDiag,
- /*ShouldOwnClient=*/true,
- /*ShouldCloneClient=*/false));
+ Diags(CompilerInstance::createDiagnostics(new DiagnosticOptions,
+ num_command_line_args,
+ command_line_args,
+ CaptureDiag,
+ /*ShouldOwnClient=*/true,
+ /*ShouldCloneClient=*/false));
// Recover resources if we crash before exiting this function.
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,
OpenPOWER on IntegriCloud