summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/ClangdUnitStore.h
Commit message (Collapse)AuthorAgeFilesLines
* Resubmit "[clangd] The new threading implementation"Ilya Biryukov2018-02-081-73/+0
| | | | | | | | | | | Initially submitted as r324356 and reverted in r324386. This change additionally contains a fix to crashes of the buildbots. The source of the crash was undefined behaviour caused by std::future<> whose std::promise<> was destroyed without calling set_value(). llvm-svn: 324575
* Revert "[clangd] The new threading implementation" (r324356)Ilya Biryukov2018-02-061-0/+73
| | | | | | | | | | | | And the follow-up changes r324361 and r324363. These changes seem to break two buildbots: - http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/14091 - http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/16001 We will need to investigate what went wrong and resubmit the changes afterwards. llvm-svn: 324386
* [clangd] The new threading implementationIlya Biryukov2018-02-061-73/+0
| | | | | | | | | | | | | | | | | | Summary: In the new threading model clangd creates one thread per file to manage the AST and one thread to process each of the incoming requests. The number of actively running threads is bounded by the semaphore to avoid overloading the system. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, jkorous-apple, ioeric, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D42573 llvm-svn: 324356
* [clangd] Refactored threading in ClangdServerIlya Biryukov2018-01-311-7/+9
| | | | | | | | | | | | | | | | | | | | Summary: We now provide an abstraction of Scheduler that abstracts threading and resource management in ClangdServer. No changes to behavior are intended with an exception of changed error messages. This patch is preliminary work to allow a revamped threading implementation that will move the threading code out of CppFile. Reviewers: sammccall, bkramer, jkorous-apple Reviewed By: sammccall Subscribers: hokein, mgorny, hintonda, ioeric, jkorous-apple, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42174 llvm-svn: 323851
* [clangd] Provide a helper to report estimated memory usage per-fileIlya Biryukov2018-01-251-2/+5
| | | | | | | | | | | | Reviewers: sammccall, ioeric, hokein Reviewed By: ioeric Subscribers: klimek, cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D42480 llvm-svn: 323425
* [clangd] Moved caching of compile commands to ClangdServerIlya Biryukov2018-01-251-2/+1
| | | | | | | | | | | | | | | | Summary: It allows to get rid of CppFile::getLastCommand and simplify the code in the upcoming threading patch. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, jkorous-apple, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D42429 llvm-svn: 323420
* [clangd] Simplify code handling compile commandsIlya Biryukov2018-01-231-31/+2
| | | | | | | | | | | | | | | | Summary: CppFile can now change compilation arguments during rebuild. This allows simplifying code that manages CppFiles. Reviewers: sammccall, bkramer, jkorous-apple Reviewed By: sammccall Subscribers: ioeric, jkorous-apple, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42173 llvm-svn: 323204
* [clangd] Build dynamic index and use it for code completion.Eric Liu2017-12-191-1/+7
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41289 llvm-svn: 321092
* [clangd] Put all #includes in one block in clangd source files. NFCEric Liu2017-12-141-2/+1
| | | | | | | Clang-format categorizes and sorts #includes with style. It doesn't make sense to manually managing #include blocks. llvm-svn: 320743
* [clangd] Implemented logging using ContextIlya Biryukov2017-12-131-5/+5
| | | | | | | | | | | | Reviewers: sammccall, ioeric, hokein Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D40486 llvm-svn: 320576
* [clangd] Use in-memory preambles in clangd.Ilya Biryukov2017-11-161-4/+8
| | | | | | | | | | | | Reviewers: klimek, bkramer, sammccall Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39843 llvm-svn: 318412
* [clangd] Fix clang-tidy warnings.Benjamin Kramer2017-10-281-4/+2
| | | | | | No functionality change intended. llvm-svn: 316832
* [clangd] Introduced Logger interface.Ilya Biryukov2017-09-201-7/+8
| | | | | | | | | | | | | | Summary: This fixes a bunch of logging-related FIXMEs. Reviewers: bkramer, krasimir, malaperle Reviewed By: malaperle Subscribers: malaperle, klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D37972 llvm-svn: 313730
* [clangd] Check if CompileCommand has changed on forceReparse.Ilya Biryukov2017-08-141-0/+22
| | | | | | | | | | | | Reviewers: krasimir, bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36398 llvm-svn: 310819
* [clangd] Rewrote AST and Preamble management.Ilya Biryukov2017-08-011-68/+28
| | | | | | | | | | | | | | Summary: The new implementation allows code completion that never waits for AST. Reviewers: bkramer, krasimir, klimek Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36133 llvm-svn: 309696
* [clangd] Reuse compile commands during reparseKrasimir Georgiev2017-07-251-5/+4
| | | | | | | | | | | | | | | | Summary: Previously we always queried the compilation database and discarded the results if the file was already opened. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35825 llvm-svn: 308970
* [clangd] Allow to override resource dir in ClangdServer.Ilya Biryukov2017-06-281-10/+13
| | | | | | | | | | | | | | Reviewers: bkramer, krasimir, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34470 llvm-svn: 306530
* [clangd] Allow to use vfs::FileSystem for file accesses.Ilya Biryukov2017-05-261-9/+10
| | | | | | | | | | | | | | | | Summary: Custom vfs::FileSystem is currently used for unit tests. This revision depends on https://reviews.llvm.org/D33397. Reviewers: bkramer, krasimir Reviewed By: bkramer, krasimir Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D33416 llvm-svn: 303977
* [clangd] Replaced WorkerRequest with std::function...Ilya Biryukov2017-05-231-0/+12
| | | | | | | | | | | | | | | | | | Summary: And implemented a helper function to dump an AST of a file for testing/debugging purposes. Reviewers: bkramer, krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33415 llvm-svn: 303634
* Restored r303067 and fixed failing test.Ilya Biryukov2017-05-161-0/+93
| | | | | | | | | | | | | | | | | | | | | Summary: This commit restores r303067(reverted by r303094) and fixes the 'formatting.test' failure. The failure is due to destructors of `ClangdLSPServer`'s fields(`FixItsMap` and `FixItsMutex`) being called before destructor of `Server`. It led to the worker thread calling `consumeDiagnostics` after `FixItsMutex` and `FixItsMap` destructors were called. Also, clangd is now run with '-run-synchronously' flag in 'formatting.test'. Reviewers: bkramer, krasimir Reviewed By: krasimir Subscribers: mgorny, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D33233 llvm-svn: 303151
* Revert "[ClangD] Refactor clangd into separate components"Adam Nemet2017-05-151-93/+0
| | | | | | | | | | This reverts commit r303067. Caused http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/34305/ And even after Simon's fix there is still a test failure. llvm-svn: 303094
* [ClangD] Refactor clangd into separate componentsIlya Biryukov2017-05-151-0/+93
Summary: Major refactoring to split LSP implementation, Clang API calls and threading(mostly synchronization) Reviewers: bkramer, krasimir Reviewed By: bkramer Subscribers: cfe-commits, mgorny, klimek Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33047 llvm-svn: 303067
OpenPOWER on IntegriCloud