summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed global constant/variable naming check on C++ class for ObjC++ files.Yan Zhang2019-03-151-0/+10
| | | | | | | | | | Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59283 llvm-svn: 356220
* [clang-tidy] Add additional patterns to the ↵Hyrum Wright2019-03-142-12/+57
| | | | | | | | abseil-duration-unnecessary-conversion check. Differential Revision: https://reviews.llvm.org/D59183 llvm-svn: 356141
* [clang-tidy] NOLINT support for "clang-diagnostic-*".Haojian Wu2019-03-121-1/+2
| | | | | | | | | | | | | | 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-111-0/+129
| | | | | | | | | 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
* [clang-tidy] Fix bugprone-string-constructor crashAlexander Kornienko2019-03-051-0/+8
| | | | llvm-svn: 355401
* [build] Rename clang-headers to clang-resource-headersShoaib Meenai2019-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [clang-tidy] add OverrideMacro to modernize-use-override checkPaul Hoad2019-02-282-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] added cppcoreguidelines-explicit-virtual-functionsJonas Toth2019-02-281-0/+16
| | | | | | | | | | | | 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
* [clang-tidy] bugprone-string-integer-assignment: Reduce false positives.Clement Courbet2019-02-281-0/+7
| | | | | | | | | | | | | | 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
* [clang-tidy] misc-string-integer-assignment: fix false positiveClement Courbet2019-02-281-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: using CodePoint = uint32_t; CodePoint cp; basic_string<CodePoint> s; s += cp; See PR27723. Reviewers: xazax.hun, alexfh Subscribers: rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58606 llvm-svn: 355076
* [clang-tidy] Add the abseil-time-subtraction checkHyrum Wright2019-02-272-0/+119
| | | | | | Differential Revision: https://reviews.llvm.org/D58137 llvm-svn: 355024
* [clang-tidy] misc-string-integer-assignment: ignore toupper/tolowerClement Courbet2019-02-251-0/+9
| | | | | | | | | | | | | | Summary: Tis represents ~20% of false positives. See PR27723. Reviewers: xazax.hun, alexfh Subscribers: rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58604 llvm-svn: 354780
* [clang-tidy] Make google-objc-function-naming ignore implicit functions 🙈Stephane Moore2019-02-212-1/+27
| | | | | | | | | | | | | | | | | | | | | | Summary: Implicit functions are outside the control of source authors and should be exempt from style restrictions. Tested via running clang tools tests. This is an amended followup to https://reviews.llvm.org/D57207 Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: jdoerfert, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58095 llvm-svn: 354534
* [clangd] Store index in '.clangd/index' instead of '.clangd-index'Ilya Biryukov2019-02-201-1/+1
| | | | | | | | | | | | | | | | Summary: To take up the .clangd folder for other potential uses in the future. Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58440 llvm-svn: 354505
* Update property prefix regex to allow numbers.Yan Zhang2019-02-201-0/+1
| | | | | | | | Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D56896 llvm-svn: 354485
* [clang-tidy] Mention language version in test explicitly.Volodymyr Sapsai2019-02-141-1/+1
| | | | | | | | | "modernize-use-using" check is applicable only to C++11 and later. Spell it out to avoid relying on default language version. rdar://problem/47932196 llvm-svn: 354069
* [clangd] Fix a lit-test.Kadir Cetinkaya2019-02-121-1/+1
| | | | | | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=40593. Non-percent-encoded chars doesn't cause any problems on the input-side since we assume everything after authority section is data and don't interpret them as delimeters. Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58126 llvm-svn: 353857
* Revamp the "[clangd] Format tweak's replacements"Haojian Wu2019-02-111-0/+50
| | | | | | | | | | | | | | | | | | | | Summary: This patch contains two parts: 1) reverts commit r353306. 2) move the format logic out from tweaks, keep tweaks API unchanged. Reviewers: sammccall, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58051 llvm-svn: 353712
* [clang-tidy] Don't use assignment for value-initialized enumsMalcolm Parsons2019-02-082-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The modernize-use-default-member-init check crashes when trying to create an assignment value for a value-initialized enum because it isn't a BuiltinType. An enum cannot be initialized by assigning 0 to it unless a cast is added. It could be initialized with an enumerator with the value 0, but there might not be one. Avoid these issues by ignoring the UseAssignment setting for value-initialized enums. Fixes PR35050. Reviewers: aaron.ballman, alexfh, JonasToth Reviewed By: JonasToth Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57852 llvm-svn: 353554
* [clang-tidy] Add options to bugprone-argument-comment to add missing ↵Paul Hoad2019-02-081-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument comments to literals bugprone-argument-comment only supports identifying those comments which do not match the function parameter name This revision add 3 options to adding missing argument comments to literals (granularity on type is added to control verbosity of fixit) ``` CheckOptions: - key: bugprone-argument-comment.CommentBoolLiterals value: '1' - key: bugprone-argument-comment.CommentFloatLiterals value: '1' - key: bugprone-argument-comment.CommentIntegerLiterals value: '1' - key: bugprone-argument-comment.CommentStringLiterals value: '1' - key: bugprone-argument-comment.CommentCharacterLiterals value: '1' - key: bugprone-argument-comment.CommentUserDefinedLiterals value: '1' - key: bugprone-argument-comment.CommentNullPtrs value: '1' ``` After applying these options, literal arguments will be preceded with /*ParameterName=*/ Reviewers: JonasToth, Eugene.Zelenko, alexfh, hokein, aaron.ballman Reviewed By: aaron.ballman, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D57674 llvm-svn: 353535
* [clang-tidy] Fixed a std::bind() transformationJonas Toth2019-02-071-0/+44
| | | | | | | | There was an extra semicolon that was somehow working in some contexts. Patch by oleg.smolsky. llvm-svn: 353389
* [clang-tidy] modernize-avoid-c-arrays: avoid main function (PR40604)Roman Lebedev2019-02-062-0/+38
| | | | | | | | | | | | | | | | | | | | | Summary: The check should ignore the main function, the program entry point. It is not possible to use `std::array<>` for the `argv`. The alternative is to use `char** argv`. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=40604 | PR40604 ]] Reviewers: JonasToth, aaron.ballman Reviewed By: aaron.ballman Subscribers: xazax.hun, hans, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D57787 llvm-svn: 353327
* [clang-tidy] Handle unions with existing default-member-initMalcolm Parsons2019-02-041-0/+10
| | | | | | | | | | | | | | | | | | | | Summary: clang-tidy's modernize-use-default-member-init was crashing for unions with an existing default member initializer. Fixes PR40492 Reviewers: aaron.ballman, alexfh, JonasToth Reviewed By: JonasToth Subscribers: JonasToth, riccibruno, xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D57665 llvm-svn: 353092
* [clang-tidy] Add the abseil-duration-unnecessary-conversion checkHyrum Wright2019-02-042-0/+71
| | | | | | Differential Revision: https://reviews.llvm.org/D57353 llvm-svn: 353079
* Revert rCTE352968 due to compilation failures 💥Stephane Moore2019-02-021-8/+0
| | | | llvm-svn: 352969
* [clang-tidy] Make google-objc-function-naming ignore implicit functions 🙈Stephane Moore2019-02-021-0/+8
| | | | | | | | | | | | | | | | | | Summary: Implicit functions are outside the control of source authors and should be exempt from style restrictions. Tested via running clang tools tests. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D57207 llvm-svn: 352968
* [Clangd] textDocument/definition and textDocument/declaration "bounce" ↵Sam McCall2019-02-021-8/+41
| | | | | | | | | | | | | | | | | | between definition and declaration location when they are distinct. Summary: This helps minimize the disruption of not returning declarations as part of a find-definition response (r352864). Reviewers: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D57580 llvm-svn: 352953
* [clangd] Implement textDocument/declaration from LSP 3.14Sam McCall2019-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: LSP now reflects the declaration/definition distinction. Language server changes: - textDocument/definition now returns a definition if one is found, otherwise the declaration. It no longer returns declaration + definition if they are distinct. - textDocument/declaration returns the best declaration we can find. - For macros, the active macro definition is returned for both methods. - For include directive, the top of the target file is returned for both. There doesn't appear to be a discovery mechanism (we can't return everything to clients that only know about definition), so this changes existing behavior. In practice, it should greatly reduce the fraction of the time we need to show the user a menu of options. C++ API changes: - findDefinitions is replaced by locateSymbolAt, which returns a vector<LocatedSymbol> - one for each symbol under the cursor. - this contains the preferred declaration, the definition (if found), and the symbol name This API enables some potentially-neat extensions, like swapping between decl and def, and exposing the symbol name to the UI in the case of multiple symbols. Reviewers: hokein Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57388 llvm-svn: 352864
* [clangd] Append "(fix available)" to diagnostic message when fixes are present.Eric Liu2019-01-317-12/+12
| | | | | | | | | | | | | | | | Summary: This would make diagnostic fixits more discoverable, especially for plugins like YCM. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57509 llvm-svn: 352764
* [clangd] Drop fixes if replying with tweaks resulted in an errorIlya Biryukov2019-01-301-1/+1
| | | | | | | | | | This should not happen in normal operation, as it implies that the diagnostics with some available fixes were produced but the AST is invalid. Moreover, the code had an error: always returned code actions ignoring the SupportsCodeAction capability and writing a test for this is impossible, since this can only happen due to programmer's error rather than invalid inputs. llvm-svn: 352624
* [clangd] Interfaces for writing code tweaksIlya Biryukov2019-01-292-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The code tweaks are an implementation of mini-refactorings exposed via the LSP code actions. They run in two stages: - Stage 1. Decides whether the action is available to the user and collects all the information required to finish the action. Should be cheap, since this will run over all the actions known to clangd on each textDocument/codeAction request from the client. - Stage 2. Uses information from stage 1 to produce the actual edits that the code action should perform. This stage can be expensive and will only run if the user chooses to perform the specified action in the UI. One unfortunate consequence of this change is increased latency of processing the textDocument/codeAction requests, which now wait for an AST. However, we cannot avoid this with what we have available in the LSP today. Reviewers: kadircet, ioeric, hokein, sammccall Reviewed By: sammccall Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56267 llvm-svn: 352494
* [clang-tidy] Add the abseil-duration-addition checkHyrum Wright2019-01-282-0/+111
| | | | | | Differential Revision: https://reviews.llvm.org/D57185 llvm-svn: 352362
* Fix a lit test failure after D54438Kristof Umann2019-01-261-1/+1
| | | | llvm-svn: 352290
* [clang-tidy] fix unit tests for dropped _Float16 support in X86Jonas Toth2019-01-253-47/+51
| | | | | | | | | | | | | | | | Summary: Because _Float16 was disabled for X86 targets the unit-tests started failing. Extract the pieces for _Float16 and run theses tests under AArch64. Reviewers: aaron.ballman, erichkeane, lebedev.ri Reviewed By: erichkeane Subscribers: javed.absar, xazax.hun, kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D57249 llvm-svn: 352231
* Temporairly disable readability-uppercase-literal-suffix tests that depend ↵Roman Lebedev2019-01-252-0/+4
| | | | | | on _Float16, to get bots back to green llvm-svn: 352224
* [clang-tidy] Add check for underscores in googletest names.Haojian Wu2019-01-251-0/+108
| | | | | | | | | | | | | | | | | | Summary: Adds a clang-tidy warning for underscores in googletest names. Patch by Kar Epker! Reviewers: hokein, alexfh, aaron.ballman Reviewed By: hokein Subscribers: Eugene.Zelenko, JonasToth, MyDeveloperDay, lebedev.ri, xazax.hun, mgorny, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D56424 llvm-svn: 352183
* [extra] unit tests enable crash-recovery cases on FreeBSDDavid Carlier2019-01-241-3/+1
| | | | | | | | | | | | Seems the previous statement does not hold up anymore. Reviewers: steveire Reviewed By: steveire Differential Revision: https://reviews.llvm.org/D57102 llvm-svn: 352031
* [clang-tidy] Work around http://llvm.org/PR40392Alexander Kornienko2019-01-211-0/+12
| | | | | | | | | The readability-else-after-return check should be smarter about cases where the variable defined in the condition is used in the `else` branch. This patch makes it just ignore such cases, but alternative solutions may be better (added a FIXME). llvm-svn: 351751
* [clang-tidy] misc-non-private-member-variables-in-classes: ignore implicit ↵Miklos Vajna2019-01-201-0/+17
| | | | | | | | | | methods Otherwise we don't warn on a struct containing a single public int, but we warn on a struct containing a single public std::string, which is inconsistent. llvm-svn: 351686
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] add reproducer for PR39949 into test-suiteJonas Toth2019-01-181-0/+33
| | | | | | | | | | | | | | | | | Summary: The underlying issue is fixed in https://reviews.llvm.org/D56444 and this test ensures the issue does not creep back into our code-base. Reviewers: alexfh, aaron.ballman, hokein, hwright Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56918 llvm-svn: 351569
* [clang-tidy] Add abseil-duration-conversion-cast checkHyrum Wright2019-01-171-0/+95
| | | | | | Differential Revision: https://reviews.llvm.org/D56532 llvm-svn: 351473
* Revert r351208 (which was a revert of r350892).Aaron Ballman2019-01-173-36/+26
| | | | | | This corresponds to the fix to Clang in r351470. llvm-svn: 351471
* [clang-tidy] bugprone-string-constructor: Catch string from nullptr.Clement Courbet2019-01-161-0/+11
| | | | | | | | | | Summary: Context: https://twitter.com/willkirkby/status/1084219580799741953 Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56657 llvm-svn: 351308
* [clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas ↵Sam McCall2019-01-161-0/+2
| | | | | | after r351047 llvm-svn: 351307
* [clang-tidy] Treat references to smart pointers correctly in use-after-move.Martin Bohme2019-01-161-0/+13
| | | | | | | | | | | | | | | | | | | Summary: Previously, we weren't recognizing these as smart pointers and thus weren't allowing non-dereference accesses as we should -- see new test cases which fail without the fix. Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: JonasToth Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D56585 llvm-svn: 351303
* [clangd] XPC transport layerJan Korous2019-01-164-2/+22
| | | | | | | | | | | | - New transport layer for macOS. - XPC Framework - Test client Framework and client were written by Alex Lorenz. Differential Revision: https://reviews.llvm.org/D54428 llvm-svn: 351280
* Revert "Update clang-tools-extra for r350891 from Clang."Benjamin Kramer2019-01-153-26/+36
| | | | | | This reverts commit r350892. llvm-svn: 351208
* [clang-tidy] new check 'readability-redundant-preprocessor'Miklos Vajna2019-01-113-0/+125
| | | | | | | | | | Finds potentially redundant preprocessor directives. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D54349 llvm-svn: 350922
* Update clang-tools-extra for r350891 from Clang.Aaron Ballman2019-01-103-36/+26
| | | | llvm-svn: 350892
OpenPOWER on IntegriCloud