summaryrefslogtreecommitdiffstats
path: root/clang/tools/diagtool/TreeView.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/diagtool/TreeView.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/diagtool/TreeView.cpp')
-rw-r--r--clang/tools/diagtool/TreeView.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/tools/diagtool/TreeView.cpp b/clang/tools/diagtool/TreeView.cpp
index aee75541517..bf9f766c309 100644
--- a/clang/tools/diagtool/TreeView.cpp
+++ b/clang/tools/diagtool/TreeView.cpp
@@ -14,6 +14,7 @@
#include "DiagTool.h"
#include "DiagnosticNames.h"
#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/DiagnosticOptions.h"
#include "llvm/Support/Format.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/DenseSet.h"
@@ -50,7 +51,9 @@ static void resetColor(bool ShowColors, llvm::raw_ostream &out) {
}
static clang::DiagnosticsEngine::Level getLevel(unsigned DiagID) {
- static clang::DiagnosticsEngine Diags(new DiagnosticIDs);
+ // FIXME: This feels like a hack.
+ static clang::DiagnosticsEngine Diags(new DiagnosticIDs,
+ new DiagnosticOptions);
return Diags.getDiagnosticLevel(DiagID, SourceLocation());
}
OpenPOWER on IntegriCloud