summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert rL356547 : [clang-tidy] Cosmetic fixSimon Pilgrim2019-03-201-146/+25
| | | | | | | | | | | | | | | | | Differential Revision: https://reviews.llvm.org/D57662 ........ [clang-tidy] Parallelize clang-tidy-diff.py This patch has 2 rationales: - large patches lead to long command lines and often cause max command line length restrictions imposed by OS; - clang-tidy runs on modified files are independent and can be done in parallel, the same as done for run-clang-tidy. Differential Revision: https://reviews.llvm.org/D57662 ........ Reverted to fix buildbot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/45547/steps/test/logs/stdio llvm-svn: 356553
* [clang-tidy] Cosmetic fixZinovy Nis2019-03-201-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D57662 llvm-svn: 356548
* [clang-tidy] Parallelize clang-tidy-diff.pyZinovy Nis2019-03-201-25/+146
| | | | | | | | | | | This patch has 2 rationales: - large patches lead to long command lines and often cause max command line length restrictions imposed by OS; - clang-tidy runs on modified files are independent and can be done in parallel, the same as done for run-clang-tidy. Differential Revision: https://reviews.llvm.org/D57662 llvm-svn: 356547
* [clangd] Print arguments in template specializationsKadir Cetinkaya2019-03-206-63/+124
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59354 llvm-svn: 356541
* [clangd] Add support for type hierarchy (super types only for now)Kadir Cetinkaya2019-03-1917-71/+991
| | | | | | | | | | | | | | | | | | | | | | | Summary: Patch by Nathan Ridge(@nridge)! This is an LSP extension proposed here: https://github.com/Microsoft/vscode-languageserver-node/pull/426 An example client implementation can be found here: https://github.com/theia-ide/theia/pull/3802 Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: jdoerfert, sammccall, cfe-commits, mgorny, dschaefer, simark, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet Tags: #clang Differential Revision: https://reviews.llvm.org/D56370 llvm-svn: 356445
* [pp-trace] Delete -ignore and add a new option -callbacksFangrui Song2019-03-1813-64/+91
| | | | | | | | | | | | | | | | | | | | | | | | Summary: -ignore specifies a list of PP callbacks to ignore. It cannot express a whitelist, which may be more useful than a blacklist. Add a new option -callbacks to replace it. -ignore= (default) => -callbacks='*' (default) -ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped' -callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,... Reviewers: juliehockett, aaron.ballman, alexfh, ioeric Reviewed By: aaron.ballman Subscribers: nemanjai, kbarton, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59296 llvm-svn: 356366
* [clangd] Remove includes of "gmock-matchers.h". NFCIlya Biryukov2019-03-152-2/+0
| | | | | | For consistency with most of the test code. llvm-svn: 356264
* [clangd] Tune the fuzzy-matching algorithmIlya Biryukov2019-03-152-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To reduce the gap between prefix and initialism matches. The motivation is producing better scoring in one particular example, but the change does not seem to cause large regressions in other cases. The examples is matching 'up' against 'unique_ptr' and 'upper_bound'. Before the change, we had: - "[u]nique_[p]tr" with a score of 0.3, - "[up]per_bound" with a score of 1.0. A 3x difference meant that symbol quality signals were almost always ignored and 'upper_bound' was always ranked higher. However, intuitively, the match scores should be very close for the two. After the change we have the following scores: - "[u]nique_[p]tr" with a score of 0.75, - "[up]per_bound" with a score of 1.0. Reviewers: ioeric Reviewed By: ioeric Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59300 llvm-svn: 356261
* Rename directory housing clang-change-namespace to be eponymousNico Weber2019-03-1514-3/+3
| | | | | | | | | Makes the name of this directory consistent with the names of the other directories in clang-tools-extra. Differential Revision: https://reviews.llvm.org/D59382 llvm-svn: 356254
* Fixed global constant/variable naming check on C++ class for ObjC++ files.Yan Zhang2019-03-152-0/+14
| | | | | | | | | | Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59283 llvm-svn: 356220
* Add PragmaHandler for MSVC pragma execution_character_setReid Kleckner2019-03-142-0/+19
| | | | | | | | | | | | __pragma(execution_character_set(push, "UTF-8")) is used in TraceLoggingProvider.h. This commit implements a no-op handler for compatability, similar to how the flag -fexec_charset is handled. Patch by Matt Gardner! Differential Revision: https://reviews.llvm.org/D58530 llvm-svn: 356185
* [clang-tidy] Add additional patterns to the ↵Hyrum Wright2019-03-144-19/+103
| | | | | | | | abseil-duration-unnecessary-conversion check. Differential Revision: https://reviews.llvm.org/D59183 llvm-svn: 356141
* [clangd] Using symbol name to map includes for STL symbols.Haojian Wu2019-03-144-35/+1484
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Using suffix path mapping relies on the STL implementations, and it is not portable. This patch is using symbol name mapping, which should work with different STL implementations, fix clangd/clangd#9. To generate the symbol mapping, we parse the cppreference symbol index page to build a lookup table. The mapping is not completed, a few TODOs: - support symbols from different headers (e.g. std::move) - support STL macros - support symbols from std's sub-namespaces (e.g. chrono) Reviewers: ioeric, jfb, serge-sans-paille Reviewed By: ioeric Subscribers: sammccall, klimek, ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, kadircet, jfb, jdoerfert, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D58345 llvm-svn: 356134
* [clangd] Fix an out-of-date FIXME, NFC.Haojian Wu2019-03-141-3/+0
| | | | llvm-svn: 356127
* [clangd] Build Dex index after loading all shards in BackgroundIndex.Haojian Wu2019-03-141-3/+7
| | | | | | | | | | | | | | | | Summary: Currently after loadding all shards, we use MemIndex which has poor query performance, we should use Dex. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59350 llvm-svn: 356126
* [clangd] Store explicit template specializations in index for code ↵Kadir Cetinkaya2019-03-147-19/+121
| | | | | | | | | | | | | | | | | | | | | | | | | navigation purposes Summary: This introduces ~4k new symbols, and ~10k refs for LLVM. We need that information for providing better code navigation support: - When references for a class template is requested, we should return these specializations as well. - When children of a specialization is requested, we should be able to query for those symbols(instead of just class template) Number of symbols: 378574 -> 382784 Number of refs: 5098857 -> 5110689 Reviewers: hokein, gribozavr Reviewed By: gribozavr Subscribers: nridge, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59083 llvm-svn: 356125
* [clangd] Fix a typo in doc.Haojian Wu2019-03-131-1/+1
| | | | llvm-svn: 356055
* [clangd] Default initialize SymInfoKadir Cetinkaya2019-03-131-1/+1
| | | | llvm-svn: 356032
* Revert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not ↵Paul Hoad2019-03-132-2/+2
| | | | | | | | working if an "else" statement is present" This reverts commit b358cbb9b78389e20f7be36e1a98e26515c3ecce. llvm-svn: 356030
* [clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if ↵Paul Hoad2019-03-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an "else" statement is present Summary: Addressing: PR25010 - https://bugs.llvm.org/show_bug.cgi?id=25010 Code like: ``` if(true) var++; else { var--; } ``` is reformatted to be ``` if (true) var++; else { var--; } ``` Even when `AllowShortIfStatementsOnASingleLine` is true The following revision comes from a +1'd suggestion in the PR to support AllowShortIfElseStatementsOnASingleLine This suppresses the clause prevents the merging of the if when there is a compound else Reviewers: klimek, djasper, JonasToth, alexfh, krasimir, reuk Reviewed By: reuk Subscribers: reuk, Higuoxing, jdoerfert, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D59087 llvm-svn: 356029
* [clang-tidy] NOLINT support for "clang-diagnostic-*".Haojian Wu2019-03-123-11/+10
| | | | | | | | | | | | | | Reviewers: alexfh, aaron.ballman Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59255 llvm-svn: 355934
* [clang-tidy] Add the abseil-time-compare checkHyrum Wright2019-03-1110-8/+273
| | | | | | | | | This is an analog of the abseil-duration-comparison check, but for the absl::Time domain. It has a similar implementation and tests. Differential Revision: https://reviews.llvm.org/D58977 llvm-svn: 355835
* [clangd] Respect Origin option in createStaticIndexingActionKadir Cetinkaya2019-03-112-2/+3
| | | | | | | | | | | | | | | | | | | Summary: Currently createStaticIndexingAction always set Origin to Static, which makes it hard to change it later on by different indexers(One needs to go over each symbol making a new copy). This patch changes that behavior to rather respect it if set by user. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59205 llvm-svn: 355820
* [clangd] Add TOC section to clangd doc.Haojian Wu2019-03-113-0/+6
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59132 llvm-svn: 355811
* [clang-tidy] NFC: Negate the name and semantics of the isNotInMacro function.Hyrum Wright2019-03-085-10/+9
| | | | | | | This function is always used in a context where its result was also negated, which made for confusing naming and code. llvm-svn: 355702
* [clangd] Remove ./ and ../ in the file pathsKadir Cetinkaya2019-03-082-0/+34
| | | | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59084 llvm-svn: 355681
* [clangd] Redirect clangd page.Haojian Wu2019-03-081-0/+3
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59128 llvm-svn: 355680
* [clangd] Make sure constructors do not reference classKadir Cetinkaya2019-03-083-1/+19
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58815 llvm-svn: 355679
* [clangd] Deduplicate Refs on the fly.Haojian Wu2019-03-083-10/+11
| | | | | | | | | | | | | | | | | | | | Summary: Currently, we only do deduplication when we flush final results. We may have huge duplications (refs from headers) during the indexing period (running clangd-indexer on Chromium). With this change, clangd-indexer can index the whole chromium projects (48 threads, 40 GB peak memory usage). Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59092 llvm-svn: 355676
* [clangd] Adjust compile commands to be applicable for toolingKadir Cetinkaya2019-03-082-12/+53
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: As can be seen in https://github.com/llvm-mirror/clang/blob/master/lib/Tooling/Tooling.cpp#L385 clang tool invocations adjust commands normally like this. In clangd we have different code paths for invoking a frontend action(preamble builds, ast builds, background index, clangd-indexer) they all work on the same GlobalCompilationDatabase abstraction, but later on are subject to different modifications. This patch makes sure all of the clangd actions make use of the same compile commands before invocation. Enables background-index to work on chromium codebase(since they had dependency file output in their compile commands). Reviewers: gribozavr, hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59086 llvm-svn: 355669
* [clangd] Strip plugin arguments in clangd-indexer.Haojian Wu2019-03-071-1/+3
| | | | | | | | | | | | | | | | Summary: This would allow clangd-indexer runs on chromium repo. Reviewers: kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59022 llvm-svn: 355599
* [clangd] Add Source to clangd::Diagnostic.Haojian Wu2019-03-064-1/+34
| | | | | | | | | | | | | | | Summary: clangd embedder can distinguish diagnostics from clang or clang-tidy. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58600 llvm-svn: 355493
* [clang-tidy] Fix bugprone-string-constructor crashAlexander Kornienko2019-03-052-1/+10
| | | | llvm-svn: 355401
* [build] Rename clang-headers to clang-resource-headersShoaib Meenai2019-03-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current install-clang-headers target installs clang's resource directory headers. This is different from the install-llvm-headers target, which installs LLVM's API headers. We want to introduce the corresponding target to clang, and the natural name for that new target would be install-clang-headers. Rename the existing target to install-clang-resource-headers to free up the install-clang-headers name for the new target, following the discussion on cfe-dev [1]. I didn't find any bots on zorg referencing install-clang-headers. I'll send out another PSA to cfe-dev to accompany this rename. [1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits Tags: #clang, #sanitizers, #lldb, #openmp, #llvm Differential Revision: https://reviews.llvm.org/D58791 llvm-svn: 355340
* [clangd] Enable SuggestMissingIncludes by default.Eric Liu2019-03-011-1/+1
| | | | | | | | | | | | | | Summary: This seems to work stably now. Turn on by default. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58772 llvm-svn: 355200
* Fix file headers. NFCFangrui Song2019-03-0122-22/+22
| | | | llvm-svn: 355188
* [clang-tidy] add OverrideMacro to modernize-use-override checkPaul Hoad2019-02-286-22/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The usefulness of **modernize-use-override** can be reduced if you have to live in an environment where you support multiple compilers, some of which sadly are not yet fully C++11 compliant some codebases have to use override as a macro OVERRIDE e.g. ``` // GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. ``` This allows code to be compiled with C++11 compliant compilers and get warnings and errors that clang, MSVC,gcc can give, while still allowing other legacy pre C++11 compilers to compile the code. This can be an important step towards modernizing C++ code whilst living in a legacy codebase. When it comes to clang tidy, the use of the **modernize-use-override** is one of the most useful checks, but the messages reported are inaccurate for that codebase if the standard approach is to use the macros OVERRIDE and/or FINAL. When combined with fix-its that introduce the C++11 override keyword, they become fatal, resulting in the modernize-use-override check being turned off to prevent the introduction of such errors. This revision, allows the possibility for the replacement **override **to be a macro instead, Allowing the clang-tidy check to be run on both pre and post C++11 code, and allowing fix-its to be applied. Reviewers: alexfh, JonasToth, hokein, Eugene.Zelenko, aaron.ballman Reviewed By: alexfh, JonasToth Subscribers: lewmpk, malcolm.parsons, jdoerfert, xazax.hun, cfe-commits, llvm-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D57087 llvm-svn: 355132
* [clang-tidy] fix documentation link in list of clang-tidy checksJonas Toth2019-02-281-1/+1
| | | | llvm-svn: 355108
* [clang-tidy] redirection in list of checks adjustedJonas Toth2019-02-281-1/+1
| | | | llvm-svn: 355102
* [clang-tidy] include cppcoreguidelines-explicit-virtual-functions in list of ↵Jonas Toth2019-02-282-1/+2
| | | | | | checks and fix redirection llvm-svn: 355100
* [clang-tidy] documentation fixing the actual correct fileJonas Toth2019-02-281-0/+1
| | | | llvm-svn: 355098
* [clang-tidy] tryfix documenation continuedJonas Toth2019-02-281-0/+1
| | | | llvm-svn: 355097
* [clang-tidy] another issue in documentation, double empty line seemed to ↵Jonas Toth2019-02-281-1/+0
| | | | | | confuse code-block llvm-svn: 355095
* [clang-tidy] attempt to fix documentation build-errorJonas Toth2019-02-281-3/+4
| | | | llvm-svn: 355094
* [clang-tidy] added cppcoreguidelines-explicit-virtual-functionsJonas Toth2019-02-287-3/+62
| | | | | | | | | | | | Addresses the bugzilla bug #30397. (https://bugs.llvm.org/show_bug.cgi?id=30397) modernize-use-override suggests that destructors require the override specifier and the CPP core guidelines do not recommend this. Patch by lewmpk. Differential Revision: https://reviews.llvm.org/D58731 llvm-svn: 355093
* Added missing license headersDmitri Gribenko2019-02-284-1/+31
| | | | | | | | | | | | Reviewers: ioeric Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58781 llvm-svn: 355092
* Use ArrayRef::copy, instead of copying data manuallyDmitri Gribenko2019-02-281-3/+1
| | | | | | | | | | | | Reviewers: ioeric Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58782 llvm-svn: 355091
* Moved Ref into its own header and implementation fileDmitri Gribenko2019-02-2811-149/+192
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58778 llvm-svn: 355090
* [clang-tidy] bugprone-string-integer-assignment: Reduce false positives.Clement Courbet2019-02-282-0/+36
| | | | | | | | | | | | | | Summary: Detect a few expressions as likely character expressions, see PR27723. Reviewers: xazax.hun, alexfh Subscribers: rnkovacs, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58609 llvm-svn: 355089
* Moved Symbol into its own header and implementation fileDmitri Gribenko2019-02-2814-265/+318
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58774 llvm-svn: 355088
OpenPOWER on IntegriCloud