[clangd] Shutdown cleanly on signals.
authorSam McCall <sam.mccall@gmail.com>
Mon, 25 Nov 2019 18:51:07 +0000 (19:51 +0100)
committerSam McCall <sam.mccall@gmail.com>
Wed, 27 Nov 2019 11:38:49 +0000 (12:38 +0100)
commit19ac0eaf07e60173baa7ee77fa11568c30b87455
treedd8e9def3ccb42ed6fea9afdbfccc618414a62d0
parent31c25fadccec0d5e5f0048b551b99f8976b87eb0
[clangd] Shutdown cleanly on signals.

Summary:
This avoids leaking PCH files if editors don't use the LSP shutdown protocol.

This is one fix for https://github.com/clangd/clangd/issues/209
(Though I think we should *also* be unlinking the files)

Reviewers: kadircet, jfb

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70684
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/JSONTransport.cpp
clang-tools-extra/clangd/Shutdown.cpp [new file with mode: 0644]
clang-tools-extra/clangd/Shutdown.h [new file with mode: 0644]
clang-tools-extra/clangd/test/exit-eof.test [new file with mode: 0644]
clang-tools-extra/clangd/test/exit-signal.test [new file with mode: 0644]
clang-tools-extra/clangd/tool/ClangdMain.cpp