summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Remove override result handling logic from clangdKadir Cetinkaya2018-10-021-90/+9
| | | | | | | | | | | | | | | | | Summary: Since we plan to move handling of override suggestions to Sema with D52225 this patch just makes sure clangd-side has no logic related to that anymore and updates tests. Reviewers: ioeric, ilya-biryukov Reviewed By: ioeric Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52226 llvm-svn: 343567
* [clang-tidy] NFC use CHECK-NOTES in test for cppgoreguidelines-avoid-gotoJonas Toth2018-10-021-8/+8
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D52686 llvm-svn: 343565
* [clang-tidy] NFC use CHECK-NOTES in tests for cppcoreguidelines-owning-memoryJonas Toth2018-10-022-49/+50
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D52687 llvm-svn: 343564
* Sort expected test output after previous commitStephen Kelly2018-10-011-6/+6
| | | | llvm-svn: 343538
* [clang-query] Test non-code-completion on single letter shortcutsStephen Kelly2018-10-011-0/+10
| | | | llvm-svn: 343536
* [clang-query] Add missing quit testStephen Kelly2018-10-011-0/+9
| | | | llvm-svn: 343535
* [clang-query] Add missing 'l' command handlingStephen Kelly2018-10-012-0/+7
| | | | | | | | | | | | The `let` command was added in commit 045c15ba (Add new 'let' command to bind arbitrary values into constants., 2014-04-23). The `let` command and the non-existant `l` command were documented in commit 233092a0 (Add 'let' to the help message., 2015-02-27). Implement the `l` command now for completeness. llvm-svn: 343533
* [clang-query] Sort command optionsStephen Kelly2018-10-011-2/+2
| | | | llvm-svn: 343532
* [clang-tidy] Build it even without static analyzerStephen Kelly2018-10-0119-38/+75
| | | | | | | | | | | | | | | | | | | | | | Conditionally compile the parts of clang-tidy which depend on the static analyzer. Funnily enough, I made the patch to exclude this from the build in 2013, and it was committed with the comment that the tool should not be fully excluded, but only the parts of it which depend on the analyzer should be excluded. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130617/081797.html This commit implements that idea. Reviewed By: aaron.ballman Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52334 llvm-svn: 343528
* [clangd] exclude check-clangd from check-all, fix buildbot failure.Haojian Wu2018-10-011-0/+3
| | | | | | | | check-clangd is included via check-clang-tools, otherwise we will run two instances of check-clangd in parallel when running 'check-all', which may have race condition. llvm-svn: 343526
* [clangd] Add "check-clangd" targetHaojian Wu2018-10-011-15/+16
| | | | | | | | | | | | | | | | | | | | | Summary: So we don't have to run "check-clang-tools" (which builds and tests all clang tools) to verify our clangd-related change. It'd save waiting time for clangd developers. check-clangd (build ~1000 files, run ~340 tests) vs check-clang-tools (build ~3000 files, run ~1000 tests). In the future, we probably want to add similar target for other clang-tools (e.g. clang-tidy). Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52710 llvm-svn: 343474
* [clangd] Query dex index using query-style trigrams, not identifier-style ↵Sam McCall2018-10-011-1/+1
| | | | | | trigrams llvm-svn: 343453
* [clangd] Fix header mapping for std::string. NFCEric Liu2018-10-011-0/+1
| | | | | | Some implementation has std::string declared in <iosfwd>. llvm-svn: 343448
* Reverting r343415 as it breaks at least one of the bots.Aaron Ballman2018-09-3019-72/+38
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/37336 llvm-svn: 343418
* Allow clang-tidy to be built without a dependency on the clang static analyzer.Aaron Ballman2018-09-3019-38/+72
| | | | | | Patch by Stephen Kelly. llvm-svn: 343415
* [cxx2a] Fix warning triggered by r343285Vitaly Buka2018-09-291-1/+0
| | | | llvm-svn: 343369
* [docs] Fix links in Clangd documentationKirill Bobyrev2018-09-281-3/+3
| | | | | | | Add missing `_` after each `external link <https://llvm.org>`_, as required by the reStructuredText specification. llvm-svn: 343306
* [clangd] Initial supoprt for cross-namespace global code completion.Eric Liu2018-09-278-15/+130
| | | | | | | | | | | | | | | | | | | | | Summary: When no scope qualifier is specified, allow completing index symbols from any scope and insert proper automatically. This is still experimental and hidden behind a flag. Things missing: - Scope proximity based scoring. - FuzzyFind supports weighted scopes. Reviewers: sammccall Reviewed By: sammccall Subscribers: kbobyrev, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52364 llvm-svn: 343248
* [clangd] Add more tracing to index queries. NFCEric Liu2018-09-273-2/+28
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52611 llvm-svn: 343247
* Introduce completionItemKind capability support.Kadir Cetinkaya2018-09-274-35/+131
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52616 llvm-svn: 343237
* [clangd] Make IncludeInserter less slow. NFCEric Liu2018-09-272-9/+9
| | | | llvm-svn: 343223
* Tell whether file/folder for include completions.Kadir Cetinkaya2018-09-273-0/+33
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52547 llvm-svn: 343221
* [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usageJonas Toth2018-09-272-12/+12
| | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52229 llvm-svn: 343201
* [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-moveJonas Toth2018-09-271-110/+110
| | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52228 llvm-svn: 343199
* [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespaceJonas Toth2018-09-271-22/+22
| | | | | | | | | | Reviewers: aaron.ballman, alexfh, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52185 llvm-svn: 343198
* Improve diagnostics range reporting.Kadir Cetinkaya2018-09-272-3/+20
| | | | | | | | | | | | | | | | Summary: If we have some range information coming from clang diagnostic, promote that one even if it doesn't contain diagnostic location inside. Reviewers: sammccall, ioeric Reviewed By: ioeric Subscribers: ilya-biryukov, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52544 llvm-svn: 343197
* [clang-tidy] Add dependency to clangAnalysis after rC343160Fangrui Song2018-09-271-0/+1
| | | | llvm-svn: 343168
* llvm::sort(C.begin(), C.end()) -> llvm::sort(C)Fangrui Song2018-09-271-1/+1
| | | | | | The convenience wrapper in STLExtras is available since rL342102. llvm-svn: 343166
* [clangd] Fix bugs with incorrect memory estimate reportKirill Bobyrev2018-09-263-11/+12
| | | | | | | | | | | | | | * With the current implementation, `sizeof(std::vector<Chunk>)` is added twice to the `Dex` memory estimate which is incorrect * `Dex` logs memory usage estimation before `BackingDataSize` is set and hence the log report excludes size of the external `SymbolSlab` which is coupled with `Dex` instance Reviewed By: ioeric Differential Revision: https://reviews.llvm.org/D52503 llvm-svn: 343117
* [docs] Update PostingList string representation formatKirill Bobyrev2018-09-261-3/+2
| | | | | | | | | | | | Because `PostingList` objects are compressed, it is now impossible to see elements other than the current one and the documentation doesn't match implementation anymore. Reviewed By: ioeric Differential Revision: https://reviews.llvm.org/D52545 llvm-svn: 343116
* Removed extra semicolon to fix Wpedantic. (NFCI).Simon Pilgrim2018-09-261-1/+1
| | | | llvm-svn: 343083
* [clangd] Fix crash if pending computations were active on exitIlya Biryukov2018-09-262-62/+69
| | | | | | | | | | | | | | | | Summary: Make sure JSONRPCDispatcher outlives the worker threads, they access its fields to remove the stored cancellations when Context dies. Reviewers: sammccall, ioeric Reviewed By: ioeric Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52420 llvm-svn: 343067
* [clangd] Handle template args for disabled function arg snippetsIlya Biryukov2018-09-262-15/+78
| | | | | | | | | | | | Reviewers: kadircet, ioeric, sammccall Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52422 llvm-svn: 343066
* [clangd] Remove unused using-declaration testing::AllOfFangrui Song2018-09-251-1/+0
| | | | llvm-svn: 343039
* [clangd] Extract mapper logic from clangd-indexer into a library.Sam McCall2018-09-256-69/+126
| | | | | | | | | | | | | Summary: Soon we can drop support for MR-via-YAML. I need to modify some out-of-tree versions to use the library, first. Reviewers: kadircet Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52465 llvm-svn: 343019
* [clangd] Fix reversed RIFF/YAML serializationSam McCall2018-09-251-2/+2
| | | | llvm-svn: 343017
* [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effectsJonas Toth2018-09-251-19/+38
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52230 llvm-svn: 343001
* [clang-tidy] Add modernize-concat-nested-namespaces checkJonas Toth2018-09-258-2/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Finds instances of namespaces concatenated using explicit syntax, such as `namespace a { namespace b { [...] }}` and offers fix to glue it to `namespace a::b { [...] }`. Properly handles `inline` and unnamed namespaces. ~~Also, detects empty blocks in nested namespaces and offers to remove them.~~ Test with common use cases included. I ran the check against entire llvm repository. Except for expected `nested namespace definitions only available with -std=c++17 or -std=gnu++17` warnings I noticed no issues when the check was performed. Example: ``` namespace a { namespace b { void test(); }} ``` can become ``` namespace a::b { void test(); } ``` Patch by wgml! Reviewers: alexfh, aaron.ballman, hokein Reviewed By: aaron.ballman Subscribers: JonasToth, Eugene.Zelenko, lebedev.ri, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52136 llvm-svn: 343000
* [clangd] Merge binary + YAML serialization behind a (mostly) common interface.Sam McCall2018-09-2511-175/+174
| | | | | | | | | | | | | | | | | Summary: Interface is in one file, implementation in two as they have little in common. A couple of ad-hoc YAML functions left exposed: - symbol -> YAML I expect to keep for tools like dexp - YAML -> symbol is used for the MR-style indexer, I think we can eliminate this (merge-on-the-fly, else use a different serialization) Reviewers: kbobyrev Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52453 llvm-svn: 342999
* [clangd] NFC: Simplify code, enforce LLVM Coding StandardsKirill Bobyrev2018-09-256-73/+73
| | | | | | | | | | | | | | | | For consistency, functional-style code pieces are replaced with their simple counterparts to improve readability. Also, file headers are fixed to comply with LLVM Coding Standards. `static` member of anonymous namespace is not marked `static` anymore, because it is redundant. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52466 llvm-svn: 342974
* [clangd] Fix some buildbots after r342965Kirill Bobyrev2018-09-251-1/+1
| | | | | | Some compilers fail to parse struct default member initializer. llvm-svn: 342970
* [clangd] Implement VByte PostingList compressionKirill Bobyrev2018-09-254-87/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements Variable-length Byte compression of `PostingList`s to sacrifice some performance for lower memory consumption. `PostingList` compression and decompression was extensively tested using fuzzer for multiple hours and runnning significant number of realistic `FuzzyFindRequests`. AddressSanitizer and UndefinedBehaviorSanitizer were used to ensure the correct behaviour. Performance evaluation was conducted with recent LLVM symbol index (292k symbols) and the collection of user-recorded queries (7751 `FuzzyFindRequest` JSON dumps): | Metrics | Before| After | Change (%) | ----- | ----- | ----- | ----- | Memory consumption (posting lists only), MB | 54.4 | 23.5 | -60% | Time to process queries, sec | 7.70 | 9.4 | +25% Reviewers: sammccall, ioeric Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52300 llvm-svn: 342965
* [clangd] Fix build bot after r342961Eric Liu2018-09-251-4/+3
| | | | | | | Use llvm::isAlpha instead of std::isalpha etc. This should fix bot failure: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20180 llvm-svn: 342964
* [clangd] Check that scheme is valid when parsing URI.Eric Liu2018-09-252-5/+24
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52455 llvm-svn: 342961
* Fix a typo in the help of clangdSylvestre Ledru2018-09-251-1/+1
| | | | llvm-svn: 342960
* [clangd] NFC: Remove test duplicateKirill Bobyrev2018-09-251-11/+0
| | | | | | | `FuzzyMatchQ` test was a duplicate of `FuzzyMatch` pulled from MemIndex tests. llvm-svn: 342957
* Deduplicate replacements from diagnostics.Eric Liu2018-09-255-9/+31
| | | | | | | | | | | | | | | | | | | Summary: After r329813, clang-apply-replacements stopped deduplicating identical replacements; however, tools like clang-tidy relies on the deduplication of identical dignostics replacements from different TUs to apply fixes correctly. This change partially roll back the behavior by deduplicating changes from diagnostics. Ideally, we should deduplicate on diagnostics level, but we need to figure out an effecient way. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52264 llvm-svn: 342951
* [clangd] Fix uninit bool in r342888Sam McCall2018-09-241-1/+1
| | | | llvm-svn: 342903
* [clangd] Do bounds checks while reading data, otherwise var-length records ↵Sam McCall2018-09-241-139/+138
| | | | | | are too painful. NFC llvm-svn: 342888
* [clangd] Force Dex to respect symbol collector flagsKirill Bobyrev2018-09-242-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | `Dex` should utilize `FuzzyFindRequest.RestrictForCodeCompletion` flags and omit symbols not meant for code completion when asked for it. The measurements below were conducted with setting `FuzzyFindRequest.RestrictForCodeCompletion` to `true` (so that it's more realistic). Sadly, the average latency goes down, I suspect that is mostly because of the empty queries where the number of posting lists is critical. | Metrics | Before | After | Relative difference | ----- | ----- | ----- | ----- | Cumulative query latency (7000 `FuzzyFindRequest`s over LLVM static index) | 6182735043 ns | 7202442053 ns | +16% | Whole Index size | 81.24 MB | 81.79 MB | +0.6% Out of 292252 symbols collected from LLVM codebase 136926 appear to be restricted for code completion. Reviewers: ioeric Differential Revision: https://reviews.llvm.org/D52357 llvm-svn: 342866
OpenPOWER on IntegriCloud