Commit Graph

689 Commits

Author SHA1 Message Date
Benjamin Kramer 3500845f07 Remove unused AST matcher.
llvm-svn: 216901
2014-09-02 09:46:43 +00:00
Benjamin Kramer fec6705db0 [clang-tidy] Don't suggest naming the dummy argument of a post-inc operator overload.
llvm-svn: 216868
2014-09-01 09:11:48 +00:00
Benjamin Kramer 041c138ba5 Try to fix test on msvc and 32 bit hosts.
llvm-svn: 216727
2014-08-29 14:47:30 +00:00
Benjamin Kramer 06e323a6ee [clang-tidy] Add a checker that suggests replacing short/long/long long with fixed-size types.
Differential Revision: http://reviews.llvm.org/D5119

llvm-svn: 216726
2014-08-29 14:38:46 +00:00
Benjamin Kramer e59cd6e6ff [clang-tidy] Don't suggest naming unnamed parameters on deleted/defaulted functions.
llvm-svn: 216718
2014-08-29 08:58:35 +00:00
Craig Topper ae926ad24d Remove call to llvm::makeArrayRef. Implicit conversion is sufficient.
llvm-svn: 216711
2014-08-29 06:05:20 +00:00
David Blaikie 715c98aeec Update for Clang API change.
llvm-svn: 216615
2014-08-27 20:54:50 +00:00
Rafael Espindola 7fa030330c Update for LLVM api change.
llvm-svn: 216584
2014-08-27 20:03:22 +00:00
Ted Kremenek 4d1692f613 Adjust call 'CreateAnalysisConsumer' due to API tweak.
llvm-svn: 216551
2014-08-27 15:14:47 +00:00
Craig Topper 2f020e5497 Simplify creation of a couple ArrayRefs by using None and makeArrayRef.
llvm-svn: 216529
2014-08-27 06:29:07 +00:00
Benjamin Kramer d5fef8198b [clang-tidy] If we're going to change the header guard in the #endif comment
we can also fix the original header guard.

We still allow an _ at the end of a header guard since it's so common, but
remove it now when the #endif comment is changed.

llvm-svn: 216462
2014-08-26 16:28:35 +00:00
Rafael Espindola b14bd53e6d Update for LLVM api change
llvm-svn: 216396
2014-08-25 18:17:00 +00:00
Benjamin Kramer 208faaaa29 [clang-tidy] Allow /**/ comments on #endifs when checking header guards.
Turning block comments into line comments just creates unecessary churn.

llvm-svn: 216072
2014-08-20 16:01:42 +00:00
Manuel Klimek de23726dbd Revert rL215947: "[clang-rename] revert r215839"
Make tests not depend on grep supporting -bo.

llvm-svn: 216041
2014-08-20 01:39:05 +00:00
Gerolf Hoflehner 62bf7e83cb [clang-rename] revert r215839
The commit broke public build bots for more than 24 hours.

(view as text)
******************** TEST 'Clang Tools :: clang-rename/VarTest.cpp' FAILED ********************
Script:
--
cat /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp > /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp
clang-rename -offset=$(grep -FUbo 'foo;' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | head -1 | cut -d: -f1) -new-name=hector /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp -i --
sed 's,//.*,,' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp
--
Exit Code: 1

Command Output (stderr):
--
clang-rename: could not find symbol at /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp:2:1 (offset 14).

llvm-svn: 215947
2014-08-18 23:03:30 +00:00
NAKAMURA Takumi 8fad914691 [CMake] clang-rename: Optimize libdeps.
llvm-svn: 215935
2014-08-18 20:49:18 +00:00
NAKAMURA Takumi d5a96a794e Add trailing linefeed.
llvm-svn: 215934
2014-08-18 20:49:09 +00:00
NAKAMURA Takumi b7b2e4cba0 Revert r215854 corresponding to r215857, "Suppress ClangRenameTests/USRLocFinding.FindsVarUSR on msc17 for now. Will fix later."
llvm-svn: 215859
2014-08-17 22:45:29 +00:00
Manuel Klimek 57ba55cbc3 Remove initializer list.
llvm-svn: 215857
2014-08-17 22:24:10 +00:00
NAKAMURA Takumi 976e3e8693 Suppress ClangRenameTests/USRLocFinding.FindsVarUSR on msc17 for now. Will fix later.
llvm-svn: 215854
2014-08-17 22:17:11 +00:00
Manuel Klimek 639557ae86 Fix link libraries for clang-rename.
llvm-svn: 215843
2014-08-17 18:33:24 +00:00
Manuel Klimek 52d23d4cee Remove mention of non-existent 'test' directory.
llvm-svn: 215840
2014-08-17 18:17:41 +00:00
Manuel Klimek ccf0d79724 First version of a clang-rename tool.
Summary:
Note that this code is still grossly under-tested - the next steps will
be to add significantly better test coverage.

Patch by Matthew Plant.

Test Plan:

Reviewers:

Subscribers:

llvm-svn: 215839
2014-08-17 18:00:59 +00:00
Alexander Kornienko 08cc55dbe9 AvoidCStyleCastsCheck: don't warn on casts in macros
llvm-svn: 215799
2014-08-16 00:53:20 +00:00
NAKAMURA Takumi 15fb86c4e6 ClangTidyTests: Suppress FixHeaderGuards on win32 for now.
FIXME: It seems this might be incompatible to dos path. Investigating.
llvm-svn: 215590
2014-08-13 22:12:38 +00:00
NAKAMURA Takumi c54e6e833e [CMake] Update libdeps in clangTidyLLVMModule.
llvm-svn: 215589
2014-08-13 22:12:28 +00:00
Benjamin Kramer cc5366c07a In ancient times build targets had to be sorted topologically. Sometimes this behavior can still be observed today.
llvm-svn: 215553
2014-08-13 14:41:24 +00:00
Benjamin Kramer 5eddaac17f Fix linking in the Makefile build.
llvm-svn: 215550
2014-08-13 14:14:38 +00:00
Benjamin Kramer 498cce575f [clang-tidy] Add a generic header guard checker + LLVM implementation.
The implementation is split into a generic part and a LLVM-specific part.
Other codebases can implement it with their own style. The specific features
supported are:

- Verification (and fixing) of header guards against a style based on the file path
- Automatic insertion of header guards for headers that are missing them
- A warning when the header guard doesn't enable our fancy header guard optimization
(e.g. when there's an include preceeding the guard)
- Automatic insertion of a comment with the guard name after #endif.

For the LLVM style we disable #endif comments for now, they're not very common
in the codebase. We also only flag headers in the include directories, there
doesn't seem to be a common style outside.

Differential Revision: http://reviews.llvm.org/D4867

llvm-svn: 215548
2014-08-13 13:57:57 +00:00
Benjamin Kramer 87cc652651 Try to unbreak the Makefile build.
llvm-svn: 215545
2014-08-13 13:20:04 +00:00
Benjamin Kramer b4e7c9b211 Also run extra tools unit tests in shared library builds.
Took me way too long to figure out why they didn't run.

llvm-svn: 215543
2014-08-13 12:54:50 +00:00
Samuel Benzaquen d7349439d5 [clang-query] Use the new API for named values from the Parser.
Summary: This finishes the support for autocomplete for user defined values..

Reviewers: pcc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4851

llvm-svn: 215474
2014-08-12 21:22:58 +00:00
Rafael Espindola ee8155d01a Update for API change in clang.
llvm-svn: 215452
2014-08-12 16:01:34 +00:00
Benjamin Kramer 242b5b808b [clang-tidy] Disable the warning on implicit bool* to bool conversion in macros.
It's just too noisy and the warning isn't very helpful in those cases.

llvm-svn: 215439
2014-08-12 12:12:57 +00:00
Benjamin Kramer 6318f7614f Allow specifying file names and extra arguments when running clang-tidy unit tests.
Will become useful soon.

llvm-svn: 215438
2014-08-12 12:12:54 +00:00
David Blaikie dffd853716 Update for API change in r215391
llvm-svn: 215392
2014-08-11 22:11:02 +00:00
David Blaikie 680c4c898c Recommit 213308: unique_ptr-ify ownership of ASTConsumers (reverted in r213324)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.

llvm-svn: 215324
2014-08-10 19:56:59 +00:00
David Blaikie 590e5ff473 clang-modernize: Transform::createActionFactory return ownership by unique_ptr instead of raw pointer.
Follow up to r213851 to simplify code and reduce the chance of future
leaks.

llvm-svn: 215214
2014-08-08 16:06:07 +00:00
Benjamin Kramer b41c91c389 [clang-tidy] Don't index past the end of a vector.
We actually want the end iterator so just replace it with iterator arithmetic.

llvm-svn: 215195
2014-08-08 10:43:11 +00:00
Alexander Kornienko 05cb0bb55e Reverting to Rui's last version, as it actually works both in Darwin and in Linux
llvm-svn: 215192
2014-08-08 08:49:19 +00:00
Alexander Kornienko b0b08a0cca Closing the loop. Now this sed invocation is back to what it was before the attempts to 'improve' it.
llvm-svn: 215189
2014-08-08 08:20:55 +00:00
NAKAMURA Takumi 274a845e00 Suppress clang-tools-extra/test/clang-tidy/llvm-include-order.cpp for targeting msvc. Investigating.
FYI, I can see the order;

  #include "j.h"
  #include "i.h"
  #include "clang-c/c.h" // hi
  #include "clang/b.h"
  #include "llvm-c/d.h" // -c
  #include "llvm/a.h"
  #include "gtest/foo.h"
  #include <s.h>

llvm-svn: 215179
2014-08-08 02:01:42 +00:00
Rui Ueyama 161b7fd1e1 [clang-tidy] Fix sed flag, third try
llvm-svn: 215175
2014-08-08 00:19:22 +00:00
Rui Ueyama 9080920ded [clang-tidy] Fix sed flag again
Darwin's sed does not recognize -r to tell the tool that the
expression is the extended regexp. Seems we don't really need
the flag, as the expression is valid as the standard regexp.
Removing the flag.

llvm-svn: 215171
2014-08-07 23:33:38 +00:00
Rui Ueyama 76e8af88b8 [clang-tidy] Fix sed flag.
GNU sed does not recognize -E. Use -r that is supported by
both BSD and GNU instead.

llvm-svn: 215163
2014-08-07 22:55:39 +00:00
Benjamin Kramer d16a8c4898 [clang-tidy] Implement the include order checker for LLVM.
There are still a couple of rough edges in here but it is working fine
on LLVM and generates the same results as sort_includes.py if there are
no blank lines involved.

Differential Revision: http://reviews.llvm.org/D4741

llvm-svn: 215152
2014-08-07 21:49:38 +00:00
Alexander Kornienko b3d331d18d Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
Summary:
Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
It's a rather generic way to represent sets of strings (or patterns), so it may
be used for something else in ClangTidy. The new name would not look strange
when used to filter other entities.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4806

llvm-svn: 214961
2014-08-06 11:49:10 +00:00
Alexander Kornienko bc9f9928b7 check_clang_tidy_fix.sh: added comments, use set -o errexit instead of '|| exit $?' on each command
llvm-svn: 214956
2014-08-06 10:17:55 +00:00
Benjamin Kramer 6fd227c9ad [clang-tidy] forward arguments of the testing script to clang-tidy.
llvm-svn: 214952
2014-08-06 08:19:30 +00:00
Benjamin Kramer a5d954b187 [clang-tidy] Simplify ast matcher.
Turns out there is a better way to do this. No functionality change.

llvm-svn: 214874
2014-08-05 15:33:46 +00:00