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 | 02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f (patch) | |
tree | c44af66edb700be2df3d1ad41420df5c7174d5f1 /lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 340d0d30018dd3ed77fb17f33e785acd745bf97d (diff) | |
download | clang-02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f.tar.gz |
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 'lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | lib/Frontend/CreateInvocationFromCommandLine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index 0aca86e2c9..0611291f82 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -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()); } |