summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] The patch extends the existing command line option -check-suffix Zinovy Nis2018-10-092-29/+71
| | | | | | | | | | | | | | (with alias -check-suffixes) to accept multiple comma-separated FileCheck prefixes. Usage: // RUN: %check_clang_tidy -check-suffix=USING-C,USING-D %s misc-unused-using-decls %t -- -- ... or for the same: // RUN: %check_clang_tidy -check-suffixes=USING-C,USING-D %s misc-unused-using-decls %t -- -- ... Differential Revision: https://reviews.llvm.org/D52971 llvm-svn: 344015
* [clang-tidy] Replace deprecated std::ios_base aliasesJonas Toth2018-10-051-0/+239
| | | | | | | | | | | | | This check warns the uses of the deprecated member types of std::ios_base and replaces those that have a non-deprecated equivalent. Patch by andobence! Reviewd by: alexfh Revision ID: https://reviews.llvm.org/D51332 llvm-svn: 343848
* [clang-doc] Clean up Markdown outputJulie Hockett2018-10-045-19/+38
| | | | | | | | Make the output for the MDGenerator cleaner and more readable. Differential Revision: https://reviews.llvm.org/D52754 llvm-svn: 343818
* [clang-tidy] fix failing unit testsJonas Toth2018-10-045-42/+30
| | | | | | | | The removal from the FIX-IT notes through the check-clang-tidy script was done incorrect. I did not detect beforehand but adjusted the script and tests accordingly llvm-svn: 343797
* [clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-argumentsJonas Toth2018-10-041-14/+13
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52688 llvm-svn: 343792
* [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-initJonas Toth2018-10-042-6/+10
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52691 llvm-svn: 343791
* [clang-tidy] Added pointer types to clang-tidy readability-identifier-naming ↵Jonas Toth2018-10-041-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | check. Summary: Option to check for different naming conventions on the following types: - GlobalConstantPointer - GlobalPointer - LocalConstantPointer - LocalPointer - PointerParameter - ConstantPointerParameter When not specified, the conventions for the non pointer types will be applied (GlobalConstant, GlobalVariable, LocalConstant, ...). Patch by ffigueras! Reviewers: alexfh, kbobyrev Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52882 llvm-svn: 343788
* [clang-tidy] Sequence statements with multiple parents correctly (PR39149)Martin Bohme2018-10-041-0/+12
| | | | | | | | | | | | | | | | | | | | | Summary: Before this fix, the bugprone-use-after-move check could incorrectly conclude that a use and move in a function template were not sequenced. For details, see https://bugs.llvm.org/show_bug.cgi?id=39149 Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52782 llvm-svn: 343768
* [clang-doc] Avoid parsing undefined base classesJulie Hockett2018-10-036-344/+403
| | | | | | | | | Don't try to parse base classes for declarations that are not definitions (segfaults, as there is no DefinitionData to access). Differential Revision: https://reviews.llvm.org/D52313 llvm-svn: 343703
* [clangd] Don't make check-clangd as a dependency in check-clang-toolsHaojian Wu2018-10-021-11/+16
| | | | | | | | | | | | | | | | Summary: check-clang-tools will run check-clangd first, and then run the rest tests. If clangd tests fails, check-clang-tools would be stopped. This would block other clang-tools developers if clangd is broken. Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52781 llvm-svn: 343608
* [clang-tidy] Ignore singe bit bitfield -> bool conversion in ↵Alexander Kornienko2018-10-021-0/+21
| | | | | | readability-implicit-bool-conversion llvm-svn: 343578
* [clang-tidy] NFC use CHECK-NOTES in test for cppgoreguidelines-avoid-gotoJonas Toth2018-10-021-8/+8
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D52686 llvm-svn: 343565
* [clang-tidy] NFC use CHECK-NOTES in tests for cppcoreguidelines-owning-memoryJonas Toth2018-10-022-49/+50
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D52687 llvm-svn: 343564
* [clang-tidy] Build it even without static analyzerStephen Kelly2018-10-0110-28/+31
| | | | | | | | | | | | | | | | | | | | | | Conditionally compile the parts of clang-tidy which depend on the static analyzer. Funnily enough, I made the patch to exclude this from the build in 2013, and it was committed with the comment that the tool should not be fully excluded, but only the parts of it which depend on the analyzer should be excluded. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130617/081797.html This commit implements that idea. Reviewed By: aaron.ballman Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52334 llvm-svn: 343528
* [clangd] exclude check-clangd from check-all, fix buildbot failure.Haojian Wu2018-10-011-0/+3
| | | | | | | | check-clangd is included via check-clang-tools, otherwise we will run two instances of check-clangd in parallel when running 'check-all', which may have race condition. llvm-svn: 343526
* [clangd] Add "check-clangd" targetHaojian Wu2018-10-011-15/+16
| | | | | | | | | | | | | | | | | | | | | Summary: So we don't have to run "check-clang-tools" (which builds and tests all clang tools) to verify our clangd-related change. It'd save waiting time for clangd developers. check-clangd (build ~1000 files, run ~340 tests) vs check-clang-tools (build ~3000 files, run ~1000 tests). In the future, we probably want to add similar target for other clang-tools (e.g. clang-tidy). Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52710 llvm-svn: 343474
* Reverting r343415 as it breaks at least one of the bots.Aaron Ballman2018-09-3010-31/+28
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/37336 llvm-svn: 343418
* Allow clang-tidy to be built without a dependency on the clang static analyzer.Aaron Ballman2018-09-3010-28/+31
| | | | | | Patch by Stephen Kelly. llvm-svn: 343415
* [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usageJonas Toth2018-09-272-12/+12
| | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52229 llvm-svn: 343201
* [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-moveJonas Toth2018-09-271-110/+110
| | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52228 llvm-svn: 343199
* [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespaceJonas Toth2018-09-271-22/+22
| | | | | | | | | | Reviewers: aaron.ballman, alexfh, hokein Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52185 llvm-svn: 343198
* [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effectsJonas Toth2018-09-251-19/+38
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52230 llvm-svn: 343001
* [clang-tidy] Add modernize-concat-nested-namespaces checkJonas Toth2018-09-251-0/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Finds instances of namespaces concatenated using explicit syntax, such as `namespace a { namespace b { [...] }}` and offers fix to glue it to `namespace a::b { [...] }`. Properly handles `inline` and unnamed namespaces. ~~Also, detects empty blocks in nested namespaces and offers to remove them.~~ Test with common use cases included. I ran the check against entire llvm repository. Except for expected `nested namespace definitions only available with -std=c++17 or -std=gnu++17` warnings I noticed no issues when the check was performed. Example: ``` namespace a { namespace b { void test(); }} ``` can become ``` namespace a::b { void test(); } ``` Patch by wgml! Reviewers: alexfh, aaron.ballman, hokein Reviewed By: aaron.ballman Subscribers: JonasToth, Eugene.Zelenko, lebedev.ri, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52136 llvm-svn: 343000
* Deduplicate replacements from diagnostics.Eric Liu2018-09-254-5/+16
| | | | | | | | | | | | | | | | | | | Summary: After r329813, clang-apply-replacements stopped deduplicating identical replacements; however, tools like clang-tidy relies on the deduplication of identical dignostics replacements from different TUs to apply fixes correctly. This change partially roll back the behavior by deduplicating changes from diagnostics. Ideally, we should deduplicate on diagnostics level, but we need to figure out an effecient way. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52264 llvm-svn: 342951
* [clang-tidy] use CHECK-NOTES in bugprone-unused-return-valueJonas Toth2018-09-182-31/+62
| | | | | | | | | | | | Reviewers: aaron.ballman, alexfh, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52187 llvm-svn: 342468
* [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overloadJonas Toth2018-09-181-14/+21
| | | | | | | | | | | | Reviewers: aaron.ballman, alexfh, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52186 llvm-svn: 342459
* [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-commentJonas Toth2018-09-183-19/+64
| | | | | | | | | | | | | | | | | Summary: This patch uses CHECK-NOTES for the tests. Its part of an effort to test *ALL* generated diagnostics in clang-tidy, as emitted notes were previously ignored. Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52178 llvm-svn: 342458
* [clangd] dexp tool uses llvm::cl to parse its flags.Sam McCall2018-09-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We can use cl::ResetCommandLineParser() to support different types of command-lines, as long as we're careful about option lifetimes. (I tried using subcommands, but the error messages were bad) I found a mostly-reasonable pattern to isolate the fiddly parts. Added -scope and -limit flags to the `find` command to demonstrate. (Note that scope support seems to be broken in dex?) Fixed symbol lookup to parse symbol IDs. Caveats: - with command help (e.g. `find -help`), you also get some spam about required arguments. This is a bug in llvm::cl, which prints these to errs() rather than the designated stream. Reviewers: kbobyrev Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51989 llvm-svn: 342456
* [clang-tidy] Fix tests for performance-for-range-copyShuai Wang2018-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | Test failed as D52120 made ExprMutationAnalyzer smarter, fixed by: - Add move-ctor for `Mutable` to make it actually movable. - Properly implement `remove_reference`. The failed test case is: void negativeVarIsMoved() { for (auto M : View<Iterator<Mutable>>()) { auto Moved = std::move(M); } } Before D52120, `std::move(M)` itself is considered as a mutation to `M`, while after D52120 it's only considered as a cast to rvalue, the move-assignment is what causes the actual mutation. The test case didn't mock things properly so the intended move-assignement was actually a copy-assignment. llvm-svn: 342417
* [clang-tidy] fix PR37913, templated exception factory diagnosed correctlyJonas Toth2018-09-171-35/+137
| | | | | | | | | | | | | | | | | | | Summary: PR37913 documents wrong behaviour for a templated exception factory function. The check does misidentify dependent types as not derived from std::exception. The fix to this problem is to ignore dependent types, the analysis works correctly on the instantiated function. Reviewers: aaron.ballman, alexfh, hokein, ilya-biryukov Reviewed By: alexfh Subscribers: lebedev.ri, nemanjai, mgorny, kbarton, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D48714 llvm-svn: 342393
* FixIdriss Riouak2018-09-171-4/+4
| | | | llvm-svn: 342389
* [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains ↵Idriss Riouak2018-09-171-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | about variable cast to void 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=32575 where you can find more information. For example: ``` template <typename T0> struct S { template <typename T> void g() const { int a; (void)a; } }; void f() { S<int>().g<int>(); } ``` this piece of code should not trigger any warning by the check modernize-redundant-void-arg but when we execute the following command ``` clang_tidy -checks=-*,modernize-redundant-void-arg test.cpp -- -std=c++11 ``` we obtain the following warning: /Users/eco419/Desktop/clang-tidy.project/void-redundand_2/test.cpp:6:6: warning: redundant void argument list in function declaration [modernize-redundant-void-arg] (void)a; ^~~~ Reviewers: aaron.ballman, hokein, alexfh, JonasToth Reviewed By: aaron.ballman, JonasToth Subscribers: JonasToth, lebedev.ri, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52135 llvm-svn: 342388
* Mark index-tools.test as REQUIRES: shell so that it does not run with the ↵Reid Kleckner2018-09-141-0/+1
| | | | | | internal lit shell which does not support "if" llvm-svn: 342282
* [modernize-use-transparent-functors] TypeLocs can be implicitly created, ↵Benjamin Kramer2018-09-141-1/+4
| | | | | | don't crash when encountering those. llvm-svn: 342252
* Update a clang-tidy test for r342194Vedant Kumar2018-09-131-2/+2
| | | | | | | | | | The location of implicit captures has changed. Update a use-after-move checker test to reflect that. This fixes a bot failure: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/36500 llvm-svn: 342195
* [clangd] Cleanup FuzzyFindRequest filtering limit semanticsKirill Bobyrev2018-09-131-7/+7
| | | | | | | | | | | As discussed during D51860 review, it is better to use `llvm::Optional` here as it has clear semantics which reflect intended behavior. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52028 llvm-svn: 342138
* [clangd] Use JSON format in benchmark requests readerKirill Bobyrev2018-09-133-6/+10
| | | | | | | | | | | | After `FuzzyFindRequest` JSON (de)serialization was introduced, it should replace ad-hoc fuzzy-find request parsing implemented in the IndexBenchmark driver. Reviewed By: ilya-biryukov Differential Revision: https://reviews.llvm.org/D51971 llvm-svn: 342137
* [clangd] Rename global-symbol-builder to clangd-indexer.Ilya Biryukov2018-09-132-2/+2
| | | | | | | | | | | | | | | | | | | Summary: Given that the indexer binary is put directly into ./bin directory when built, 'clangd-' prefix seems to provide better context to the reader than 'global-'. The new name is also shorter and easier to type. Reviewers: ioeric, sammccall, kadircet Reviewed By: ioeric, sammccall Subscribers: kbobyrev, ilya-biryukov, mgorny, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51987 llvm-svn: 342123
* Fix buildbots after r342027Kirill Bobyrev2018-09-121-1/+2
| | | | llvm-svn: 342036
* [clangd] Add index benchmarksKirill Bobyrev2018-09-125-0/+33
| | | | | | | | | | | This patch introduces index benchmarks on top of the proposed LLVM benchmark pull. Reviewed By: sammccall, lebedev.ri Differential Revision: https://reviews.llvm.org/D51090 llvm-svn: 342026
* Reland "Implement a (simple) Markdown generator"Julie Hockett2018-09-115-0/+349
| | | | | | | | Relanding with fixes to tests for the failing bots. Differential Revision: https://reviews.llvm.org/D43424 llvm-svn: 341955
* [clang-tidy] Insert absl::StrAppend when replacing StrCat.Benjamin Kramer2018-09-111-4/+4
| | | | | | | There might be no using decl for StrAppend around, inserting the qualified name is less likely to break things. llvm-svn: 341929
* [clang-tidy] Add a missing comma after "flags"Benjamin Kramer2018-09-113-2/+2
| | | | llvm-svn: 341925
* [clang-tidy] Abseil: Allow macros inside of absl to use internal absl thingsBenjamin Kramer2018-09-072-0/+10
| | | | llvm-svn: 341643
* [clangd] Fix references.test assertionsSam McCall2018-09-051-3/+3
| | | | llvm-svn: 341466
* [clangd] Add xrefs LSP boilerplate implementation.Sam McCall2018-09-053-35/+42
| | | | | | | | | | Reviewers: ilya-biryukov, ioeric Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50896 llvm-svn: 341462
* Import lit.llvm after rL341130Fangrui Song2018-08-311-1/+1
| | | | llvm-svn: 341152
* Remove LIT_SITE_CFG_IN_FOOTER, clang-tools-extraNico Weber2018-08-301-1/+2
| | | | | | | | | | It's always replaced with the same (short) static string, so just put that there directly. No intended behavior change. https://reviews.llvm.org/D51357 llvm-svn: 341130
* [clang-tidy] fix check_clang_tidy to forbid mixing of CHECK-NOTES and ↵Jonas Toth2018-08-301-0/+3
| | | | | | | | | | | | | | | | | | | CHECK-MESSAGES Summary: The check_clang_tidy.py script would allow mixing of `CHECK-NOTES` and `CHECK-MESSAGES` but running `FileCheck` for that would implicitly fail, because `CHECK-NOTES` bails out if there is a warning. That means a clang-tidy test can not mix these constructs to check warnings with `CHECK-MESSAGES` and notes with `CHECK-NOTES`. The script gives now a clear error if that happens. Reviewers: alexfh, aaron.ballman, lebedev.ri, hokein Reviewed By: lebedev.ri Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D51381 llvm-svn: 341039
* [clang-tidy] Add abseil-no-internal-dependencies checkJonas Toth2018-08-293-2/+78
| | | | | | | | | | | Finds instances where the user depends on internal details and warns them against doing so. Should not be run on internal Abseil files or Abseil source code. Patch by hugoeg! Differential Revision: https://reviews.llvm.org/D50542 llvm-svn: 340928
OpenPOWER on IntegriCloud