summaryrefslogtreecommitdiff
path: root/clang-tools-extra
AgeCommit message (Collapse)Author
2018-09-10docs: drop doxygen link; it doesn't workHans Wennborg
2018-09-07ReleaseNotes: tidy up for the releaseHans Wennborg
2018-08-01[clangd] Correct the namespace of ParsedAST forward declaration, NFC.Haojian Wu
2018-08-01[clangd] Receive compilationDatabasePath in 'initialize' requestSimon Marchi
Summary: That way, as soon as the "initialize" is received by the server, it can start parsing/indexing with a valid compilation database and not have to wait for a an initial 'didChangeConfiguration' that might or might not happen. Then, when the user changes configuration, a didChangeConfiguration can be sent. Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewers: malaperle Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D49833
2018-08-01[clangd] Make SymbolLocation => bool conversion explicitly.Haojian Wu
Summary: The implicit bool conversion could happen superisingly, e.g. when checking `if (Loc1 == Loc2)`, the compiler will convert SymbolLocation to bool before comparing (because we don't define operator `==` for SymbolLocation). Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D49657
2018-07-31[clang-tidy] add all clang-tidy modules to pluginJonas Toth
Summary: This patch addresses PR38359 and adds all existing clang-tidy modules to the plugin that can be used together with libclang. Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov Reviewed By: alexfh Subscribers: srhines, mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D50060
2018-07-31[clangd] Do not build AST if no diagnostics were requestedIlya Biryukov
Summary: It can be removed from the cache before the first access anyway, so building it can be a waste of time. Reviewers: ioeric Reviewed By: ioeric Subscribers: javed.absar, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D49991
2018-07-31[clangd] Report diagnostics even if WantDiags::No AST was reusedIlya Biryukov
Summary: After r338256, clangd stopped reporting diagnostics if WantDiags::No request is followed by a WantDiags::Yes request but the AST can be reused. Reviewers: ioeric Reviewed By: ioeric Subscribers: javed.absar, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50045
2018-07-30[clangd] Remove outdated comment. NFCIlya Biryukov
2018-07-30[clangd] Do not remove AST from cache if nothing changedIlya Biryukov
We were previously clearing the AST cache if the inputs and the preamble were the same, which is not desired.
2018-07-30[clangd] Fix a comment. NFCIlya Biryukov
2018-07-29[clangd] Add command-line optionRaoul Wols
to suppress the space and the circular dot prepended in a completion label.
2018-07-27[clang-tidy] Fix a crash in fuchsia-multiple-inheritanceIlya Biryukov
Summary: See the test case for a repro. Reviewers: juliehockett, ioeric, hokein, aaron.ballman Reviewed By: hokein Subscribers: lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D49862
2018-07-27[clangd] Return Dex IteratorsKirill Bobyrev
The original Dex Iterators patch (https://reviews.llvm.org/rL338017) caused problems for Clang 3.6 and Clang 3.7 due to the compiler bug which prevented inferring template parameter (`Size`) in create(And|Or)? functions. It was reverted in https://reviews.llvm.org/rL338054. In this revision the mentioned helper functions were replaced with variadic templated versions. Proposed changes were tested on multiple compiler versions, including Clang 3.6 which originally caused the failure.
2018-07-26Revert Clangd Dex Iterators patchKirill Bobyrev
This reverts two revisions: * https://reviews.llvm.org/rL338017 * https://reviews.llvm.org/rL338028 They caused crash for Clang 3.6 & Clang 3.7 buildbots, it was reported by Jeremy Morse.
2018-07-26[clangd] Use 'const Twine&' instead of 'Twine'. NFCIlya Biryukov
To fix clang-tidy warning
2018-07-26[clangd] Fix unit tests for DexKirill Bobyrev
Iterators took temporary objects in constructors, objects were invalidated when built with recent Clang which resulted in crashes.
2018-07-26[clang-tidy] Fix llvm.org/PR38315 (support type aliases in ↵Alexander Kornienko
modernize-shrink-to-fit)
2018-07-26[clangd] Fix (most) naming warnings from clang-tidy. NFCIlya Biryukov
2018-07-26[clangd] Proof-of-concept query iterators for Dex symbol indexKirill Bobyrev
This patch introduces three essential types of query iterators: `DocumentIterator`, `AndIterator`, `OrIterator`. It provides a convenient API for query tree generation and serves as a building block for the next generation symbol index - Dex. Currently, many optimizations are missed to improve code readability and to serve as the reference implementation. Potential improvements are briefly mentioned in `FIXME`s and will be addressed in the following patches. Dex RFC in the mailing list: http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html Iterators, their applications and potential extensions are explained in detail in the design proposal: https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj Reviewers: ioeric, sammccall, ilya-biryukov Subscribers: cfe-commits, klimek, jfb, mgrang, mgorny, MaskRay, jkorous, arphaman Differential Revision: https://reviews.llvm.org/D49546
2018-07-26[clangd] Give an example for symbol-builder usageKirill Bobyrev
`global-symbol-builder` help message mentions `-executor=<string>` option, but doesn't give any example of what the value could be Assuming the most popular use case to be building the whole project index, help message should probably give an example of such usage. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49785
2018-07-26[clangd] Do not rebuild AST if inputs have not changedIlya Biryukov
Summary: If the contents are the same, the update most likely comes from the fact that compile commands were invalidated. In that case we want to avoid rebuilds in case the compile commands are actually the same. Reviewers: ioeric Reviewed By: ioeric Subscribers: simark, javed.absar, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D49783
2018-07-25[clangd] Use a sigmoid style function for #usages boost in symbol quality.Eric Liu
Summary: This has a shape to similar logarithm function but grows much slower for large #usages. Metrics: https://reviews.llvm.org/P8096 Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D49780
2018-07-25[clangd] Introduce Dex symbol index search tokensKirill Bobyrev
This patch introduces the core building block of the next-generation Clangd symbol index - Dex. Search tokens are the keys in the inverted index and represent a characteristic of a specific symbol: examples of search token types (Token Namespaces) are * Trigrams - these are essential for unqualified symbol name fuzzy search * Scopes for filtering the symbols by the namespace * Paths, e.g. these can be used to uprank symbols defined close to the edited file This patch outlines the generic for such token namespaces, but only implements trigram generation. The intuition behind trigram generation algorithm is that each extracted trigram is a valid sequence for Fuzzy Matcher jumps, proposed implementation utilize existing FuzzyMatcher API for segmentation and trigram extraction. However, trigrams generation algorithm for the query string is different from the previous one: it simply yields sequences of 3 consecutive lowercased valid characters (letters, digits). Dex RFC in the mailing list: http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html The trigram generation techniques are described in detail in the proposal: https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj Reviewers: sammccall, ioeric, ilya-biryukovA Subscribers: cfe-commits, klimek, mgorny, MaskRay, jkorous, arphaman Differential Revision: https://reviews.llvm.org/D49591
2018-07-24[clangd] Guard fuzzer against empty inputs.Benjamin Kramer
2018-07-24[clangd] Tune down quality score for class constructors so that it's ranked ↵Eric Liu
after class types. Summary: Currently, class constructors have the same score as the class types, and they are often ranked before class types. This is often not desireable and can be annoying when snippet is enabled and constructor signatures are added. Metrics: ``` ================================================================================================== OVERALL ================================================================================================== Total measurements: 111117 (+0) All measurements: MRR: 64.06 (+0.20) Top-5: 75.73% (+0.14%) Top-100: 93.71% (+0.01%) Full identifiers: MRR: 98.25 (+0.55) Top-5: 99.04% (+0.03%) Top-100: 99.16% (+0.00%) Filter length 0-5: MRR: 15.23 (+0.02) 50.50 (-0.02) 65.04 (+0.11) 70.75 (+0.19) 74.37 (+0.25) 79.43 (+0.32) Top-5: 40.90% (+0.03%) 74.52% (+0.03%) 87.23% (+0.15%) 91.68% (+0.08%) 93.68% (+0.14%) 95.87% (+0.12%) Top-100: 68.21% (+0.02%) 96.28% (+0.07%) 98.43% (+0.00%) 98.72% (+0.00%) 98.74% (+0.01%) 98.81% (+0.00%) ================================================================================================== DEFAULT ================================================================================================== Total measurements: 57535 (+0) All measurements: MRR: 58.07 (+0.37) Top-5: 69.94% (+0.26%) Top-100: 90.14% (+0.03%) Full identifiers: MRR: 97.13 (+1.05) Top-5: 98.14% (+0.06%) Top-100: 98.34% (+0.00%) Filter length 0-5: MRR: 13.91 (+0.00) 38.53 (+0.01) 55.58 (+0.21) 63.63 (+0.30) 69.23 (+0.47) 72.87 (+0.60) Top-5: 24.99% (+0.00%) 62.70% (+0.06%) 82.80% (+0.30%) 88.66% (+0.16%) 92.02% (+0.27%) 93.53% (+0.21%) Top-100: 51.56% (+0.05%) 93.19% (+0.13%) 97.30% (+0.00%) 97.81% (+0.00%) 97.85% (+0.01%) 97.79% (+0.00%) ``` Remark: - The full-id completions have +1.05 MRR improvement. - There is no noticeable impact on EXPLICIT_MEMBER_ACCESS and WANT_LOCAL. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D49667
2018-07-23[clang-tidy] fix PR36489 - respect deduced pointer types from auto as wellJonas Toth
Summary: The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where pointer arithmetic is used, but does not check values where the pointer types is deduced via `auto`. This patch adjusts this behaviour and solved PR36489. I accidentally commited a wrong patch, this Differential is meant to have a correct revision description and code attached to it. Because the patch was accepted by aaron.ballman already, i will just commit it. See https://reviews.llvm.org/D48717 for the old differntial (contains wrong code from the mixup) Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D49682
2018-07-23Revert "[clang-tidy] fix PR36489 - respect deduced pointer types from auto ↵Jonas Toth
as well" I applied the wrong patch.
2018-07-23[clang-tidy] fix PR36489 - respect deduced pointer types from auto as wellJonas Toth
Summary: The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where pointer arithmetic is used, but does not check values where the pointer types is deduced via ``auto``. This patch adjusts this behaviour and solved PR36489. Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov Reviewed By: alexfh, aaron.ballman Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D48717
2018-07-23[clang-tidy] remove private decltypeType in TrailingReturnTypeJonas Toth
Summary: This patch removes a private matcher in fuchsia/TrailingReturnType check because the matcher is now in ASTMatchers Reviewers: aaron.ballman, alexfh, hokein Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D49618
2018-07-23[clangd] Fix category in clangd-vscode's package.jsonSimon Marchi
Summary: When opening package.json, vscode shows: Use 'Programming Languages' instead Replacing "Languages" with this fixes it. Reviewers: ilya-biryukov Subscribers: arphaman, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49253
2018-07-23[clangd] Penalize non-instance members when accessed via class instances.Eric Liu
Summary: The following are metrics for explicit member access completions. There is no noticeable impact on other completion types. Before: EXPLICIT_MEMBER_ACCESS Total measurements: 24382 All measurements: MRR: 62.27 Top10: 80.21% Top-100: 94.48% Full identifiers: MRR: 98.81 Top10: 99.89% Top-100: 99.95% 0-5 filter len: MRR: 13.25 46.31 62.47 67.77 70.40 81.91 Top-10: 29% 74% 84% 91% 91% 97% Top-100: 67% 99% 99% 99% 99% 100% After: EXPLICIT_MEMBER_ACCESS Total measurements: 24382 All measurements: MRR: 63.18 Top10: 80.58% Top-100: 95.07% Full identifiers: MRR: 98.79 Top10: 99.89% Top-100: 99.95% 0-5 filter len: MRR: 13.84 48.39 63.55 68.83 71.28 82.64 Top-10: 30% 75% 84% 91% 91% 97% Top-100: 70% 99% 99% 99% 99% 100% * Top-N: wanted result is found in the first N completion results. * MRR: Mean reciprocal rank. Remark: the change seems to have minor positive impact. Although the improvement is relatively small, down-ranking non-instance members in instance member access should reduce noise in the completion results. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D49543
2018-07-22[clangd] Unbreak fuzzer build.Benjamin Kramer
2018-07-20[clang-doc] Create a script to generate testsJulie Hockett
Upstreaming the script I use to generate clang-doc tests (and updating the existing tests to use it) Differential Revision: https://reviews.llvm.org/D49268
2018-07-20[clang-doc] Adding PublicOnly flagJulie Hockett
Submitted on behalf of Annie Cherkaev (@anniecherk) Added a flag which, when enabled, documents only those methods and fields which have a Public attribute. Differential Revision: https://reviews.llvm.org/D48395
2018-07-20[clangd] Fix racy use-after-scope in unittestBenjamin Kramer
This only shows up with asan when the stars align in a bad way.
2018-07-20[clangd] FuzzyMatch exposes an API for its word segmentation. NFCSam McCall
Summary: This is intended to be used for indexing, e.g. in D49417 Reviewers: ioeric, omtcyfz Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D49540
2018-07-18[clangd] Also get scope for RK_pattern completion results.Eric Liu
For exmaple, clas field candidates in constructor initializers can be RK_Pattern, but they can still have scopes.
2018-07-17[clang-tidy: modernize] Fix modernize-use-equals-default with {} brackets ↵Idriss Riouak
list initialization: patch 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=38039 where you can find more information. ``` struct UOB{ UOB(const UOB &Other):j{Other.j}{} int j; }; ``` In this case the check modernize-use-equals-default does not detect copy constructors that can be defaulted; that should be: ``` struct UOB{ UOB(const UOB &Other) = default; int j; }; ``` Reviewers: aaron.ballman, hokein, alexfh Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49356
2018-07-14[clang-tidy] Force exceptions to be enabled in testBenjamin Kramer
For targets that have them off by default.
2018-07-13[Documentation] Add missing description for bugprone-exception-escape in ↵Eugene Zelenko
Release Notes.
2018-07-13[clang-tidy] Exception Escape CheckerAdam Balogh
Finds functions which may throw an exception directly or indirectly, but they should not: Destructors, move constructors, move assignment operators, the main() function, swap() functions, functions marked with throw() or noexcept and functions given as option to the checker. Differential Revision: https://reviews.llvm.org/D33537
2018-07-13[clang-tidy] readability-inconsistent-declaration-parameter-name: accept ↵Sam McCall
approximate name matches. Summary: The goal is to reduce false positives when the difference is intentional, like: foo(StringRef name); foo(StringRef name_ref) { string name = cleanup(name_ref); ... } Or semantically unimportant, like: foo(StringRef full_name); foo(StringRef name) { ... } There are other matching names we won't recognise (e.g. syns vs synonyms) but this catches many that we see in practice, and gives people a systematic workaround. The old behavior is available as a 'Strict' option. Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D49285
2018-07-12[clang-tidy/ObjC] Add SQL to list of acronymsBen Hamilton
Summary: SQL is a common acronym. Reviewers: Wizard, hokein Reviewed By: Wizard, hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49190
2018-07-12[clangd] Extract FileSystemProvider into a separate header. NFCSam McCall
Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49142
2018-07-12[clangd] log request/response messages with method/ID/error at INFO levelSam McCall
Summary: Bodies are logged at VERBOSE level (since r336785), tweak the formatting. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49224
2018-07-12[clangd] Simplify logging wrapper after r336888Sam McCall
2018-07-11[Documentation] Fix incorrect documentation references, new checks order in ↵Eugene Zelenko
Release Notes
2018-07-11[Documentation] Link format and order of Clang-tidy changes in Release NotesEugene Zelenko
2018-07-11[clangd] Uprank delcarations when "using q::name" is present in the main fileKirill Bobyrev
Having `using qualified::name;` for some symbol is an important signal for clangd code completion as the user is more likely to use such symbol. This patch helps to uprank the relevant symbols by saving UsingShadowDecl in the new field of CodeCompletionResult and checking whether the corresponding UsingShadowDecl is located in the main file later in ClangD code completion routine. While the relative importance of such signal is a subject to change in the future, this patch simply bumps DeclProximity score to the value of 1.0 which should be enough for now. The patch was tested using `$ ninja check-clang check-clang-tools` No unexpected failures were noticed after running the relevant testsets. Reviewers: sammccall, ioeric Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49012