summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce the abseil-redundant-strcat-calls check.Aaron Ballman2018-08-291-0/+188
| | | | | | This flags redundant calls to absl::StrCat where the result is being passed to another call to absl::StrCat or absl::StrAppend. Patch by Hugo Gonzalez and Samuel Benzaquen. llvm-svn: 340918
* Introduce the abseil-str-cat-append check.Aaron Ballman2018-08-291-0/+129
| | | | | | This flags uses of absl::StrCat when absl::StrAppend should be used instead. Patch by Hugo Gonzalez and Benjamin Kramer. llvm-svn: 340915
* [clang-tidy] Abseil: no namepsace checkHaojian Wu2018-08-283-0/+26
| | | | | | | | | | This check ensures that users of Abseil do not open namespace absl in their code, as that violates our compatibility guidelines. AbseilMatcher.h written by Hugo Gonzalez. Patch by Deanna Garcia! llvm-svn: 340800
* [clangd] send diagnostic categories only when 'categorySupport'Alex Lorenz2018-08-229-12/+43
| | | | | | | | | | | | capability was given by the client After r339738 Clangd started sending categories with each diagnostic, but that broke the eglot client. This commit puts the categories behind a capability to fix that breakage. Differential Revision: https://reviews.llvm.org/D51077 llvm-svn: 340449
* [clang-tidy] Abseil: faster strsplit delimiter checkHaojian Wu2018-08-221-0/+99
| | | | | | | | | | | This check is an abseil specific check that checks for code using single character string literals as delimiters and transforms the code into characters. The check was developed internally and has been running at google, this is just a move to open source the check. It was originally written by @sbenza. Patch by Deanna Garcia! llvm-svn: 340411
* [clang-tidy] Abseil: integral division of Duration checkHaojian Wu2018-08-171-0/+75
| | | | | | | | This check is an abseil specific test that tests to ensure users utilize abseil specific floating point division when trying to divide with abseil duration types. Patch by Deanna Garcia! llvm-svn: 340038
* Revert "Implement a (simple) Markdown generator"Julie Hockett2018-08-165-349/+0
| | | | | | | This reverts commit r339948, as it's breaking a few bots in ways that I can't reproduce right now. llvm-svn: 339966
* Implement a (simple) Markdown generatorJulie Hockett2018-08-165-0/+349
| | | | | | | | | | | | | | | Implementing a simple Markdown generator from the emitted bitcode summary of declarations. Very primitive at this point, but will be expanded. Currently emits an .md file for each class and namespace, listing its contents. For a more detailed overview of the tool, see the design document on the mailing list: http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html Differential Revision: https://reviews.llvm.org/D43424 llvm-svn: 339948
* [clangd][tests] Rename tests of clangd instance terminationJan Korous2018-08-152-0/+0
| | | | | | | | Just making testnames better reflect their testing scenarios. Differential Revision: https://reviews.llvm.org/D50641 llvm-svn: 339782
* [clangd][tests] Fix typo in tests - invalid LSP exit messageJan Korous2018-08-156-6/+6
| | | | | | | | Syntactically invalid JSON payload was causing clangd to terminate because of unexpected EOF rather than exit as a response to LSP exit message. Differential Revision: https://reviews.llvm.org/D50641 llvm-svn: 339781
* [clangd] update the new test to check for diagnostic's category as wellAlex Lorenz2018-08-141-0/+1
| | | | llvm-svn: 339739
* [clangd] add an extension field to LSP to transfer the diagnostic's categoryAlex Lorenz2018-08-147-0/+11
| | | | | | | | | This patch adds a 'category' extension field to the LSP diagnostic that's sent by Clangd. This extension is always on by default. Differential Revision: https://reviews.llvm.org/D50571 llvm-svn: 339738
* [clangd] add missing test from r339454Alex Lorenz2018-08-141-0/+66
| | | | | | I forgot to checkin the test for the fixits into SVN. llvm-svn: 339737
* [clang-doc] Pass over function-internal declarationsJulie Hockett2018-08-136-1125/+709
| | | | llvm-svn: 339592
* Fix lint tests for D50449Kadir Cetinkaya2018-08-132-0/+39
| | | | | | | | | | | | Reviewers: ilya-biryukov, hokein Reviewed By: hokein Subscribers: hokein, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50635 llvm-svn: 339572
* [clang-tidy] Recognize [[clang::reinitializes]] attribute in ↵Martin Bohme2018-08-131-0/+35
| | | | | | | | | | | | | | | | | | | | | | | bugprone-use-after-move Summary: This allows member functions to be marked as reinitializing the object. After a moved-from object has been reinitialized, the check will no longer consider it to be in an indeterminate state. The patch that adds the attribute itself is at https://reviews.llvm.org/D49911 Reviewers: ilya-biryukov, aaron.ballman, alexfh, hokein, rsmith Reviewed By: aaron.ballman Subscribers: dblaikie, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D49910 llvm-svn: 339571
* Add a new check to the readability module that flags uses of "magic numbers" ↵Aaron Ballman2018-08-121-0/+199
| | | | | | | | (both floating-point and integral). Patch by Florin Iucha <florin@signbit.net> llvm-svn: 339516
* [clang-tidy] check_clang_tidy.py: support CHECK-NOTES prefixRoman Lebedev2018-08-102-27/+46
| | | | | | | | | | | | | | | | | | | | Summary: Currently, there is two configured prefixes: `CHECK-FIXES` and `CHECK-MESSAGES` `CHECK-MESSAGES` checks that there are no test output lines with `warning:|error:`, which are not explicitly handled in lit tests. However there does not seem to be a nice way to enforce for all the `note:` to be checked. This was useful for me when developing D36836. Reviewers: alexfh, klimek, aaron.ballman, hokein Reviewed By: alexfh, aaron.ballman Subscribers: JonasToth, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D36892 llvm-svn: 339437
* [clang-tidy: modernize] modernize-redundant-void-arg crashes when a function ↵Alexander Kornienko2018-08-101-0/+43
| | | | | | | | | | | | body is in a macro Fixes https://bugs.llvm.org/show_bug.cgi?id=28406 Patch by IdrissRio. Differential revision: https://reviews.llvm.org/D49800 llvm-svn: 339433
* [clang-tidy] Omit cases where loop variable is not used in loop body inHaojian Wu2018-08-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | performance-for-range-copy check. Summary: The upstream change r336737 make the check too smart to fix the case where loop variable could be used as `const auto&`. But for the case below, changing to `const auto _` will introduce an unused complier warning. ``` for (auto _ : state) { // no references for _. } ``` This patch omit this case, and it is safe to do it as the case is very rare. Reviewers: ilya-biryukov, alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D50447 llvm-svn: 339415
* [CMake] Use normalized Windows target triplesPetr Hosek2018-08-093-3/+3
| | | | | | | | | | | Changes the default Windows target triple returned by GetHostTriple.cmake from the old environment names (which we wanted to move away from) to newer, normalized ones. This also requires updating all tests to use the new systems names in constraints. Differential Revision: https://reviews.llvm.org/D47381 llvm-svn: 339307
* [clang-tidy] Sequence init statements, declarations, and conditions ↵Martin Bohme2018-08-031-7/+24
| | | | | | | | | | | | | | | | | | correctly in if, switch, and while Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=36516. Reviewers: ilya-biryukov, alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D49918 llvm-svn: 338932
* [clangd] capitalize diagnostic messagesAlex Lorenz2018-08-035-8/+8
| | | | | | | | | The diagnostic messages that are sent to the client from Clangd are now always capitalized. Differential Revision: https://reviews.llvm.org/D50154 llvm-svn: 338919
* [clangd] Add test for changing build configurationSimon Marchi2018-08-032-0/+77
| | | | | | | | | | | | | | | Summary: This patch adds tests for the two ways of changing build configuration (pointing to a particular compile_commands.json): - Through the workspace/didChangeConfiguration notification. - Through the initialize request. Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50255 llvm-svn: 338914
* Use ExprMutationAnalyzer in performance-unnecessary-value-paramShuai Wang2018-08-031-0/+22
| | | | | | | | | | | | | | | | | | | | | | Summary: This yields better recall as ExprMutationAnalyzer is more accurate. One common pattern this check is now able to catch is: ``` void foo(std::vector<X> v) { for (const auto& elm : v) { // ... } } ``` Reviewers: george.karpenkov Subscribers: a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D50102 llvm-svn: 338903
* Reland "[clang-doc] Refactoring mapper to map by scope"Julie Hockett2018-08-0224-1519/+3736
| | | | | | | | | | | | | | | Relanding with a minor change to prevent an assertion on release bots. The result of this adjusted mapper pass is that all Function and Enum infos are absorbed into the info of their enclosing scope (i.e. the class or namespace in which they are defined). Namespace and Record infos are passed along to the final output, but the second pass creates a reference to each in its parent scope. As a result, the top-level final outputs are Namespaces and Records. Differential Revision: https://reviews.llvm.org/D48341 llvm-svn: 338763
* Revert "[clang-doc] Refactoring mapper to map by scope"Julie Hockett2018-08-0224-3736/+1519
| | | | | | This reverts commit r338738 as it's breaking the bots. llvm-svn: 338748
* [clang-doc] Refactoring mapper to map by scopeJulie Hockett2018-08-0224-1519/+3736
| | | | | | | | | | | The result of this adjusted mapper pass is that all Function and Enum infos are absorbed into the info of their enclosing scope (i.e. the class or namespace in which they are defined). Namespace and Record infos are passed along to the final output, but the second pass creates a reference to each in its parent scope. As a result, the top-level final outputs are Namespaces and Records. llvm-svn: 338738
* [clangd] allow clients to control the compilation database by passing inAlex Lorenz2018-08-011-0/+52
| | | | | | | | | | | | | compilationDatabaseChanges in the 'workspace/didChangeConfiguration' request This commit allows clangd to use an in-memory compilation database that's controlled from the LSP client (-compile_args_from=lsp). It extends the 'workspace/didChangeConfiguration' request to allow the client to pass in a compilation database subset that needs to be updated in the workspace. Differential Revision: https://reviews.llvm.org/D49758 llvm-svn: 338597
* [clang-tidy] Fix a crash in fuchsia-multiple-inheritanceIlya Biryukov2018-07-271-0/+11
| | | | | | | | | | | | | | Summary: See the test case for a repro. Reviewers: juliehockett, ioeric, hokein, aaron.ballman Reviewed By: hokein Subscribers: lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D49862 llvm-svn: 338124
* [clang-tidy] Fix llvm.org/PR38315 (support type aliases in ↵Alexander Kornienko2018-07-261-0/+13
| | | | | | modernize-shrink-to-fit) llvm-svn: 338025
* [clangd] Do not rebuild AST if inputs have not changedIlya Biryukov2018-07-261-1/+1
| | | | | | | | | | | | | | | | | Summary: If the contents are the same, the update most likely comes from the fact that compile commands were invalidated. In that case we want to avoid rebuilds in case the compile commands are actually the same. Reviewers: ioeric Reviewed By: ioeric Subscribers: simark, javed.absar, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D49783 llvm-svn: 338012
* [clang-tidy] fix PR36489 - respect deduced pointer types from auto as wellJonas Toth2018-07-231-0/+53
| | | | | | | | | | | | | | | | | | | | Summary: The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where pointer arithmetic is used, but does not check values where the pointer types is deduced via `auto`. This patch adjusts this behaviour and solved PR36489. I accidentally commited a wrong patch, this Differential is meant to have a correct revision description and code attached to it. Because the patch was accepted by aaron.ballman already, i will just commit it. See https://reviews.llvm.org/D48717 for the old differntial (contains wrong code from the mixup) Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D49682 llvm-svn: 337716
* Revert "[clang-tidy] fix PR36489 - respect deduced pointer types from auto ↵Jonas Toth2018-07-231-28/+1
| | | | | | | | as well" I applied the wrong patch. llvm-svn: 337712
* [clang-tidy] fix PR36489 - respect deduced pointer types from auto as wellJonas Toth2018-07-231-1/+28
| | | | | | | | | | | | | | | | | | Summary: The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where pointer arithmetic is used, but does not check values where the pointer types is deduced via ``auto``. This patch adjusts this behaviour and solved PR36489. Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov Reviewed By: alexfh, aaron.ballman Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D48717 llvm-svn: 337710
* [clang-doc] Create a script to generate testsJulie Hockett2018-07-2023-1389/+1634
| | | | | | | | | Upstreaming the script I use to generate clang-doc tests (and updating the existing tests to use it) Differential Revision: https://reviews.llvm.org/D49268 llvm-svn: 337632
* [clang-doc] Adding PublicOnly flagJulie Hockett2018-07-203-0/+455
| | | | | | | | | | | Submitted on behalf of Annie Cherkaev (@anniecherk) Added a flag which, when enabled, documents only those methods and fields which have a Public attribute. Differential Revision: https://reviews.llvm.org/D48395 llvm-svn: 337602
* [clang-tidy: modernize] Fix modernize-use-equals-default with {} brackets ↵Idriss Riouak2018-07-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list initialization: patch Summary: Hello, i would like to suggest a fix for one of the checks in clang-tidy. The bug was reported in https://bugs.llvm.org/show_bug.cgi?id=38039 where you can find more information. ``` struct UOB{ UOB(const UOB &Other):j{Other.j}{} int j; }; ``` In this case the check modernize-use-equals-default does not detect copy constructors that can be defaulted; that should be: ``` struct UOB{ UOB(const UOB &Other) = default; int j; }; ``` Reviewers: aaron.ballman, hokein, alexfh Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49356 llvm-svn: 337286
* [clang-tidy] Force exceptions to be enabled in testBenjamin Kramer2018-07-141-1/+1
| | | | | | For targets that have them off by default. llvm-svn: 337091
* [clang-tidy] Exception Escape CheckerAdam Balogh2018-07-131-0/+265
| | | | | | | | | | | Finds functions which may throw an exception directly or indirectly, but they should not: Destructors, move constructors, move assignment operators, the main() function, swap() functions, functions marked with throw() or noexcept and functions given as option to the checker. Differential Revision: https://reviews.llvm.org/D33537 llvm-svn: 336997
* [clang-tidy] readability-inconsistent-declaration-parameter-name: accept ↵Sam McCall2018-07-132-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | approximate name matches. Summary: The goal is to reduce false positives when the difference is intentional, like: foo(StringRef name); foo(StringRef name_ref) { string name = cleanup(name_ref); ... } Or semantically unimportant, like: foo(StringRef full_name); foo(StringRef name) { ... } There are other matching names we won't recognise (e.g. syns vs synonyms) but this catches many that we see in practice, and gives people a systematic workaround. The old behavior is available as a 'Strict' option. Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D49285 llvm-svn: 336992
* Use ExprMutationAnalyzer in performance-for-range-copyShuai Wang2018-07-101-0/+14
| | | | | | | | | | | | | | | | | | | | | Summary: This gives better coverage to the check as ExprMutationAnalyzer is more accurate comparing to isOnlyUsedAsConst. Majority of wins come from const usage of member field, e.g.: for (auto widget : container) { // copy of loop variable if (widget.type == BUTTON) { // const usage only recognized by ExprMutationAnalyzer // ... } } Reviewers: george.karpenkov Subscribers: a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D48854 llvm-svn: 336737
* [clangd] Implementation of textDocument/documentSymbolMarc-Andre Laperle2018-07-053-0/+53
| | | | | | | | | | | | | | | | | Summary: An AST-based approach is used to retrieve the document symbols rather than an in-memory index query. The index is not an ideal fit to achieve this because of the file-centric query being done here whereas the index is suited for project-wide queries. Document symbols also includes more symbols and need to keep the order as seen in the file. Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Subscribers: tomgr, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D47846 llvm-svn: 336386
* Add the cert-msc51-cpp and cert-msc32-c checks.Aaron Ballman2018-07-052-0/+237
| | | | | | | | These checks flag use of random number generators with poor seeds that would possibly lead to degraded random number generation. Patch by Borsik Gábor llvm-svn: 336301
* [clang-tidy] Fix http://llvm.org/PR38055Alexander Kornienko2018-07-041-0/+15
| | | | llvm-svn: 336283
* [clang-tidy] misc-unused-parameters - retain old behavior under StrictModeAlexander Kornienko2018-06-282-1/+62
| | | | | | | | | | | | | | Summary: This addresses https://bugs.llvm.org/show_bug.cgi?id=37467. Reviewers: klimek, ilya-biryukov, lebedev.ri, aaron.ballman Reviewed By: lebedev.ri, aaron.ballman Subscribers: aaron.ballman, lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D46951 llvm-svn: 335863
* [clang-tidy] This patch is a fix for D45405 where spaces were mistakenly ↵Zinovy Nis2018-06-151-20/+75
| | | | | | | | considered as a part of a type name. So length("int *") was 5 instead of 3 with RemoveStars=0 or 4 with RemoveStars=1 Differential Revision: https://reviews.llvm.org/D45927 llvm-svn: 334829
* [clangd] UI for completion items that would trigger include insertion.Eric Liu2018-06-153-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For completion items that would trigger include insertions (i.e. index symbols that are not #included yet), add a visual indicator "+" before the completion label. The inserted headers will appear in the completion detail. Open to suggestions for better visual indicators; "+" was picked because it seems cleaner than a few other candidates I've tried (*, #, @ ...). The displayed header would be like a/b/c.h (without quote) or <vector> for system headers. I didn't add quotation or "#include" because they can take up limited space and do not provide additional information after users know what the headers are. I think a header alone should be obvious for users to infer that this is an include header.. To align indentation, also prepend ' ' to labels of candidates that would not trigger include insertions (only for completions where index results are possible). Vim: {F6357587} vscode: {F6357589} {F6357591} Reviewers: sammccall, ilya-biryukov, hokein Reviewed By: sammccall Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48163 llvm-svn: 334828
* - Add "AV" as new default acronym. - Add support for "I" and "A" in ↵Yan Zhang2018-06-111-0/+1
| | | | | | | | | | | | | | | | lowerCamelCase pattern Summary: Now we can support property names like "hasADog" correctly. Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48039 llvm-svn: 334448
* Add support for arrays in performance-implicit-conversion-in-loopAlexander Kornienko2018-06-111-9/+45
| | | | | | | | | | | | | | | | | Summary: Add support for arrays (and structure that use naked pointers for their iterator, like std::array) in performance-implicit-conversion-in-loop Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits Patch by Alex Pilkiewicz. Differential Revision: https://reviews.llvm.org/D47945 llvm-svn: 334400
OpenPOWER on IntegriCloud