aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/CIndex.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
commit02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f (patch)
treec44af66edb700be2df3d1ad41420df5c7174d5f1 /tools/libclang/CIndex.cpp
parent340d0d30018dd3ed77fb17f33e785acd745bf97d (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndex.cpp')
-rw-r--r--tools/libclang/CIndex.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index f3c91e31b4..3a6c408bff 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -2559,10 +2559,10 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
bool ForSerialization = options & CXTranslationUnit_ForSerialization;
// Configure the diagnostics.
- DiagnosticOptions DiagOpts;
IntrusiveRefCntPtr<DiagnosticsEngine>
- Diags(CompilerInstance::createDiagnostics(DiagOpts, num_command_line_args,
- command_line_args));
+ Diags(CompilerInstance::createDiagnostics(new DiagnosticOptions,
+ num_command_line_args,
+ command_line_args));
// Recover resources if we crash before exiting this function.
llvm::CrashRecoveryContextCleanupRegistrar<DiagnosticsEngine,