summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] BackgroundIndex stores shards to the closest projectKadir Cetinkaya2019-07-1810-69/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Changes persistance logic to store shards at the directory of closest CDB. Previously we were storing all shards to directory of the CDB that triggered indexing, it had its downsides. For example, if you had two TUs coming from a different CDB but depending on the same header foo.h, we will store the foo.h only for the first CDB, and it would be missing for the second and we would never persist it since it was actually present in the memory and persisted before. This patch still stores only a single copy of a shard, but makes the directory a function of the file name. So that the shard place will be unique even with multiple CDBs accessing the file. This directory is determined as the first directory containing a CDB in the file's parent directories, if no such directory exists we make use of the home directory. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64745 llvm-svn: 366467
* [clangd] Refactor background-index shard loadingKadir Cetinkaya2019-07-188-173/+299
| | | | | | | | | | | | Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64712 llvm-svn: 366458
* [clangd] Get rid of dots and dotsdots within GlobalCompilationDatabaseKadir Cetinkaya2019-07-184-14/+62
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64860 llvm-svn: 366455
* [Clangd] NFC: Fixed tweaks CMakeLists order to alphabeticalShaurya Gupta2019-07-181-2/+2
| | | | llvm-svn: 366452
* [Clangd] Changed ExtractVariable to only work on non empty selectionsShaurya Gupta2019-07-184-35/+45
| | | | | | | | | | | | | | | | Summary: - For now, we don't trigger in any case if it's an empty selection - Fixed unittests Reviewers: kadircet, sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64912 llvm-svn: 366451
* [clangd] Suppress unwritten scopes when expanding auto.Haojian Wu2019-07-183-1/+17
| | | | | | | | | | | | | | Summary: otherwise the replacement will break the code. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64627 llvm-svn: 366446
* [clangd] Disable DumpRecordLayout by default per ↵Sam McCall2019-07-181-0/+5
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=42670 llvm-svn: 366443
* Bump the trunk version to 10.0.0svnHans Wennborg2019-07-182-192/+11
| | | | | | and clear the release notes. llvm-svn: 366427
* [clangd] Added highlightings for template parameters and specializations.Johan Vikstrom2019-07-184-6/+64
| | | | | | | | | | | | | | Summary: Template parameters and specializations were not being highlighted before. This adds highlightings to those types of tokens by adding two Visit* methods. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64855 llvm-svn: 366420
* clang-tidy release notes: Split and order changes by typeHans Wennborg2019-07-181-58/+61
| | | | | | Patch by Eugene Zelenko! llvm-svn: 366408
* [clangd] Fix Fix -Wunused-lambda-capture after r366339Fangrui Song2019-07-181-4/+3
| | | | llvm-svn: 366400
* [clang-tidy] Exclude forward decls from fuchsia-multiple-inheritanceJulie Hockett2019-07-172-1/+5
| | | | | | | | Addresses b39770. Differential Revision: https://reviews.llvm.org/D64813 llvm-svn: 366354
* [clang-tidy] Fix crash on end location inside macroNathan Huckleberry2019-07-172-6/+25
| | | | | | | | | | | | | | | | | | | | Summary: Lexer::getLocForEndOfToken is defined to return an invalid location if the given location is inside a macro. Other checks conditionally warn based off location validity. Updating this check to do the same. Reviewers: JonasToth, aaron.ballman, nickdesaulniers Reviewed By: nickdesaulniers Subscribers: lebedev.ri, nickdesaulniers, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64607 llvm-svn: 366353
* Fix MSVC 'implicitly capture' compile error. NFCI.Simon Pilgrim2019-07-171-1/+1
| | | | llvm-svn: 366339
* [clangd] Type hierarchy: don't resolve parents if the client only asked for ↵Nathan Ridge2019-07-172-17/+19
| | | | | | | | | | | | | | | | | | children Summary: Also reorganize the code for computing supertypes to make it more symmetric to subtypes. Reviewers: kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64613 llvm-svn: 366338
* [clang-tidy] Adjust location of namespace comment diagnosticIlya Biryukov2019-07-174-7/+14
| | | | | | | | | | | | | | | | | | | | | | Summary: If there is no comment, place it at the closing brace of a namespace definition. Previously it was placed at the next character after the closing brace. The new position produces a better location for highlighting in clangd and does not seem to make matters worse for clang-tidy. Reviewers: alexfh, hokein Reviewed By: alexfh, hokein Subscribers: xazax.hun, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64861 llvm-svn: 366337
* [clangd] Force the required interpretation of #import on windows tests.Sam McCall2019-07-171-0/+4
| | | | | | | | | | | | | | Summary: NFC but should fix a bunch of tests. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64857 llvm-svn: 366321
* [clangd] Handle windows line endings in QueryDriverKadir Cetinkaya2019-07-172-2/+4
| | | | | | | | | | | | | | Summary: fixes second case of https://github.com/clangd/clangd/issues/93 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64789 llvm-svn: 366320
* [clangd] Fix error message in tweaktests to be useful. NFCSam McCall2019-07-171-4/+4
| | | | llvm-svn: 366311
* Replace CRLF with LF.Rui Ueyama2019-07-171-94/+94
| | | | llvm-svn: 366304
* [clang-tidy] initial version of readability-convert-member-functions-to-staticMatthias Gehre2019-07-168-0/+451
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Finds non-static member functions that can be made ``static``. I have run this check (repeatedly) over llvm-project. It made 1708 member functions ``static``. Out of those, I had to exclude 22 via ``NOLINT`` because their address was taken and stored in a variable of pointer-to-member type (e.g. passed to llvm::StringSwitch). It also made 243 member functions ``const``. (This is currently very conservative to have no false-positives and can hopefully be extended in the future.) You can find the results here: https://github.com/mgehre/llvm-project/commits/static_const_eval Reviewers: alexfh, aaron.ballman Subscribers: mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61749 llvm-svn: 366265
* [clangd] Added highlighting for the targets in typedefs and using.Johan Vikstrom2019-07-162-4/+27
| | | | | | | | | | | | | | | | | | Summary: In `typedef int A` the `A` was not highlighted previously. This patch gives `A` the same kind of highlighting that the underlying type has (class/enum) (which in this example is no special highlighting because builtins are not handled yet) Will add highlightings for built ins in another patch. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64754 llvm-svn: 366207
* [clangd] Don't rebuild background index until we indexed one TU per thread.Sam McCall2019-07-163-12/+14
| | | | | | | | | | | | | | | | | Summary: This increases the odds that the boosted file (cpp file matching header) will be ready. (It always enqueues first, so it'll be present unless another thread indexes *two* files before the first thread indexes one.) Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64682 llvm-svn: 366199
* [clangd] Fix docKadir Cetinkaya2019-07-151-1/+1
| | | | llvm-svn: 366073
* [clangd] Fix duplicate highlighting tokens appearing in initializer lists.Johan Vikstrom2019-07-152-0/+15
| | | | | | | | | | | | | | Summary: The RecursiveASTVisitor sometimes visits exprs in initializer lists twice. Added deduplication to prevent duplicate highlighting tokens from appearing. Done by sorting and a linear search. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64634 llvm-svn: 366070
* [clangd] Added highlighting for members and methods.Johan Vikstrom2019-07-154-11/+67
| | | | | | | | | | | | | | Summary: Added highlighting for members and methods. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64617 llvm-svn: 366047
* [clangd] Added highlighting to enum constants.Johan Vikstrom2019-07-154-5/+23
| | | | | | | | | | | | | | Summary: VSCode does not have a scope for enum constants. So they were placed under "constant.other.enum" as that seems to be the most correct scope for enum constants. However, this makes theia color them blue (the same color it uses for keywords). Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64624 llvm-svn: 366045
* Simplify with llvm::is_contained. NFCFangrui Song2019-07-134-9/+5
| | | | llvm-svn: 365993
* [clangd] Mark type hierarchy as a supported feature in the docsNathan Ridge2019-07-131-1/+1
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64614 llvm-svn: 365987
* [clangd] Implement typeHierarchy/resolve for subtypesNathan Ridge2019-07-1310-13/+187
| | | | | | | | | | | | | | | | | | Summary: This allows the client to resolve subtypes one level at a time. For supertypes, this is not necessary, because we eagerly compute supertypes and return all levels. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64308 llvm-svn: 365986
* [clang-doc] Fix failing tests on WindowsJulie Hockett2019-07-121-8/+23
| | | | | | | | | | | | | Tests on Windows were failing due to path separator differences. '/' was being used as separator in the expected output, paths in expected output are now changed to their native form before comparing them to the actual output. Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com). Differential Revision: https://reviews.llvm.org/D64669 llvm-svn: 365967
* [clangd] Fix off-by-one in CodeComplete and assertion in DexSam McCall2019-07-122-4/+4
| | | | llvm-svn: 365955
* [clang-doc] Add html links to referencesJulie Hockett2019-07-1214-170/+361
| | | | | | | | | | | | | | | | <a> tags are added for the parents and members of records and return type and params of functions. The link redirects to the reference's info file. The directory path where each info file will be saved is now generated in the serialization phase and stored as an attribute in each Info. Bitcode writer and reader were modified to handle the new attributes. Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com). Differential Revision: https://reviews.llvm.org/D63663 llvm-svn: 365937
* Revert "[clangd] Implement typeHierarchy/resolve for subtypes"Russell Gallop2019-07-1210-187/+13
| | | | | | | | Causing test failure on Windows bot This reverts commit 5b9484e559d44bd923fc290e335891b1dd2e17c4. llvm-svn: 365899
* [clangd] Fixed toHalfOpenFileRangeShaurya Gupta2019-07-123-10/+144
| | | | | | | | | | | | | | | | | | | | | | | | Summary: - Fixed toHalfOpenFileRange to work for macros as well as template instantiations - Added unit tests Breaking test case for older version of toHalfOpenFileRange: \# define FOO(X) X++ int a = 1; int b = FOO(a); toHalfOpenFileRange for the sourceRange of VarDecl for b returned the wrong Range. Reviewers: sammccall, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64562 llvm-svn: 365894
* [clangd] Prioritize indexing of files that share a basename with the open file.Sam McCall2019-07-127-8/+97
| | | | | | | | | | | | | | | | | Summary: In practice, opening Foo.h will still often result in Foo.cpp making the second index build instead of the first, as the rebuild policy doesn't know to wait. Reviewers: kadircet Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64575 llvm-svn: 365888
* [clangd] Move the expandAuto tweak from global namespace into annoymous ↵Haojian Wu2019-07-122-2/+4
| | | | | | namespace. llvm-svn: 365885
* [clangd] Don't run the prepare for tweaks that are disabled.Haojian Wu2019-07-125-24/+25
| | | | | | | | | | | | | | Summary: Previously, we ran the prepare, even for the tweaks that are disabled. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64565 llvm-svn: 365882
* [test] Delete trailing spaces from YAML tests after D65566/r365869Fangrui Song2019-07-122-51/+51
| | | | llvm-svn: 365874
* [clangd] Implement typeHierarchy/resolve for subtypesNathan Ridge2019-07-1210-17/+191
| | | | | | | | | | | | | | | | | | Summary: This allows the client to resolve subtypes one level at a time. For supertypes, this is not necessary, because we eagerly compute supertypes and return all levels. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64308 llvm-svn: 365867
* [clangd] Add a missing early return in getTypeHierarchy()Nathan Ridge2019-07-121-0/+2
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64307 llvm-svn: 365849
* [clangd] Fix MSVC build failure.Paul Robinson2019-07-111-1/+1
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/26898 llvm-svn: 365844
* [clangd][NFC] Decrease template depth limit in RecursiveHierarchyUnbounded testJan Korous2019-07-111-0/+1
| | | | | | ...to minimize the chance of stack overflow before reaching the limit. llvm-svn: 365804
* [clangd] Avoid template in Task constructor, hopefully fix MSVC buildSam McCall2019-07-111-2/+1
| | | | llvm-svn: 365794
* [clangd] Consume llvm::Error in test after r365792Sam McCall2019-07-111-1/+3
| | | | llvm-svn: 365793
* [clangd] Implementation of auto type expansion.Sam McCall2019-07-1113-4/+489
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a tweak for clangd to replace an auto keyword to the deduced type. This way a user can declare something with auto and then have the IDE/clangd replace auto with whatever type clangd thinks it is. In case of long/complext types this makes is reduces writing effort for the user. The functionality is similar to the hover over the auto keyword. Example (from the header): ``` /// Before: /// auto x = Something(); /// ^^^^ /// After: /// MyClass x = Something(); /// ^^^^^^^ ``` Patch by kuhnel! (Christian Kühnel) Differential Revision: https://reviews.llvm.org/D62855 llvm-svn: 365792
* [clangd] Remove an extra ";", NFCHaojian Wu2019-07-111-1/+1
| | | | llvm-svn: 365778
* [clangd][QueryDriver] Use language from underlying database if possibleKadir Cetinkaya2019-07-111-11/+22
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64489 llvm-svn: 365776
* [clangd] Add priorities to background index queue, extract to separate classSam McCall2019-07-116-139/+234
| | | | | | | | | | | | Reviewers: kadircet Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64560 llvm-svn: 365773
* [clangd] Remove the extra ";", NFCHaojian Wu2019-07-111-1/+1
| | | | llvm-svn: 365764
OpenPOWER on IntegriCloud