summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Always try to build absolute pathKadir Cetinkaya2019-01-031-8/+1
| | | | | | | | | | | | | | | | | | | | Summary: This only changes behavior in cases when the file itself is a symlink. When canonicalizing paths do not look at tryGetRealPathName, which contains the resolved path for files that are symlinks. Instead first build the absolute path even if it contains some symlinks on the path. Then resolve only the symlinks on the path and leave it as it is if the file itself is a symlink. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56263 llvm-svn: 350306
* [clangd] Check preceding char when completion triggers on ':' or '>'Ilya Biryukov2019-01-035-3/+210
| | | | | | | | | | | | | | | | | | Summary: Only run completion when we were trigerred on '->' and '::', otherwise send an error code in return. To avoid automatically invoking completions in cases like 'a >^' or 'a ? b :^'. Reviewers: hokein Reviewed By: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55994 llvm-svn: 350304
* [clangd] clang-format everything. NFCIlya Biryukov2019-01-0330-359/+311
| | | | llvm-svn: 350303
* [Documentation] Alphabetical order in Clang-tidy checks changes list.Eugene Zelenko2019-01-021-8/+8
| | | | llvm-svn: 350273
* [clangd] Show FileStatus in vscode-clangd.Haojian Wu2019-01-021-0/+37
| | | | | | | | | | | | | | Summary: The file status will be shown in the status bar. Depends on D55363. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55374 llvm-svn: 350210
* [clang-tidy] Export the abseil duration inverse lookup function, NFCHyrum Wright2018-12-282-2/+7
| | | | | | This allows other tools to use this function. llvm-svn: 350133
* [clang-tidy] add IgnoreMacros option to readability-uppercase-literal-suffixMiklos Vajna2018-12-246-2/+22
| | | | | | | | | | | | | | And also enable it by default to be consistent with e.g. modernize-use-using. This helps e.g. when running this check on client code where the macro is provided by the system, so there is no easy way to modify it. Reviewed By: JonasToth, lebedev.ri Differential Revision: https://reviews.llvm.org/D56025 llvm-svn: 350056
* [clangd] Delete stray semicolon. NFCFangrui Song2018-12-241-1/+0
| | | | llvm-svn: 350040
* [clangd] Delete trailing ; NFCFangrui Song2018-12-231-1/+1
| | | | llvm-svn: 350037
* [clang-tidy] Be more liberal about literal zeroes in abseil checksHyrum Wright2018-12-213-6/+54
| | | | | | | | | Summary: Previously, we'd only match on literal floating or integral zeroes, but I've now also learned that some users spell that value as int{0} or float{0}, which also need to be matched. Differential Revision: https://reviews.llvm.org/D56012 llvm-svn: 349953
* [clang-tidy] Add export-fixes flag to clang-tidy-diffJulie Hockett2018-12-211-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D55848 llvm-svn: 349930
* [clangd] Cleanup syntax errors in the test, NFC.Haojian Wu2018-12-214-7/+7
| | | | llvm-svn: 349893
* Fix warning about unused variable [NFC]Bjorn Pettersson2018-12-211-1/+1
| | | | llvm-svn: 349891
* [clangd] Try to workaround test failure by increasing the timeoutsIlya Biryukov2018-12-201-3/+3
| | | | | | | | Ideally we'd figure out a way to run this test without any sleeps, this workaround is only there to avoid annoying people with test failures around the holiday period when everyone is on vacation. llvm-svn: 349769
* [clangd] Expose FileStatus to LSP.Haojian Wu2018-12-207-3/+89
| | | | | | | | | | | | | Summary: Add an LSP extension "textDocument/clangd.fileStatus" to emit file-status information. Reviewers: ilya-biryukov Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55363 llvm-svn: 349768
* [clang-tidy] Use translationUnitDecl() instead of a custom matcher.Alexander Kornienko2018-12-202-18/+5
| | | | llvm-svn: 349758
* [clangd] Don't miss the expected type in merge.Haojian Wu2018-12-202-0/+4
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55918 llvm-svn: 349750
* [clang-tidy] Diagnose abseil-duration-comparison on macro argumentsHyrum Wright2018-12-195-20/+58
| | | | | | | | | | | | Summary: This change relaxes the requirements on the utility `rewriteExprFromNumberToDuration` function, and introduces new checking inside of the `abseil-duration-comparison` check to allow macro argument expression transformation. Differential Revision: https://reviews.llvm.org/D55784 llvm-svn: 349636
* [clangd] Fix a syntax error on the test.Haojian Wu2018-12-191-1/+1
| | | | llvm-svn: 349632
* [clang-tidy] use "const SourceManager&" parameter, NFC.Haojian Wu2018-12-191-3/+3
| | | | llvm-svn: 349623
* [clangd] Unify path canonicalizations in the codebaseKadir Cetinkaya2018-12-195-76/+64
| | | | | | | | | | | | | | Summary: There were a few different places where we canonicalized paths, each one had its own flavor. This patch tries to unify them all under one place. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55818 llvm-svn: 349618
* [clangd] Try to fix buildbot failure after r349496Eric Liu2018-12-181-3/+3
| | | | | | | Increase timeout from 10ms to 100ms. See http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/27959 llvm-svn: 349502
* [clangd] BackgroundIndex rebuilds symbol index periodically.Eric Liu2018-12-187-9/+108
| | | | | | | | | | | | | | | | | | Summary: Currently, background index rebuilds symbol index on every indexed file, which can be inefficient. This patch makes it only rebuild symbol index periodically. As the rebuild no longer happens too often, we could also build more efficient dex index. Reviewers: ilya-biryukov, kadircet Reviewed By: kadircet Subscribers: dblaikie, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55770 llvm-svn: 349496
* [clangd] Change diskbackedstorage to be atomicKadir Cetinkaya2018-12-171-8/+33
| | | | | | | | | | | | | | | | Summary: There was a chance that multiple clangd instances could try to write same shard, in which case we would get a malformed file most likely. This patch changes the writing mechanism to first write to a temporary file and then rename it to fit real destination. Which is guaranteed to be atomic by POSIX. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55417 llvm-svn: 349348
* [clangd] Only reduce priority of a thread for indexing.Kadir Cetinkaya2018-12-174-39/+58
| | | | | | | | | | | | | | | | | | Summary: We'll soon have tasks pending for reading shards from disk, we want them to have normal priority. Because: - They are not CPU intensive, mostly IO bound. - Give a good coverage for the project at startup, therefore it is worth spending some cycles. - We have only one task per whole CDB rather than one task per file. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55315 llvm-svn: 349345
* Revert rCTE349288 'Fix a lit test failure after MallocChecker changes'Kristof Umann2018-12-171-1/+1
| | | | llvm-svn: 349341
* Fix a lit test failure after MallocChecker changesKristof Umann2018-12-161-1/+1
| | | | llvm-svn: 349288
* [dexp] Change FuzzyFind to also print scope of symbolsKadir Cetinkaya2018-12-141-1/+2
| | | | | | | | | | | | | | | | Summary: When there are multiple symbols in the result of a fuzzy find with the same name, one has to perform an additional query to figure out which of those symbols are coming from the "interesting" scope. This patch prints the scope in fuzzy find results to get rid of the second symbol. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55705 llvm-svn: 349152
* clang-include-fixer.el: support remote filesPhilipp Stephani2018-12-141-5/+15
| | | | | | | | | | | | | | Summary: Support remote files (e.g., Tramp) in the Emacs integration for clang-include-fixer Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54672 llvm-svn: 349150
* [clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.Haojian Wu2018-12-141-10/+4
| | | | llvm-svn: 349148
* [clangd] Fix memory leak in ClangdTests.Haojian Wu2018-12-141-1/+3
| | | | | | | | | | | | | | | | | Summary: createInvocationFromCommandLine sets DisableFree to true by default, which leads memory leak in clangd. The fix is to use the `BuildCompilationInvocation` to create CI with the correct options (DisableFree is false). Fix https://bugs.llvm.org/show_bug.cgi?id=39991. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55702 llvm-svn: 349145
* [clangd] Fix an assertion failure in background index.Haojian Wu2018-12-142-0/+27
| | | | | | | | | | | | | | | Summary: When indexing a file which contains an uncompilable error, we will trigger an assertion failure -- the IndexFileIn data is not set, but we access them in the backgound index. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55650 llvm-svn: 349144
* [clang-tidy] Remove extra config.h includesIvan Donchevskii2018-12-142-2/+0
| | | | | | | | | It's included in a new header ClangTidyForceLinker.h and should not be included the second time. Follow up for the https://reviews.llvm.org/D55595 llvm-svn: 349132
* [clang-tidy] Share the forced linking code between clang-tidy tool and pluginIvan Donchevskii2018-12-143-185/+116
| | | | | | | | | Extract code that forces linking to the separate header and include it in both plugin and standalone tool. Try 2: missing header guard and "clang/Config/config.h" are added to the new header. Differential Revision: https://reviews.llvm.org/D55595 llvm-svn: 349131
* [clang-tidy] Improve google-objc-function-naming diagnostics 📙Stephane Moore2018-12-143-17/+33
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The diagnostics from google-objc-function-naming check will be more actionable if they provide a brief description of the requirements from the Google Objective-C style guide. The more descriptive diagnostics may help clarify that functions in the global namespace must have an appropriate prefix followed by Pascal case (engineers working previously with static functions might not immediately understand the different requirements of static and non-static functions). Test Notes: Verified against the clang-tidy tests. Reviewers: benhamilton, aaron.ballman Reviewed By: benhamilton Subscribers: MyDeveloperDay, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D55482 llvm-svn: 349123
* Revert "[clang-tidy] Share the forced linking code between clang-tidy tool ↵Douglas Yung2018-12-143-110/+185
| | | | | | | | | | | and plugin" This reverts commit r349038 as it was causing test failures: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/22185 http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/40886 llvm-svn: 349121
* [clang-tidy] Add the abseil-duration-subtraction checkHyrum Wright2018-12-1311-116/+322
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This check uses the context of a subtraction expression as well as knowledge about the Abseil Time types, to infer the type of the second operand of some subtraction expressions in Duration conversions. For example: absl::ToDoubleSeconds(duration) - foo can become absl::ToDoubleSeconds(duration - absl::Seconds(foo)) This ensures that time calculations are done in the proper domain, and also makes it easier to further deduce the types of the second operands to these expressions. Reviewed By: JonasToth Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55245 llvm-svn: 349073
* [clangd] Enable cross-namespace completions by default in clangdEric Liu2018-12-131-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Code completion will suggest symbols from any scope (incl. inaccessible scopes) when there's no qualifier explicitly specified. E.g. {F7689815} As we are assigning relatively low scores for cross-namespace completion items, the overall code completion quality doesn't regress. The feature has been tried out by a few folks, and the feedback is generally positive, so I think it should be ready to be enabled by default. Reviewers: hokein, ilya-biryukov, kadircet Reviewed By: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55649 llvm-svn: 349049
* [clang-tidy] Share the forced linking code between clang-tidy tool and pluginIvan Donchevskii2018-12-133-185/+110
| | | | | | | | Extract code that forces linking to the separate header and include it in both plugin and standalone tool Differential Revision: https://reviews.llvm.org/D55595 llvm-svn: 349038
* [clangd] Refine the way of checking a declaration is referenced by the ↵Haojian Wu2018-12-132-12/+57
| | | | | | | | | | | | | | | | | written code. Summary: The previous solution (checking the AST) is not a reliable way to determine whether a declaration is explicitly referenced by the source code, we are still missing a few cases. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55191 llvm-svn: 349033
* [clangd] Avoid emitting Queued status when we are able to acquire the Barrier.Haojian Wu2018-12-134-5/+15
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55359 llvm-svn: 349032
* [clangd] Move the utility function to anonymous namespace, NFC.Haojian Wu2018-12-131-32/+33
| | | | llvm-svn: 349031
* Add explicit dependency on clangSerialization after rC348911Fangrui Song2018-12-1225-0/+25
| | | | llvm-svn: 348916
* Use the standard Duration factory matcherJonas Toth2018-12-111-4/+2
| | | | | | | | | | | | | | | | | | Summary: A new check came in over the weekend; it should use our existing infrastructure for matching `absl::Duration` factories. Patch by hwright. Reviewers: JonasToth Reviewed By: JonasToth Subscribers: astrelni Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55541 llvm-svn: 348842
* [clang-tidy] NFC Consolidate test absl::Time implementationJonas Toth2018-12-115-158/+81
| | | | | | | | | | | | | | | | Summary: Several tests re-implement these same prototypes (differently), so we can put them in a common location. Patch by hwright. Reviewers: JonasToth Reviewed By: JonasToth Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55540 llvm-svn: 348840
* [clang-tidy] insert release notes for new checkers alphabeticallyJonas Toth2018-12-101-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Almost all code review comments on new checkers {D55433} {D48866} {D54349} seem to ask for the release notes to be added alphabetically, plus I've seen commits by @Eugene.Zelenko reordering the lists Make add_new_check.py add those release notes alphabetically based on checker name If include-fixer section is seen add it at the end Minor change in the message format to prevent double newlines added before the checker. Do the tools themselves have unit tests? (sorry new to this game) - Tested adding new checker at the beginning - Tested on adding new checker in the middle - Tested on empty ReleasesNotes.rst (as we would see after RC) Patch by MyDeveloperDay. Reviewers: alexfh, JonasToth, curdeius, aaron.ballman, benhamilton, hokein Reviewed By: JonasToth Subscribers: cfe-commits, xazax.hun, Eugene.Zelenko Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55508 llvm-svn: 348793
* [Documentation] Alphabetical order in new checks list.Eugene Zelenko2018-12-081-7/+7
| | | | llvm-svn: 348666
* [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'Eric Fiselier2018-12-078-0/+726
| | | | | | | | | | | | | Patch by Alex Strelnikov. Reviewed as D53830 Introduce a new check to upgrade user code based on upcoming API breaking changes to absl::Duration. The check finds calls to arithmetic operators and factory functions for absl::Duration that rely on an implicit user defined conversion to int64_t. These cases will no longer compile after proposed changes are released. Suggested fixes explicitly cast the argument int64_t. llvm-svn: 348633
* [clang-tidy] Remove duplicated getText implementation, NFCHaojian Wu2018-12-071-11/+7
| | | | llvm-svn: 348583
* [clangd] Remove the test that sometimes deadlocksIlya Biryukov2018-12-061-23/+0
| | | | | | Will figure out how to properly rewrite it and recommit. llvm-svn: 348490
OpenPOWER on IntegriCloud