summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Add unit tests for comments in system headersIlya Biryukov2019-11-071-0/+27
|
* [clangd] Set RetainCommentsFromSystemHeaders to trueIlya Biryukov2019-11-072-0/+2
| | | | | | | | | | clangd should retain comments from system headers. fixes https://github.com/clangd/clangd/issues/96 Patch by lh123! Differential revision: https://reviews.llvm.org/D69928
* [clang-tidy] Update TransformerClangTidyCheck to use new Transformer bindings.Yitzhak Mandelbaum2019-11-063-23/+22
| | | | | | | | | | | | | | Summary: Updates the relevant source files to use bindings in `clang::transformer` rather than `clang::tooling`. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69804
* [clangd] Improve the output of rename tests where there are failures.Haojian Wu2019-11-061-64/+54
| | | | | | | | | | | | | | | Summary: Previously, we match ranges, which is hard to spot the difference. Now, we diff the code after rename against the expected result, it produces much nicer output. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69890
* [clangd] Implement a function to lex the file to find candidate occurrences.Haojian Wu2019-11-063-17/+56
| | | | | | | | | | | | | | Summary: This will be used for incoming cross-file rename (to detect index staleness issue). Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69615
* [clang-tidy] Add readability-make-member-function-constMatthias Gehre2019-11-068-0/+708
| | | | | | | | | | | | | | | | | | Summary: Finds non-static member functions that can be made ``const`` because the functions don't use ``this`` in a non-const way. The check conservatively tries to preserve logical costness in favor of physical costness. See readability-make-member-function-const.rst for more details. Reviewers: aaron.ballman, gribozavr, hokein, alexfh Subscribers: mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68074
* [clangd] Implement semantic highlightings via findExplicitReferencesIlya Biryukov2019-11-054-151/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To keep the logic of finding locations of interesting AST nodes in one place. The advantage is better coverage of various AST nodes, both now and in the future: as new nodes get added to `findExplicitReferences`, semantic highlighting will automatically pick them up. The drawback of this change is that we have to traverse declarations inside our file twice in order to highlight dependent names, 'auto' and 'decltype'. Hopefully, this should not affect the actual latency too much, most time should be spent in building the AST and not traversing it. Reviewers: hokein Reviewed By: hokein Subscribers: nridge, merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69673
* [clang-tidy] New checker performance-trivially-destructible-checkAnton Bikineev2019-11-0111-1/+254
| | | | | | | | | | | | | Checks for types which can be made trivially-destructible by removing out-of-line defaulted destructor declarations. The check is motivated by the work on C++ garbage collector in Blink (rendering engine for Chrome), which strives to minimize destructors and improve runtime of sweeping phase. In the entire chromium codebase the check hits over 2000 times. Differential Revision: https://reviews.llvm.org/D69435
* Refactor getDeclAtPosition() to use SelectionTree + targetDecl()Nathan Ridge2019-10-314-114/+94
| | | | | | | | | | | | Summary: This fixes issue #163, among other improvements to go-to-definition. Reviewers: sammccall Subscribers: jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69237
* [clangd] Fix namespace aliases in findExplicitReferencesIlya Biryukov2019-10-312-4/+30
| | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69624
* [clangd] Add fno-delayed-parsing to new define inline testsKadir Cetinkaya2019-10-311-0/+2
| | | | To unbreak windows buildbots.
* [clangd] Add parameter renaming to define-inline code actionKadir Cetinkaya2019-10-312-7/+177
| | | | | | | | | | | | | | | | | Summary: When moving a function definition to declaration location we also need to handle renaming of the both function and template parameters. This patch achives that by making sure every parameter name and dependent type in destination is renamed to their respective name in the source. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68937
* [clang-tidy] Regenerate clang-tidy check list 📋Stephane Moore2019-10-301-65/+64
| | | | | | | | | | | | | | | | | Summary: These changes were generated by invoking clang-tools-extra/clang-tidy/add_new_check.py and then reverting the check that was added. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69414
* Add a test file that was missed in 4de6b1586807285e20a5db6596519c2336a64568Vladimir Plyashkun2019-10-301-0/+33
|
* Add a test file that was missed in e477988309dbde214a6d16ec690a416882714aacDaniel2019-10-301-0/+27
|
* Fix readability-identifier-naming to prevent variables becoming keywords.Daniel2019-10-302-22/+68
| | | | | Do not provide a fix-it when clang-tidy encounters a name that would become a keyword.
* Add an option to hicpp-signed-bitwise for positive integer literals.Vladimir Plyashkun2019-10-304-3/+34
| | | | | This gives developers a way to deviate from the coding standard to reduce the chattiness of the check.
* Move this release note to its appropriate location; NFC.Aaron Ballman2019-10-301-5/+5
|
* Fix modernize-use-nodiscard for classes marked [[nodiscard]]Aaron Ballman2019-10-302-1/+8
| | | | | | | Current implementation suggests to add [[nodiscard]] to methods even if the return type is marked already as [[nodiscard]]. Patch by Eugene Sedykh.
* Fix a false positive in misc-redundant-expression checkAaron Ballman2019-10-302-8/+78
| | | | | | | | Do not warn for redundant conditional expressions when the true and false branches are expanded from different macros even when they are defined by one another. Patch by Daniel Krupp.
* Add the readability-redundant-access-specifiers check.Aaron Ballman2019-10-309-0/+345
| | | | | | This finds redundant access specifier declarations inside classes, structs, and unions. Patch by Mateusz Mackowski.
* [clangd] Add a hidden tweak to dump symbol under the cursor.Haojian Wu2019-10-292-0/+36
| | | | | | | | | | | | | | Summary: This provides a convenient way to see the SymbolID/USR of the symbol, mainly for debugging purpose. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69517
* [clangd] NFC, use URI::resolve to simplify the code.Haojian Wu2019-10-291-9/+5
|
* [clangd] Add missing highlights for using decls.Haojian Wu2019-10-292-5/+19
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69506
* Remove extra ';'. NFCI.Simon Pilgrim2019-10-281-1/+1
|
* [clangd] Do not report anonymous entities in findExplicitReferencesIlya Biryukov2019-10-282-9/+24
| | | | | | | | | | | | | | | | | | | Summary: Otherwise every client dealing with name location should handle anonymous names in a special manner. This seems too error-prone, clients can probably handle anonymous entities they care about differently. Reviewers: hokein Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69511
* [clangd] Flush streams when printing HoverInfo Name and DefinitionKadir Cetinkaya2019-10-281-0/+2
| | | | Summary: Fixes some windows breakages when compiled via msvc.
* [clangd] Do not highlight keywords in semantic highlightingIlya Biryukov2019-10-284-91/+88
| | | | | | | | | | | | | | | | | | Summary: Editors are good at highlightings the keywords themselves. Note that this only affects highlightings of builtin types spelled out as keywords in the source code. Highlightings of typedefs to builtin types are unchanged. Reviewers: hokein Reviewed By: hokein Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69431
* [clangd] Do not insert parentheses when completing a using declarationIlya Biryukov2019-10-282-5/+57
| | | | | | | | | | | | | | | | | | Summary: Would be nice to also fix this in clang, but that looks like more work if we want to preserve signatures in informative chunks. Fixes https://github.com/clangd/clangd/issues/118 Reviewers: kadircet Reviewed By: kadircet Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69382
* [clangd] Reland Store Index in Tweak::SelectionKadir Cetinkaya2019-10-285-9/+20
| | | | | | | | | | | | | | | | Summary: Incoming define out-of-line tweak requires access to index. This patch simply propogates the index in ClangdServer to Tweak::Selection while passing the AST. Also updates TweakTest to accommodate this change. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69165
* [clangd] Reland DefineInline action apply logic with fully qualified namesKadir Cetinkaya2019-10-284-15/+759
| | | | | | | | | | | | Summary: Initial version of DefineInline action that will fully qualify every name inside function body. Reviewers: sammccall, ilya-biryukov, hokein Tags: #clang Differential Revision: https://reviews.llvm.org/D66647
* [clangd] Reland DefineInline action availability checksKadir Cetinkaya2019-10-285-3/+395
| | | | | | | | | | | | | | | | Summary: Introduces DefineInline action and initial version of availability checks. Reviewers: sammccall, ilya-biryukov, hokein Reviewed By: hokein Subscribers: thakis, usaxena95, mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65433
* [clangd] Pass ExtraArgs to TestTU in TweakIsAvailable matcherKadir Cetinkaya2019-10-281-2/+4
|
* [clangd] Revert define-inline action changes to un-break windows build-botsKadir Cetinkaya2019-10-258-1159/+21
|
* [clangd][NFC] Get rid of raw string literals in macros to make stage1 ↵Kadir Cetinkaya2019-10-251-388/+413
| | | | compiler happy
* Fix compilation error in clangd/refactor/tweaks/ExpandAutoType.cppKadir Cetinkaya2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: During the compilation of the `clangd/refactor/tweaks/ExpandAutoType.cpp`, MSVC returns the following error: llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(85): error C2146: syntax error: missing ')' before identifier 'and' llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(85): error C2065: 'and': undeclared identifier llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(86): error C2143: syntax error: missing ';' before '<template-id>' llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(73): fatal error C1075: '{': no matching token found So, && must be used instead of `and`. Patch By Pavel Samolysov (@psamolysov) ! Reviewers: kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D69427
* [clangd] Store Index in Tweak::SelectionKadir Cetinkaya2019-10-255-10/+22
| | | | | | | | | | | | | | | | Summary: Incoming define out-of-line tweak requires access to index. This patch simply propogates the index in ClangdServer to Tweak::Selection while passing the AST. Also updates TweakTest to accommodate this change. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69165
* [clangd] Implement GetEligiblePointsKadir Cetinkaya2019-10-253-44/+195
| | | | | | | | | | | | | | Summary: This is an helper for incoming move definition out-of-line action to figure out possible insertion locations for definition of a qualified name. Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68024
* [clangd] DefineInline action apply logic with fully qualified namesKadir Cetinkaya2019-10-254-15/+727
| | | | | | | | | | | | Summary: Initial version of DefineInline action that will fully qualify every name inside function body. Reviewers: sammccall, ilya-biryukov, hokein Tags: #clang Differential Revision: https://reviews.llvm.org/D66647
* [clangd] DefineInline action availability checksKadir Cetinkaya2019-10-255-3/+392
| | | | | | | | | | | | Summary: Introduces DefineInline action and initial version of availability checks. Reviewers: sammccall, ilya-biryukov, hokein Tags: #clang Differential Revision: https://reviews.llvm.org/D65433
* [clangd] Fix case of variables and functions in code complete tests. NFCIlya Biryukov2019-10-241-16/+16
|
* [clangd] Handle the missing constructor initializers in findExplicitReferences.Haojian Wu2019-10-242-7/+52
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69241
* [clangd] Collect name references in the index.Haojian Wu2019-10-242-4/+17
| | | | | | | | | | | | | | Summary: This is used for cross-file rename. When renaming a class, we expect to rename all related constructors/destructors. Reviewers: kadircet, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69338
* [clangd] abort if shutdown takes more than a minute.Sam McCall2019-10-233-8/+29
| | | | | | | | | | | | | | | | | | | | Summary: A certain class of bug (e.g. infloop on an AST worker thread) currently means clangd never terminates, even if the editor shuts down the protocol and closes our stdin, and the main thread recognizes that. Instead, let's wait 60 seconds for threads to finish cleanly, and then crash if they haven't. (Obviously, we should still fix these bugs). Reviewers: kadircet Subscribers: MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D69329
* [clangd] Propogate context in TUScheduler::runKadir Cetinkaya2019-10-232-1/+15
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69328
* Move endian constant from Host.h to SwapByteOrder.h, prune includeReid Kleckner2019-10-191-0/+1
| | | | | | | | | | | | | | Works on this dependency chain: ArrayRef.h -> Hashing.h -> --CUT-- Host.h -> StringMap.h / StringRef.h ArrayRef is very popular, but Host.h is rarely needed. Move the IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are more likely to need it. llvm-svn: 375316
* [clangd] Report declaration references in findExplicitReferences.Haojian Wu2019-10-187-97/+172
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68977 llvm-svn: 375226
* [clangd] Use our own relation kind.Haojian Wu2019-10-1719-117/+58
| | | | | | | | | | | | | | | | Summary: Move the RelationKind from Serialization.h to Relation.h. This patch doesn't introduce any breaking changes. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68981 llvm-svn: 375117
* clang-tidy - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-172-5/+5
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 375102
* [lit] Fix another test case that r374652 missedJoel E. Denny2019-10-161-1/+1
| | | | llvm-svn: 375058
OpenPOWER on IntegriCloud