summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Remember to serialize symbol origin in YAML.Eric Liu2018-09-212-0/+18
| | | | llvm-svn: 342730
* [Clang-tidy] Alphabetical sort of files/checks. Add space after clang-tidy ↵Eugene Zelenko2018-09-2011-20/+20
| | | | | | in source code headers. llvm-svn: 342601
* [clang-tidy] run-clang-tidy.py - fails using python 3.7Andi-Bogdan Postelnicu2018-09-191-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D51220 llvm-svn: 342540
* [clangd] Add option to enable/disable function argument snippets.Kadir Cetinkaya2018-09-191-0/+8
| | | | | | | | | | | | | | | | Summary: Currently LSP clients cannot directly change EnableFunctionArgSnippets parameter. This patch is to provide them with a way to enable/disable that functionality. Reviewers: hokein, ioeric, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: sammccall, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51214 llvm-svn: 342533
* [clangd] Store preamble macros in dynamic index.Eric Liu2018-09-193-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Pros: o Loading macros from preamble for every completion is slow (see profile). o Calculating macro USR is also slow (see profile). o Sema can provide a lot of macro completion results (e.g. when filter is empty, 60k for some large TUs!). Cons: o Slight memory increase in dynamic index (~1%). o Some extra work during preamble build (should be fine as preamble build and indexAST is way slower). Before: {F7195645} After: {F7195646} Reviewers: ilya-biryukov, sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52078 llvm-svn: 342529
* [clang-tidy] Replace redundant checks with an assert().Artem Belevich2018-09-181-2/+3
| | | | | | | | | | findStyleKind is only called if D is an explicit identifier with a name, so the checks for operators will never return true. The explicit assert() enforces this invariant. Differential Revision: https://reviews.llvm.org/D52179 llvm-svn: 342514
* [clangd] Fix error handling for SymbolID parsing (notably YAML and dexp)Sam McCall2018-09-185-21/+22
| | | | llvm-svn: 342505
* [clangd] Get rid of Decls parameter in indexMainDecls. NFCEric Liu2018-09-186-21/+17
| | | | | | It's already available in ParsedAST. llvm-svn: 342473
* [clang-tidy] use CHECK-NOTES in bugprone-unused-return-valueJonas Toth2018-09-182-31/+62
| | | | | | | | | | | | Reviewers: aaron.ballman, alexfh, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52187 llvm-svn: 342468
* [clangd] Merge ClangdServer::DynamicIndex into FileIndex. NFC.Eric Liu2018-09-187-160/+140
| | | | | | | | | | | | | | | | | | | | Summary: FileIndex now provides explicit interfaces for preamble and main file updates. This avoids growing parameter list when preamble and main symbols diverge further (e.g. D52078). This also gets rid of the hack in `indexAST` that inferred main file index based on `TopLevelDecls`. Also separate `indexMainDecls` from `indexAST`. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52222 llvm-svn: 342460
* [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overloadJonas Toth2018-09-181-14/+21
| | | | | | | | | | | | Reviewers: aaron.ballman, alexfh, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52186 llvm-svn: 342459
* [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-commentJonas Toth2018-09-183-19/+64
| | | | | | | | | | | | | | | | | Summary: This patch uses CHECK-NOTES for the tests. Its part of an effort to test *ALL* generated diagnostics in clang-tidy, as emitted notes were previously ignored. Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52178 llvm-svn: 342458
* [clangd] dexp tool uses llvm::cl to parse its flags.Sam McCall2018-09-182-70/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We can use cl::ResetCommandLineParser() to support different types of command-lines, as long as we're careful about option lifetimes. (I tried using subcommands, but the error messages were bad) I found a mostly-reasonable pattern to isolate the fiddly parts. Added -scope and -limit flags to the `find` command to demonstrate. (Note that scope support seems to be broken in dex?) Fixed symbol lookup to parse symbol IDs. Caveats: - with command help (e.g. `find -help`), you also get some spam about required arguments. This is a bug in llvm::cl, which prints these to errs() rather than the designated stream. Reviewers: kbobyrev Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51989 llvm-svn: 342456
* [clangd] Update code completion for #include completions in r342449Sam McCall2018-09-181-4/+10
| | | | llvm-svn: 342453
* [clangd] Adapt API change after 342451.Eric Liu2018-09-183-7/+8
| | | | llvm-svn: 342452
* [pp-trace] Remove unused using directivesFangrui Song2018-09-181-3/+0
| | | | llvm-svn: 342445
* [clang-tidy] Fix tests for performance-for-range-copyShuai Wang2018-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | Test failed as D52120 made ExprMutationAnalyzer smarter, fixed by: - Add move-ctor for `Mutable` to make it actually movable. - Properly implement `remove_reference`. The failed test case is: void negativeVarIsMoved() { for (auto M : View<Iterator<Mutable>>()) { auto Moved = std::move(M); } } Before D52120, `std::move(M)` itself is considered as a mutation to `M`, while after D52120 it's only considered as a cast to rvalue, the move-assignment is what causes the actual mutation. The test case didn't mock things properly so the intended move-assignement was actually a copy-assignment. llvm-svn: 342417
* Fix build failure caused by D52157Shuai Wang2018-09-171-1/+1
| | | | llvm-svn: 342408
* [clang-tidy] Remove duplicated logic in UnnecessaryValueParamCheck and use ↵Shuai Wang2018-09-172-15/+12
| | | | | | | | | | | | FunctionParmMutationAnalyzer instead. Reviewers: alexfh, JonasToth, george.karpenkov Subscribers: xazax.hun, kristof.beyls, chrib, a.sidorin, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52158 llvm-svn: 342403
* [clang-tidy] fix PR37913, templated exception factory diagnosed correctlyJonas Toth2018-09-172-43/+163
| | | | | | | | | | | | | | | | | | | Summary: PR37913 documents wrong behaviour for a templated exception factory function. The check does misidentify dependent types as not derived from std::exception. The fix to this problem is to ignore dependent types, the analysis works correctly on the instantiated function. Reviewers: aaron.ballman, alexfh, hokein, ilya-biryukov Reviewed By: alexfh Subscribers: lebedev.ri, nemanjai, mgorny, kbarton, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D48714 llvm-svn: 342393
* FixIdriss Riouak2018-09-171-4/+4
| | | | llvm-svn: 342389
* [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains ↵Idriss Riouak2018-09-172-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | about variable cast to void Summary: Hello, i would like to suggest a fix for one of the checks in clang-tidy.The bug was reported in https://bugs.llvm.org/show_bug.cgi?id=32575 where you can find more information. For example: ``` template <typename T0> struct S { template <typename T> void g() const { int a; (void)a; } }; void f() { S<int>().g<int>(); } ``` this piece of code should not trigger any warning by the check modernize-redundant-void-arg but when we execute the following command ``` clang_tidy -checks=-*,modernize-redundant-void-arg test.cpp -- -std=c++11 ``` we obtain the following warning: /Users/eco419/Desktop/clang-tidy.project/void-redundand_2/test.cpp:6:6: warning: redundant void argument list in function declaration [modernize-redundant-void-arg] (void)a; ^~~~ Reviewers: aaron.ballman, hokein, alexfh, JonasToth Reviewed By: aaron.ballman, JonasToth Subscribers: JonasToth, lebedev.ri, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52135 llvm-svn: 342388
* [clangd] Get rid of AST matchers in SymbolCollector. NFCEric Liu2018-09-171-13/+36
| | | | | | | | | | Reviewers: ilya-biryukov, kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52089 llvm-svn: 342362
* Mark index-tools.test as REQUIRES: shell so that it does not run with the ↵Reid Kleckner2018-09-141-0/+1
| | | | | | internal lit shell which does not support "if" llvm-svn: 342282
* [NFC][clangd] silence pedantic extra ';' warningJonas Toth2018-09-141-1/+1
| | | | llvm-svn: 342267
* [clangd] Work around compiler macro expansion bugs(?) in completion testsSam McCall2018-09-141-3/+3
| | | | llvm-svn: 342261
* [modernize-use-transparent-functors] TypeLocs can be implicitly created, ↵Benjamin Kramer2018-09-142-1/+6
| | | | | | don't crash when encountering those. llvm-svn: 342252
* [clangd] Don't override the preamble while completing inside it, it doesn't ↵Sam McCall2018-09-142-2/+27
| | | | | | | | | | | | | | | | | | | | work. Summary: To stay fast, enable single-file-mode instead. This is fine since completions in the preamble are simple. The net effect for now is to suppress the spurious TopLevel completions when completing inside the preamble. Once Sema has include directive completion, this will be more important. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52071 llvm-svn: 342230
* [clangd] Don't double-infer compile commands after r342228Sam McCall2018-09-141-2/+0
| | | | llvm-svn: 342229
* [clangd] NFC: Fix IndexBenchmark CLI arguments handlingKirill Bobyrev2018-09-141-3/+5
| | | | llvm-svn: 342227
* [clangd] Update IndexerMain.cpp file comment after rename. NFCIlya Biryukov2018-09-141-1/+1
| | | | llvm-svn: 342226
* [clangd] Fix TUScheduler typosFangrui Song2018-09-142-7/+7
| | | | llvm-svn: 342198
* Update a clang-tidy test for r342194Vedant Kumar2018-09-131-2/+2
| | | | | | | | | | The location of implicit captures has changed. Update a use-after-move checker test to reflect that. This fixes a bot failure: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/36500 llvm-svn: 342195
* [clangd] Introduce PostingList interfaceKirill Bobyrev2018-09-138-161/+216
| | | | | | | | | | | | | | | | This patch abstracts `PostingList` interface and reuses existing implementation. It will be used later to test different `PostingList` representations. No functionality change is introduced, this patch is mostly refactoring so that the following patches could focus on functionality while not being too hard to review. Reviewed By: sammccall, ioeric Differential Revision: https://reviews.llvm.org/D51982 llvm-svn: 342155
* [clangd] Fix Dexp buildKirill Bobyrev2018-09-131-1/+1
| | | | | | %s/MaxCandidateCount/Limit/g after rL342138. llvm-svn: 342143
* [clangd] Cleanup FuzzyFindRequest filtering limit semanticsKirill Bobyrev2018-09-139-34/+38
| | | | | | | | | | | As discussed during D51860 review, it is better to use `llvm::Optional` here as it has clear semantics which reflect intended behavior. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52028 llvm-svn: 342138
* [clangd] Use JSON format in benchmark requests readerKirill Bobyrev2018-09-134-42/+41
| | | | | | | | | | | | After `FuzzyFindRequest` JSON (de)serialization was introduced, it should replace ad-hoc fuzzy-find request parsing implemented in the IndexBenchmark driver. Reviewed By: ilya-biryukov Differential Revision: https://reviews.llvm.org/D51971 llvm-svn: 342137
* [clangd] Allow all LSP methods to signal cancellation via $/cancelRequestSam McCall2018-09-1310-154/+103
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The cancelable scopes are managed by JSONRPCDispatcher so that all Handlers run in cancelable contexts. (Previously ClangdServer did this, for code completion only). Cancellation request processing is therefore also in JSONRPCDispatcher. (Previously it was in ClangdLSPServer). This doesn't actually make any new commands *respect* cancellation - they'd need to check isCancelled() and bail out. But it opens the door to doing this incrementally, and putting such logic in common machinery like TUScheduler. I also rewrote the ClangdServer class/threading comments because I wanted to add to it and I got carried away. Reviewers: ilya-biryukov, kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52004 llvm-svn: 342135
* [clangd] Clarify and hide -index flag.Eric Liu2018-09-131-4/+5
| | | | | | | | | | | | | | | Summary: The wording implies global index support, which is confusing. As most users shouldn't care about this flag, also make it hidden to avoid further confusion. Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51977 llvm-svn: 342134
* [clangd] Simplify cancellation public APISam McCall2018-09-137-151/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Task is no longer exposed: - task cancellation is hidden as a std::function - task creation returns the new context directly - checking is via free function only, with no way to avoid the context lookup The implementation is essentially the same, but a bit terser as it's hidden. isCancelled() is now safe to use outside any task (it returns false). This will leave us free to sprinkle cancellation in e.g. TUScheduler without needing elaborate test setup, and lets callers that don't cancel "just work". Updated the docs to describe the new expected use pattern. One thing I noticed: there's nothing async-specific about the cancellation. Async tasks can be cancelled from any thread (typically the one that created them), sync tasks can be cancelled from any *other* thread in the same way. So the docs now refer to "long-running" tasks instead of async ones. Updated usage in code complete, without any structural changes. I didn't update all the names of the helpers in ClangdLSPServer (these will likely be moved to JSONRPCDispatcher anyway). Reviewers: ilya-biryukov, kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D51996 llvm-svn: 342130
* [docs] Provide pointers to known editor plugins and extensionsKirill Bobyrev2018-09-131-0/+35
| | | | | | | | | | | | Many editors provide extensions and plugins with LSP Client functionality. Many of these are known to work with Clangd, this patch points users to the relevant resources for better experience. Reviewed By: ioeric, ilya-biryukov Differential Revision llvm-svn: 342129
* [clangd] Don't create child AND and OR iterators with one posting listKirill Bobyrev2018-09-131-3/+7
| | | | | | | | | | | | | | `AND( AND( Child ) ... )` -> `AND( Child ... )` `AND( OR( Child ) ... )` -> `AND( Child ... )` This simple optimization results in 5-6% performance improvement in the benchmark with 2000 serialized `FuzzyFindRequest`s. Reviewed By: ilya-biryukov Differential Revision: https://reviews.llvm.org/D52016 llvm-svn: 342124
* [clangd] Rename global-symbol-builder to clangd-indexer.Ilya Biryukov2018-09-135-8/+8
| | | | | | | | | | | | | | | | | | | Summary: Given that the indexer binary is put directly into ./bin directory when built, 'clangd-' prefix seems to provide better context to the reader than 'global-'. The new name is also shorter and easier to type. Reviewers: ioeric, sammccall, kadircet Reviewed By: ioeric, sammccall Subscribers: kbobyrev, ilya-biryukov, mgorny, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51987 llvm-svn: 342123
* Fix MSVC "not all control paths return a value" warnings. NFCI.Simon Pilgrim2018-09-121-0/+2
| | | | llvm-svn: 342052
* [clang-tidy] Abseil: Add more directories that are slated for future absl ↵Benjamin Kramer2018-09-121-3/+4
| | | | | | expansion. llvm-svn: 342041
* [clangd] Add missing clangBasic target_link_librariesHeejin Ahn2018-09-121-0/+1
| | | | | | Without this, builds with `-DSHARED_LIB=ON` fail. llvm-svn: 342037
* Fix buildbots after r342027Kirill Bobyrev2018-09-121-1/+2
| | | | llvm-svn: 342036
* [clangd] Add index benchmarksKirill Bobyrev2018-09-128-0/+160
| | | | | | | | | | | This patch introduces index benchmarks on top of the proposed LLVM benchmark pull. Reviewed By: sammccall, lebedev.ri Differential Revision: https://reviews.llvm.org/D51090 llvm-svn: 342026
* [clangd] Implement a Proof-of-Concept tool for symbol index explorationKirill Bobyrev2018-09-123-0/+177
| | | | | | | | Reviewed By: sammccall, ilya-biryukov Differential Revision: https://reviews.llvm.org/D51628 llvm-svn: 342025
* [NFC] Fix build breakage due to missing dep caused by D51950Shuai Wang2018-09-121-0/+1
| | | | llvm-svn: 342012
OpenPOWER on IntegriCloud