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

@@ -11,9 +11,9 @@
//
//===----------------------------------------------------------------------===//
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Frontend/Utils.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/DiagnosticOptions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
@@ -34,8 +34,8 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
if (!Diags.getPtr()) {
// No diagnostics engine was provided, so create our own diagnostics object
// with the default options.
DiagnosticOptions DiagOpts;
Diags = CompilerInstance::createDiagnostics(DiagOpts, ArgList.size(),
Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions,
ArgList.size(),
ArgList.begin());
}