summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2018-12-01 01:43:05 +0000
committerFangrui Song <maskray@google.com>2018-12-01 01:43:05 +0000
commit2f553207419ae621452200b1a6ff70eef66b4f9b (patch)
tree6601324f6f6a0c7ae1ea882053eaed10ac04e7d1 /clang/lib/Basic/Diagnostic.cpp
parentfbb925462e02fbf280e510b079e46745c2d357e0 (diff)
downloadbcm5719-llvm-2f553207419ae621452200b1a6ff70eef66b4f9b.tar.gz
bcm5719-llvm-2f553207419ae621452200b1a6ff70eef66b4f9b.zip
[Basic] Move DiagnosticsEngine::dump from .h to .cpp
The two LLVM_DUMP_METHOD methods have a undefined reference on clang::DiagnosticsEngine::DiagStateMap::dump. tools/clang/tools/extra/clangd/benchmarks/IndexBenchmark links in clangDaemon but does not link in clangBasic explicitly, which causes a linker error "undefined symbol" in !NDEBUG + -DBUILD_SHARED_LIBS=on builds. Move LLVM_DUMP_METHOD methods to .cpp to fix IndexBenchmark. They should be unconditionally defined as they are also used by non-dump-method #pragma clang __debug diag_mapping llvm-svn: 348065
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 88ee319b5c2..ffe92e157e5 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -89,6 +89,14 @@ DiagnosticsEngine::~DiagnosticsEngine() {
setClient(nullptr);
}
+void DiagnosticsEngine::dump() const {
+ DiagStatesByLoc.dump(*SourceMgr);
+}
+
+void DiagnosticsEngine::dump(StringRef DiagName) const {
+ DiagStatesByLoc.dump(*SourceMgr, DiagName);
+}
+
void DiagnosticsEngine::setClient(DiagnosticConsumer *client,
bool ShouldOwnClient) {
Owner.reset(ShouldOwnClient ? client : nullptr);
OpenPOWER on IntegriCloud