aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-08-06Revert renaming. Should rename tags instead.release_35Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_35@215017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-06Renaming to coincide with updated tagging system.release_35@215016Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_350@215007 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22Creating release_35 branchBill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_35@213603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-21[clang-tidy] Fix a false positive in the make_pair checker if an argument ↵Benjamin Kramer
has a explicit template argument. This required a rather ugly workaround for a problem in ASTMatchers where callee() is only overloaded for Stmt and Decl but not for Expr. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213509 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-21clang-tidy: [misc-use-override] Slightly tweak the wording of warning.Daniel Jasper
'final' should really be used with care. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie
This reverts commit r213308. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213324 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17unique_ptr-ify ownership of ASTConsumersDavid Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213308 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17Make the diagnostic message more complete to check the check name.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213245 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17[clang-tidy] MemsetZeroLenghtChecker: Don't crash trying to evaluate ↵Benjamin Kramer
dependent values. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213238 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17[clang-tidy] Provide links to the google style guide for checks derived from it.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213233 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16Track clang r213171Alp Toker
The clang rewriter is now a core facility. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16[clang-tidy] As a simple heuristic don't emit a swap fixit that would createBenjamin Kramer
negative-sized memsets. memset(x, -1, 0) is still useless but swapping makes no sense here. Just emit a warning. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213157 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16[clang-tidy] Also emit a warning for memset(x, 0, 0)Benjamin Kramer
It doesn't make sense to suggest swapping the arguments here but it's still useless code git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213156 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16[clang-tidy] Add a checker for zero-length memset.Benjamin Kramer
If there's memset(x, y, 0) in the code it's most likely a mistake. The checker suggests a fix-it to swap 'y' and '0'. I think this has the potential to be promoted into a general clang warning after some testing in clang-tidy. Differential Revision: http://reviews.llvm.org/D4535 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213155 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16[clang-tidy] Add namespaces checkers.Benjamin Kramer
This change contains of two checkers that warn about 1. anonymous namespaces in header files. 2. 'using namespace' directives everywhere. Differential Revision: http://reviews.llvm.org/D4523 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213153 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16Avoid adding redundant parens.Alexander Kornienko
Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits, sbenza Differential Revision: http://reviews.llvm.org/D4534 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213149 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16Added documentation on how clang diagnostics are reported by clang-tidy.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213147 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16[clang-tidy] Add a checker that warns on const string & members.Benjamin Kramer
Summary: Those are considered unsafe and should be replaced with simple pointers or full copies. It recognizes both std::string and ::string. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4522 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213133 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15Fix the diagnostic.cpp test to explicitly disable more google checksReid Kleckner
Imagine, hypothetically, that you had a build of clang-tidy that enabled the google-* checks by default. If you had such a binary, then this test would fail. Making it pass in that configuration isn't such a bad thing. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[clang-tidy] Add a checker that flags unnamed parameters.Benjamin Kramer
Summary: We still allow the escape hatch foo(int /*x*/) and also suggest this in a fixit. This is more powerful than the corresponding cpplint.py check it also flags functions with multiple arguments as naming all arguments is recommended by the google style guide. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4518 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213075 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[clang-tidy] extend make_pair test for fixits in template definitions.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213068 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[clang-tidy] Add a checker that flags all instances of overloaded unary ↵Benjamin Kramer
operator& This handles both methods and freestanding overloads. Differential Revision: http://reviews.llvm.org/D4498 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213067 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.NAKAMURA Takumi
I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213064 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[clang-tidy] Add a checker that removes deducible arguments from std::make_pairBenjamin Kramer
Those may be incompatible with C++11 and are unnecessary. We suggest removing the template arguments when they match the types of the make_pair arguments or replace it with std::pair and explicit template arguments when not. Differential Revision: http://reviews.llvm.org/D4497 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213058 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14Fix build when various clang feature flags are enabled/disabledAlp Toker
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212994 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14[clang-tidy] Add a checker for swapped arguments.Benjamin Kramer
This looks for swapped arguments by looking at implicit conversions of arguments void Foo(int, double); Foo(1.0, 3); // Most likely a bug git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212942 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14Set up clang-tidy diagnostic consumer to print types etc.Alexander Kornienko
Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4494 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212941 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14Suggest automated replacements of C-style casts with C++ casts.Alexander Kornienko
Summary: This patch implements a subset of possible replacements of C-style casts with const_cast/static_cast/reinterpret_cast. This should cover a large portion of cases in real code. Handling of a few more cases may be implemented eventually. Reviewers: sbenza, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4478 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212924 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14[CMake] Update libdeps.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14[CMake] Reorder libdeps by alphabetical order.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212919 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-12Fixed compilation errors in tests, enforce checking for errors in ↵Alexander Kornienko
check_clang_tidy_fix.sh. Reviewers: sbenza, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4480 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212876 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-11Modify the tests to use FileCheck -implicit-check-not option being proposed ↵Alexander Kornienko
in D4462 Reviewers: djasper, sbenza, bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4463 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212814 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-11Fixed the test to work with -implicit-check-not.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212811 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-11[clang-tidy] Add a checker for implicit bool conversion of a bool*.Benjamin Kramer
The goal is to find code like the example below, which is likely a typo where someone meant to write "if (*b)". bool *b = SomeFunction(); if (b) { // b never dereferenced } This checker naturally has a relatively high false positive rate so it applies some heuristics to avoid cases where the pointer is checked for nullptr before being written. Differential Revision: http://reviews.llvm.org/D4458 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212797 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10[doc] Fix incorrect reference to clang-format -> clang-tidyTobias Grosser
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212755 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09Removed the "-fix" suffix from tests that verify both fixes and messages.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212658 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09Check messages and fixes in the same test.Alexander Kornienko
Summary: This reduces duplication of test code and improves locality of checks. Reviewers: sbenza, djasper Reviewed By: sbenza, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4437 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212653 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09Delete removed formatting option.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08As funny as it might look, this wasn't what I intended to test.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212549 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08Use explicit if and restore lost FileCheck error code checking.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212546 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08[clang-tidy] Address review comments for the Twine checker.Benjamin Kramer
- Remove unused includes. - Minor wording fix. - Added support to check for clang-tidy messages to check_clang_tidy_fix.sh = Updated test case. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212540 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08[clang-tidy] Add a little checker for Twine locals in LLVM.Benjamin Kramer
Those often cause use after free bugs and should be generally avoided. Technically it is safe to have a Twine with >=2 components in a variable but I don't think it is a good pattern to follow. The almost trivial checker comes with elaborated fix-it hints that turn the Twine into a std::string if necessary and otherwise fall back to the original type if the Twine is created from a single value. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-06Update for llvm api change.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-06Track changes from clang r212387, r212388Alp Toker
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212390 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-05Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212367 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-04Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like ↵NAKAMURA Takumi
cygming. This makes unittests run with BUILD_SHARED_LIBS on DLL platforms. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-03clang-tidy: Instantiate llvm::Registry<clang::tidy::ClangTidyModule>.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212271 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-03clang-modernize: Instantiate llvm::Registry<TransformFactory>.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212270 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-02Consistently handle clang-tidy check names in ClangTidyError.Alexander Kornienko
Summary: This patch removes " [check-name]" from the end of ClangTidyMessage::Message. The " [check-name]" part is only appended when printing diagnostics on the console. Clang errors are now marked with "clang-diagnostic-error" check name, remarks and unknown warnings are marked with "clang-diagnostic-unknown". Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4356 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212180 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30Initialize ClangTidyMessage::FileOffset field to avoid unitialized variable ↵Alexander Kornienko
access when sorting errors on output. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212042 91177308-0d34-0410-b5e6-96231b3b80d8