summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
Commit message (Collapse)AuthorAgeFilesLines
...
* add extra acronyms for objc property namesYan Zhang2018-04-181-0/+2
| | | | | | | | | | | | | | Summary: This is to support general acronyms in Objective-C like 2G/3G/4G/... and coordinates X, Y, Z and W. Reviewers: benhamilton Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45750 llvm-svn: 330286
* [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.Haojian Wu2018-04-181-0/+12
| | | | | | | | | | | | | | Summary: Fix https://bugs.llvm.org/show_bug.cgi?id=34900. Reviewers: alexfh Reviewed By: alexfh Subscribers: JonasToth, klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D45697 llvm-svn: 330245
* [clang-tidy] readability-function-size: add VariableThreshold param.Roman Lebedev2018-04-122-6/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Pretty straight-forward, just count all the variable declarations in the function's body, and if more than the configured threshold - do complain. Note that this continues perverse practice of disabling the new option by default. I'm not certain where is the balance point between not being too noisy, and actually enforcing the good practice. If we really want to not disable this by default, but also to not cause too many new warnings, we could default to 50 or so. But that is a lot of variables too... I was able to find one coding style referencing variable count: - https://www.kernel.org/doc/html/v4.15/process/coding-style.html#functions > Another measure of the function is the number of local variables. They shouldn’t exceed 5-10, or you’re doing something wrong. Reviewers: hokein, xazax.hun, JonasToth, aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: kimgr, Eugene.Zelenko, rnkovacs, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D44602 llvm-svn: 329902
* [clang-tidy] [modernize-use-auto] Fix test ↵Zinovy Nis2018-04-121-1/+1
| | | | | | | | | | modernize-use-auto-new-remove-stars.cpp after improvement 'tooling::fixit::getText' considers a length of "int *" to be 5 instead of 3 in a new algorithm in https://reviews.llvm.org/rCTE329873. It was the root of the test failure. llvm-svn: 329881
* [clang-apply-replacements] Convert tooling::Replacements to ↵Malcolm Parsons2018-04-1110-15/+78
| | | | | | | | | | | | | | | | | | | | tooling::AtomicChange for conflict resolving of changes, code cleanup, and code formatting. Summary: By converting Replacements by AtomicChange, clang-apply-replacements is able like clang-tidy to automatically cleanup and format changes. This should permits to close this ticket: https://bugs.llvm.org/show_bug.cgi?id=35051 and attempt to follow hints from https://reviews.llvm.org/D43500 comments. Reviewers: klimek, ioeric Reviewed By: ioeric Subscribers: malcolm.parsons, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D43764 Patch by Jeremy Demeule. llvm-svn: 329813
* [clang-tidy] fix buildbots from hicpp-signed-bitwiseJonas Toth2018-04-111-5/+10
| | | | | | | The applied patch to diagnose assignment operators introduced breakage on some architectures. This patch tries to rectify that. llvm-svn: 329790
* [clang-tidy] add missing assignment operations in hicpp-signed-bitwiseJonas Toth2018-04-112-29/+54
| | | | | | | | | | | | | This patch resolves the bug https://bugs.llvm.org/show_bug.cgi?id=36963. - implement missing assignment operators for hicpp-signed-bitwise - mention fix in release notes Reviewers: aaron.ballman, hokein, alexfh Differential: https://reviews.llvm.org/D45414 llvm-svn: 329789
* [clang-tidy] Add a `android-comparison-in-temp-failure-retry` checkGeorge Burgess IV2018-04-101-0/+148
| | | | | | | | | This check attempts to catch buggy uses of the `TEMP_FAILURE_RETRY` macro, which is provided by both Bionic and glibc. Differential Revision: https://reviews.llvm.org/D45059 llvm-svn: 329759
* [clang-tidy] Unbreak run-clang-tidy.cpp test ↵Roman Lebedev2018-04-101-0/+3
| | | | | | | | (modernize-use-auto.MinTypeNameLength) Again, refs. D45405, rL329730. llvm-svn: 329756
* [clang-tidy] [modernize-use-auto] Add a threshold for minimal type name ↵Zinovy Nis2018-04-104-4/+37
| | | | | | | | | | | | length to be replaced with 'auto' The threshold option is 'MinTypeNameLength' with default value '5'. With MinTypeNameLength == 5 'int'/'bool' and 'const int'/'const bool' will not be converted to 'auto', while 'unsigned' will be. Differential Revision: https://reviews.llvm.org/D45405 llvm-svn: 329730
* [clang-tidy] Return non-zero exit code for clang errors.Alexander Kornienko2018-04-099-18/+34
| | | | | | | | | | | | | | | | Summary: Updated tests broken by this change. Fixes https://bugs.llvm.org/show_bug.cgi?id=27628 Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D45258 llvm-svn: 329579
* [clang-tidy] Check if grand-..parent's virtual method was called instead of ↵Zinovy Nis2018-04-061-0/+179
| | | | | | | | | | | | | overridden parent's. class A {...int virtual foo() {...}...}; class B: public A {...int foo() override {...}...}; class C: public B {...int foo() override {... A::foo()...}}; ^^^^^^^^ warning: qualified name A::foo refers to a member overridden in subclass; did you mean 'B'? [bugprone-parent-virtual-call] Differential Revision: https://reviews.llvm.org/D44295 llvm-svn: 329448
* [clang-tidy] Remove google-runtime-member-string-referencesBenjamin Kramer2018-04-051-49/+0
| | | | | | | | | | This is triggering on a pattern that's both too broad (const std::string& members can be used safely) and too narrow (std::string is not the only class with this problem). It has a very low true positive rate, just remove it until we find a better solution for dangling string references. llvm-svn: 329292
* [clang-tidy] Rename -warnings-as-errors tests. NFC.Alexander Kornienko2018-04-043-0/+0
| | | | | | The tests will be more discoverable with proper names. llvm-svn: 329182
* [clang-tidy] Check for sizeof that call functionsHaojian Wu2018-04-031-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: A common mistake that I have found in our codebase is calling a function to get an integer or enum that represents the type such as: ``` int numBytes = numElements * sizeof(x.GetType()); ``` So this extends the `sizeof` check to check for these cases. There is also a `WarnOnSizeOfCall` option so it can be disabled. Patch by Paul Fultz II! Reviewers: hokein, alexfh, aaron.ballman, ilya-biryukov Reviewed By: alexfh Subscribers: lebedev.ri, xazax.hun, jkorous-apple, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D44231 llvm-svn: 329073
* Revert r328932 as it caused Windows and MacOS bot failures.Mike Edwards2018-04-021-8/+0
| | | | | | http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/43991/ llvm-svn: 328997
* [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for ↵Zinovy Nis2018-04-011-0/+8
| | | | | | | | | | | | compatibility with clang static analyzer This macro is widely used in many well-known projects, ex. Chromium. But it's not set for clang-tidy, so for ex. DCHECK in Chromium is not considered as [[no-return]], and a lot of false-positive warnings about nullptr dereferenced are emitted. This patch fixes the issue by explicitly added macro definition. Differential Revision: https://reviews.llvm.org/D44906 llvm-svn: 328932
* Attempt to fix clangd test on Windows by wildcarding drive lettersReid Kleckner2018-03-271-1/+1
| | | | llvm-svn: 328645
* [clang-move] Fix test failing due to clang-format changeKrasimir Georgiev2018-03-271-0/+2
| | | | | | | r328621 reverted the removal of empty lines before the closing `}` in namespaces. llvm-svn: 328622
* [clangd] Support incremental document syncingSimon Marchi2018-03-263-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for incremental document syncing, as described in the LSP spec. The protocol specifies ranges in terms of Position (a line and a character), and our drafts are stored as plain strings. So I see two things that may not be super efficient for very large files: - Converting a Position to an offset (the positionToOffset function) requires searching for end of lines until we reach the desired line. - When we update a range, we construct a new string, which implies copying the whole document. However, for the typical size of a C++ document and the frequency of update (at which a user types), it may not be an issue. This patch aims at getting the basic feature in, and we can always improve it later if we find it's too slow. Signed-off-by: Simon Marchi <simon.marchi@ericsson.com> Reviewers: malaperle, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: MaskRay, klimek, mgorny, ilya-biryukov, jkorous-apple, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D44272 llvm-svn: 328500
* [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-2211-0/+444
| | | | | | Fixed windows release build tests. llvm-svn: 328270
* clang-tidy, modularize: return non-zero exit code on errorsAlexander Kornienko2018-03-222-2/+2
| | | | | | | When no inputs given, the tools should not only produce the help message, but also return a non-zero exit code. Fixed tests accordingly. llvm-svn: 328199
* Revert "[clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework""Julie Hockett2018-03-2211-444/+0
| | | | | | | This reverts commit r328150 until we can fix the test that are failing on the Windows release build. llvm-svn: 328172
* [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-2111-0/+444
| | | | | | Fixing the the failing Windows tests. llvm-svn: 328150
* Reland "[lit] Adding config initialization to lit tests in clang-tools-extra"Julie Hockett2018-03-211-0/+2
| | | | | | | | Adding the config initialization to clang-tools-extra so that tests that use REQUIRES, UNSUPPORTED, and XFAIL based on platform or target triple work properly. llvm-svn: 328131
* [clang-tidy] Marking hicpp-no-assembler-msvc unsupported on WindowsJulie Hockett2018-03-211-0/+2
| | | | | | | | After changes to lit.site.cfg.in, the test is now running (and failing) on windows, so temporarily marking it unsupported. See PR36855 for more details. llvm-svn: 328127
* [clang-tidy] Resubmit hicpp-multiway-paths-covered without breaking testJonas Toth2018-03-212-0/+525
| | | | | | | | | | | | | | | | | | | | | | | | The original check did break the green buildbot in the sanitizer build. It took a while to redroduce and understand the issue. There occured a stackoverflow while parsing the AST. The testcase with 256 case labels was the problem because each case label added another stackframe. It seemed that the issue occured only in 'RelWithDebInfo' builds and not in normal sanitizer builds. To simplify the matchers the recognition for the different kinds of switch statements has been moved into a seperate function and will not be done with ASTMatchers. This is an attempt to reduce recursion and stacksize as well. The new check removed this big testcase. Covering all possible values is still implemented for bitfields and works there. The same logic on integer types will lead to the issue. Running it over LLVM gives the following results: Differential: https://reviews.llvm.org/D40737 llvm-svn: 328107
* [clang-tidy][modernize-make-unique] Checks c++14 flag before using ↵Alexander Kornienko2018-03-214-2/+23
| | | | | | | | | | | | | | | | | | | | std::make_unique Summary: For a c++11 code, the clang-tidy rule "modernize-make-unique" should return immediately, as std::make_unique is not supported. Reviewers: hokein, aaron.ballman, ilya-biryukov, alexfh Reviewed By: hokein, aaron.ballman, alexfh Subscribers: Quuxplusone, xazax.hun, cfe-commits Tags: #clang-tools-extra Patch by Frederic Tingaud! Differential Revision: https://reviews.llvm.org/D43766 llvm-svn: 328101
* Revert "[lit] Adding config initialization to lit tests in clang-tools-extra"Petr Hosek2018-03-211-2/+0
| | | | | | | | This reverts commit r328060 because a test that was inteded to run on Windows but never ran before due to the missing config initialization is now being executed and is failing. llvm-svn: 328069
* [lit] Adding config initialization to lit tests in clang-tools-extraJulie Hockett2018-03-201-0/+2
| | | | | | | | | | Adding the config initialization to clang-tools-extra so that tests that use REQUIRES, UNSUPPORTED, and XFAIL based on platform or target triple work properly. Differential Revision: https://reviews.llvm.org/D44708 llvm-svn: 328060
* Fixup test to explicitly use -fexceptions since exceptions are disabled by ↵Douglas Yung2018-03-191-1/+1
| | | | | | default on the PS4 target. llvm-svn: 327911
* [clang-move] Fix the failing test caused by changes in clang-format.Haojian Wu2018-03-191-1/+0
| | | | llvm-svn: 327887
* [clang-move] Fix move-used-helper-decls.cpp test.Fangrui Song2018-03-191-1/+0
| | | | llvm-svn: 327885
* run-clang-tidy: forward clang-tidy exit statusMiklos Vajna2018-03-192-0/+19
| | | | | | | | | | | | | | | | | | | | | Exit with a non-zero value in case any of the underlying clang-tidy invocations exit with a non-zero value. This is useful in case WarningsAsErrors is enabled for some of the checks: if any of those checks find something, the exit status now reflects that. Also add the ability to use run-clang-tidy.py via lit, and assert that the exit code is not 0 when modernize-use-auto is triggered intentionally. Reviewers: alexfh, aaron.ballman Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D44366 llvm-svn: 327854
* [clang-tidy] New check bugprone-unused-return-valueAlexander Kornienko2018-03-192-0/+248
| | | | | | | | | | | | | | | | | | | | | Summary: Detects function calls where the return value is unused. Checked functions can be configured. Reviewers: alexfh, aaron.ballman, ilya-biryukov, hokein Reviewed By: alexfh, aaron.ballman Subscribers: hintonda, JonasToth, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra Patch by Kalle Huttunen! Differential Revision: https://reviews.llvm.org/D41655 llvm-svn: 327833
* [clang-tidy] rename_check.py misc-unused-raii bugprone-unused-raii ↵Alexander Kornienko2018-03-151-1/+1
| | | | | | --check_class_name=UnusedRAIICheck llvm-svn: 327610
* [clang-tidy] rename_check.py misc-sizeof-container bugprone-sizeof-containerAlexander Kornienko2018-03-151-2/+2
| | | | llvm-svn: 327608
* [clang-tidy] rename_check.py misc-sizeof-expression bugprone-sizeof-expressionAlexander Kornienko2018-03-151-1/+1
| | | | llvm-svn: 327607
* [clang-tidy] rename_check.py {misc,bugprone}-macro-parenthesesAlexander Kornienko2018-03-152-7/+7
| | | | llvm-svn: 327606
* [clang-tidy] Add Zircon module to clang-tidyJulie Hockett2018-03-141-0/+109
| | | | | | | | | | Adding a Zircon module to clang-tidy for checks specific to the Zircon kernel, and adding a checker to fuchsia-zx (for zircon) to flag instances where specific objects are temporarily created. Differential Revision: https://reviews.llvm.org/D44346 llvm-svn: 327590
* Revert "Reland "[clang-doc] Setup clang-doc frontend framework""Julie Hockett2018-03-1211-438/+0
| | | | | | | This reverts commit r327295 since it was causing the Windows bots to fail. llvm-svn: 327346
* Reland "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-1211-0/+438
| | | | | | | There was a missing newline in the docs, and a static_assert that needed to be a normal assert. llvm-svn: 327295
* [clangd] Revamp handling of diagnostics.Ilya Biryukov2018-03-124-104/+6
| | | | | | | | | | | | | | | | Summary: The new implementation attaches notes to diagnostic message and shows the original diagnostics in the message of the note. Reviewers: hokein, ioeric, sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D44142 llvm-svn: 327282
* [clangd] Fix failing lit test.Haojian Wu2018-03-091-2/+2
| | | | | | This test is missed in r327129. llvm-svn: 327131
* [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWithHaojian Wu2018-03-091-0/+55
| | | | | | | | | | | | Patch by Niko Weh! Reviewers: hokein Subscribers: klimek, cfe-commits, ioeric, ilya-biryukov, ahedberg Differential Revision: https://reviews.llvm.org/D43847 llvm-svn: 327111
* Revert "[clang-doc] Setup clang-doc frontend framework"Julie Hockett2018-03-0911-438/+0
| | | | | | | This reverts commit r327102, since it was breaking the linux-abi-test on x86. llvm-svn: 327103
* [clang-doc] Setup clang-doc frontend frameworkJulie Hockett2018-03-0911-0/+438
| | | | | | | | | | | | | | | | Setting up the mapper part of the frontend framework for a clang-doc tool. It creates a series of relevant matchers for declarations, and uses the ToolExecutor to traverse the AST and extract the matching declarations and comments. The mapper serializes the extracted information to individual records for reducing and eventually doc generation. 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/D41102 llvm-svn: 327102
* [clang-tidy] Add "portability" module and rename readability-simd-intrinsics ↵Fangrui Song2018-03-072-6/+6
| | | | | | | | | | | | to portability-simd-intrinsics Reviewers: alexfh Subscribers: klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D44173 llvm-svn: 326909
* [clangd] Don't end completion item labels with '::'Ilya Biryukov2018-03-061-3/+3
| | | | llvm-svn: 326809
* [clang-tidy] Fix one corner case in make-unique check.Haojian Wu2018-03-061-0/+8
| | | | | | | | | | | | | | | | | Summary: Previously, we tried to cover all "std::initializer_list" implicit conversion cases in the code, but there are some corner cases that not covered (see newly-added test in the patch). Sipping all implicit AST nodes is a better way to filter out all these cases. Reviewers: ilya-biryukov Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D44137 llvm-svn: 326799
OpenPOWER on IntegriCloud