aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/TextDiagnosticPrinter.h
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 /include/clang/Frontend/TextDiagnosticPrinter.h
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 'include/clang/Frontend/TextDiagnosticPrinter.h')
-rw-r--r--include/clang/Frontend/TextDiagnosticPrinter.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/Frontend/TextDiagnosticPrinter.h b/include/clang/Frontend/TextDiagnosticPrinter.h
index 23cf5211cd..91ac3c8339 100644
--- a/include/clang/Frontend/TextDiagnosticPrinter.h
+++ b/include/clang/Frontend/TextDiagnosticPrinter.h
@@ -18,6 +18,7 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/OwningPtr.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
namespace clang {
class DiagnosticOptions;
@@ -26,7 +27,7 @@ class TextDiagnostic;
class TextDiagnosticPrinter : public DiagnosticConsumer {
raw_ostream &OS;
- const DiagnosticOptions *DiagOpts;
+ llvm::IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
/// \brief Handle to the currently active text diagnostic emitter.
OwningPtr<TextDiagnostic> TextDiag;
@@ -37,7 +38,7 @@ class TextDiagnosticPrinter : public DiagnosticConsumer {
unsigned OwnsOutputStream : 1;
public:
- TextDiagnosticPrinter(raw_ostream &os, const DiagnosticOptions &diags,
+ TextDiagnosticPrinter(raw_ostream &os, DiagnosticOptions *diags,
bool OwnsOutputStream = false);
virtual ~TextDiagnosticPrinter();