summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Support offsets for parameters in signatureHelpIlya Biryukov2019-06-047-123/+213
| | | | | | | | | | | | | | | | Summary: Added to LSP in version 3.14 Reviewers: hokein Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62476 llvm-svn: 362481
* [clangd] Fix a crash when clang-tidy is disabledIlya Biryukov2019-06-042-7/+46
| | | | llvm-svn: 362469
* [clangd] SymbolCollector support for relationsNathan Ridge2019-06-043-12/+75
| | | | | | | | | | | | | | | | | | | Summary: The only relation currently collected is RelationBaseOf, because this is all we need for type hierarchy subtypes. Additional relations can be collected in the future as the need arises. This patch builds on D59407 and D62459. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62471 llvm-svn: 362467
* [CodeComplete] Add a bit more whitespace to completed patternsIlya Biryukov2019-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: E.g. we now turn `while(<#cond#>){` into `while (<#cond#>) {` This slightly improves the final output. Should not affect clients that format the result on their own. Reviewers: gribozavr Reviewed By: gribozavr Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62616 llvm-svn: 362363
* [clang-tidy] Fix make-unique check to work in C++17 mode.Haojian Wu2019-06-032-9/+18
| | | | | | | | | | | | | | | | | | | | Summary: Previously, we intended to omit the check fix to the case when constructor has any braced-init-list argument. But the HasListInitializedArgument was not correct to handle all cases (Foo(Bar{1, 2}) will return false in C++14 mode). This patch fixes it, corrects the tests, and makes the check to run at C++17 mode. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62736 llvm-svn: 362361
* [clangd] Serialization support for RelationSlabNathan Ridge2019-06-034-6/+180
| | | | | | | | | | | | | | Summary: This builds on D59407 to provide YAML and RIFF serialization support. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62459 llvm-svn: 362353
* [clangd] Add RelationSlabNathan Ridge2019-06-035-0/+169
| | | | | | | | | | | | | | | | Summary: RelationSlab is a new index data structure that stores relations between symbols. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59407 llvm-svn: 362352
* Revise the google-objc-global-variable-declaration check to match the style ↵Stephane Moore2019-05-312-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | guide. Summary: Revise the google-objc-global-variable-declaration check to match the style guide. This commit updates the check as follows: (1) Do not emit fixes for extern global constants. (2) Allow the second character of prefixes for constants to be numeric (the new guideline is that global constants should generally be named with a prefix that begins with a capital letter followed by one or more capital letters or numbers). https://google.github.io/styleguide/objcguide.html#prefixes This is an amended re-submission of https://reviews.llvm.org/rG12e3726fadb0b2a4d8aeed0a2817b5159f9d029d. Contributed By: yaqiji Reviewers: Wizard, benhamilton, stephanemoore Reviewed By: benhamilton, stephanemoore Subscribers: mgorny, cfe-commits, yaqiji Tags: #clang Differential Revision: https://reviews.llvm.org/D62045 llvm-svn: 362279
* [clangd] Add missing license for rename.cpp, NFC.Haojian Wu2019-05-311-1/+9
| | | | llvm-svn: 362226
* [clangd] clang-format SymbolCollector.cppNathan Ridge2019-05-301-4/+3
| | | | llvm-svn: 362176
* Support codesigning bundles and forcingChris Bieneman2019-05-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Clangd's framework is assembled by copying binaries from the lib and bin directories into a bundle shape. This results in an invalid bundle code signature because the signature only applies to the binaries not the resources. This patch adds two new options to `llvm_codesign` to enable re-signing the library and XPC service as bundles. The `BUNDLE_PATH` option allow specifying an explicit path to codesign, which enables signing bundles which aren't generated using CMake's `FRAMEWORK` or `BUNDLE` target properties. The `FORCE` option allows re-signing binaries that have already been signed. This is required for how clangd exposes the clangd library and tools as both XPC and non-XPC services using the same binary. Reviewers: jkorous, bogner Reviewed By: bogner Subscribers: mgorny, ilya-biryukov, dexonsmith, arphaman, kadircet, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62693 llvm-svn: 362169
* [Index] Compute correct symbol kind for variable templatesIlya Biryukov2019-05-291-0/+25
| | | | | | | | | | | | | | | | | | Summary: The index library itself seems to never pass variable templates as input, however clangd does. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62579 llvm-svn: 361996
* [clangd] Map typedefs to the same LSP completion kind as VSCodeIlya Biryukov2019-05-291-2/+5
| | | | | | For consistency and, more importantly, to get a nicer icon for those in VSCode. llvm-svn: 361969
* [clangd] Fix buildbot error.Haojian Wu2019-05-291-0/+4
| | | | llvm-svn: 361960
* [clangd] Remove the whitelist std symbols in CanonicalIncludes.Haojian Wu2019-05-291-17/+0
| | | | | | | | | | | | | | Summary: These symbols have been included via StdSymbolMap.inc. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62527 llvm-svn: 361952
* [clangd] Another improvement for std include mapping.Haojian Wu2019-05-293-6/+64
| | | | | | | | | | | | | | | | Summary: Improve the way of checking a symbol name is in the first cell. The previous way is not very robost for cases where a cell lists multiple symbols (e.g. int8_t). Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62575 llvm-svn: 361951
* [Index] Correctly set symbol kind of IndirectFieldDeclIlya Biryukov2019-05-291-0/+14
| | | | | | | | | | | | | | | | Summary: The kind has been 'unknown' before, now it is 'field'. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62573 llvm-svn: 361941
* [clangd] Represent Hover result using FormattedStringIlya Biryukov2019-05-2911-95/+319
| | | | | | | | | | | | | | Reviewers: sammccall, kadircet Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61601 llvm-svn: 361940
* Rollback "Revise the google-objc-global-variable-declaration check to match ↵Stephane Moore2019-05-292-31/+11
| | | | | | | | | | the style guide." 💥 The change introduced new test failures. Phabricator URL of original commit: https://reviews.llvm.org/rG12e3726fadb0b2a4d8aeed0a2817b5159f9d029d llvm-svn: 361914
* Revise the google-objc-global-variable-declaration check to match the style ↵Stephane Moore2019-05-292-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | guide. Summary: Revise the google-objc-global-variable-declaration check to match the style guide. This commit updates the check as follows: (1) Do not emit fixes for extern global constants. (2) Allow the second character of prefixes for constants to be numeric (the new guideline is that global constants should generally be named with a prefix that begins with a capital letter followed by one or more capital letters or numbers). https://google.github.io/styleguide/objcguide.html#prefixes Contributed by yaqiji. Reviewers: Wizard, benhamilton, stephanemoore Reviewed By: benhamilton, stephanemoore Subscribers: mgorny, cfe-commits, yaqiji Tags: #clang Differential Revision: https://reviews.llvm.org/D62045 llvm-svn: 361907
* [clangd] Add SourceManager accessor to ParsedAST. NFCSam McCall2019-05-289-26/+27
| | | | llvm-svn: 361883
* [OpenMP] Set pragma start loc to `#pragma` locJoel E. Denny2019-05-281-10/+10
| | | | | | | | | | | | | | | This patch adjusts `PragmaOpenMPHandler` to set the location of `tok::annot_pragma_openmp` to the `#pragma` location instead of the `omp` location so that the former becomes the start location of the OpenMP AST node. This can be useful when, for example, rewriting a directive using Clang's Rewrite facility. Most of this patch updates tests for changes to locations in diagnostics and `-ast-dump` output. Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman Differential Revision: https://reviews.llvm.org/D61509 llvm-svn: 361867
* [clangd] Fix test output for r361841Ilya Biryukov2019-05-281-1/+1
| | | | llvm-svn: 361846
* [clangd] Place cursor better after completing patternsIlya Biryukov2019-05-285-9/+76
| | | | | | | | | | | | | | | | | | | | | | | | Summary: By producing the $0 marker in the snippets at the last placeholder. This produces nicer results in most cases, e.g. for namespace <#name#> { <#decls#> } we now produce ${0:decls} instead of ${2:decls} and the final cursor placement is more convenient. Reviewers: hokein Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62389 llvm-svn: 361841
* [clang-tidy] Fix description for misc-definitions-in-headers.Haojian Wu2019-05-282-3/+7
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62524 llvm-svn: 361834
* [clang-tidy] Verify fix description for misc-unused-using-decl.Haojian Wu2019-05-281-0/+1
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62522 llvm-svn: 361833
* [clangd] Compute expected type for templatesIlya Biryukov2019-05-282-6/+36
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62515 llvm-svn: 361823
* [clang-tidy] Fix null pointer dereference in readability-identifier-namingHaojian Wu2019-05-282-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: readability-identifier-naming causes a null pointer dereference when checking an identifier introduced by a structured binding whose right hand side is an undeclared identifier. Running the check on a file that is just the following results in a crash: ``` auto [left] = right; ``` Patch by Mark Stegeman! Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: hokein, aaron.ballman Subscribers: madsravn, xazax.hun, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D62404 llvm-svn: 361809
* [clangd] Introduce a structured hover responseKadir Cetinkaya2019-05-289-143/+769
| | | | | | | | | | | | | | | | Summary: Change ClangdServer layer to output a structured response for Hover, which can be rendered by client according to their needs. Reviewers: sammccall, ilya-biryukov Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61497 llvm-svn: 361803
* [clangd] Never end command-line flag description with a period. NFCIlya Biryukov2019-05-281-20/+20
| | | | | | | For consistency. Not having a period at the end is much more common and seems to be the preferred style for command-line options. llvm-svn: 361800
* [clangd] Rename -run-synchronously to -syncIlya Biryukov2019-05-286-23/+22
| | | | llvm-svn: 361798
* [clang-tidy] Fix unused-variable warning after r361647.Haojian Wu2019-05-271-6/+7
| | | | | | | | | | | | | | | | | | | | | Summary: A range-for was added in r361647 where the range variable was only used in an assertion. As a result, it warned for Release builds. This revision restructures the assertion to avoid the problem. Patch by Yitzhak Mandelbaum. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D62412 llvm-svn: 361749
* DeleteNullPointerCheck now deletes until the end brace of the condition.Mads Ravn2019-05-262-3/+15
| | | | | | | | Patch by Jonathan Camilleri Differential Revision https://reviews.llvm.org/D61861 llvm-svn: 361735
* [clangd] tweaks: Add clangBasic dependency to LINK_LIBSHeejin Ahn2019-05-251-0/+1
| | | | | | This is necessary to make builds with `-DBUILD_SHARED_LIBS=ON` work. llvm-svn: 361687
* Rename clangToolingRefactor to clangToolingRefactoring for consistency with ↵Nico Weber2019-05-257-7/+7
| | | | | | | | | | its directory See "[cfe-dev] The name of clang/lib/Tooling/Refactoring". Differential Revision: https://reviews.llvm.org/D62420 llvm-svn: 361684
* [clang-tidy] In TransformerClangTidyCheck, require Explanation field.Yitzhak Mandelbaum2019-05-243-17/+33
| | | | | | | | | | | | | | | | | | | Summary: In general, the `Explanation` field is optional in `RewriteRule` cases. But, because the primary purpose of clang-tidy checks is to provide users with diagnostics, we assume that a missing explanation is a bug. This change adds an assertion that checks all cases for an explanation, and updates the code to rely on that assertion correspondingly. Reviewers: ilya-biryukov Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62340 llvm-svn: 361647
* Make cppcoreguidelines-pro-type-member-init-use-assignment.cpp pass on ↵Dmitri Gribenko2019-05-241-1/+1
| | | | | | | | | | platforms where char is unsigned The other options are to completely specify the triple (reduces test coverage), or to specify a regex that allows either '0' or '0U' for char initializers, however, that relaxes the test. llvm-svn: 361629
* Made cppcoreguidelines-pro-type-member-init-use-assignment run in all ↵Dmitri Gribenko2019-05-241-1/+1
| | | | | | language modes llvm-svn: 361628
* [clangd] Limit the size of synthesized fix messageIlya Biryukov2019-05-242-7/+63
| | | | | | | | | | | | | | | | Summary: A temporary workaround until we figure out a better way to present fixes. Reviewers: kadircet Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62372 llvm-svn: 361625
* [CodeComplete] Filter override completions by function nameIlya Biryukov2019-05-241-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We put only part of the signature starting with a function name into "typed text" chunks now, previously the whole signature was "typed text". This leads to meaningful fuzzy match scores, giving better signals to compare with other completion items. Ideally, we would not display the result type to the user, but that requires adding a new kind of completion chunk. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62298 llvm-svn: 361623
* Fix sphinx "Malformed option description" warningSimon Pilgrim2019-05-241-1/+1
| | | | llvm-svn: 361616
* [clang-tidy] Add option "LiteralInitializers" to ↵Matthias Gehre2019-05-245-2/+108
| | | | | | | | cppcoreguidelines-pro-type-member-init Differential Revision: D24892 llvm-svn: 361601
* [clang-tidy]: Add cert-oop54-cpp alias for bugprone-unhandled-self-assignmentTamas Zolnai2019-05-2310-26/+131
| | | | | | | | | | | | | | | | | | | | Summary: Added WarnOnlyIfThisHasSuspiciousField option to allow to catch any copy assignment operator independently from the container class's fields. Added the cert alias using this option. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: mgorny, Eugene.Zelenko, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62192 llvm-svn: 361550
* Fix sphinx unknown document errorSimon Pilgrim2019-05-231-1/+1
| | | | llvm-svn: 361545
* [Index] Fix reported references in presence of template type aliasesIlya Biryukov2019-05-231-0/+11
| | | | | | | | | | | | | | | | Summary: See the added test for an example. Reviewers: kadircet Reviewed By: kadircet Subscribers: jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62303 llvm-svn: 361511
* [clangd] Also update package-lock.jsonKadir Cetinkaya2019-05-231-1/+1
| | | | llvm-svn: 361488
* [clang-tidy] New check calling out uses of +new in Objective-C codeDmitri Gribenko2019-05-238-0/+288
| | | | | | | | | | | | | | | | | | | | | Summary: Google's Objective-C style guide forbids calling or overriding +new to instantiate objects. This check warns on violations. Style guide reference: https://google.github.io/styleguide/objcguide.html#do-not-use-new Patch by Michael Wyman. Reviewers: benhamilton, aaron.ballman, JonasToth, gribozavr, ilya-biryukov, stephanemoore, mwyman Reviewed By: aaron.ballman, gribozavr, stephanemoore, mwyman Subscribers: stephanemoore, xazax.hun, Eugene.Zelenko, mgorny, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D61350 llvm-svn: 361487
* [clangd] Bump vscode extension versionKadir Cetinkaya2019-05-231-1/+1
| | | | llvm-svn: 361486
* [clangd-vscode] Do not customize uri converters in vscodeKadir Cetinkaya2019-05-231-12/+0
| | | | | | | | | | | | | | | | | | | Summary: Clangd is already resolving symlinks on the server side, therefore there is no more need to handle it in client side. This was also resulting in breakages whenever index contained a symbol coming from a non-existent file(like a generated file), e.g. during workspace symbols whole response was dropped since stat had failed. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62288 llvm-svn: 361475
* [clangd-vscode] Bump versions dependencies. NFCIlya Biryukov2019-05-231-20/+11
| | | | | | Result of running 'npm audit fix', which tracks security vulnerabilities. llvm-svn: 361464
OpenPOWER on IntegriCloud