Change the behavior of clang-tidy -checks=, remove -disable-checks.

Summary:
Make checks filtering more intuitive and easy to use. Remove
-disable-checks and change the format of -checks= to a comma-separated list of
globs with optional '-' prefix to denote exclusion. The -checks= option is now
cumulative, so it modifies defaults, not overrides them. Each glob adds or
removes to the current set of checks, so the filter can be refined or overriden
by adding globs.

Example:
  The default value for -checks= is
  '*,-clang-analyzer-alpha*,-llvm-include-order,-llvm-namespace-comment,-google-*',
  which allows all checks except for the ones named clang-analyzer-alpha* and
  others specified with the leading '-'. To allow all google-* checks one can
  write:
    clang-tidy -checks=google-* ...
  If one needs only google-* checks, we first need to remove everything (-*):
    clang-tidy -checks=-*,google-*
  etc.

I'm not sure if we need to change something here, so I didn't touch the docs
yet.

Reviewers: klimek, alexfh

Reviewed By: alexfh

Subscribers: cfe-commits

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

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208883 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed incorrect StringRef::find usage.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208898 91177308-0d34-0410-b5e6-96231b3b80d8
Initial version of clang-tidy check to use override instead of virual.

Review: http://reviews.llvm.org/D3688

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208954 91177308-0d34-0410-b5e6-96231b3b80d8
Update clang-tidy documentation.

Summary:
Updated the help message, updated description of -checks=, removed
mentions of -disable-checks.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208979 91177308-0d34-0410-b5e6-96231b3b80d8
clang-tidy/misc/UseOverride.cpp: Appease targeting msvc.

With IsLateTemplateParsed, FunctionDecl::doesThisDeclarationHaveABody() returns True regardless of Body.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208985 91177308-0d34-0410-b5e6-96231b3b80d8
Initializer list is unavailable. Use the constructor instead.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@208986 91177308-0d34-0410-b5e6-96231b3b80d8
Track clang changes from r209061

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209062 91177308-0d34-0410-b5e6-96231b3b80d8
Address review comments on r208954. No functional changes.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209111 91177308-0d34-0410-b5e6-96231b3b80d8
Improved llvm-namespace-comment check.

Summary:
Handle various forms of existing namespace closing comments, fix
existing comments with wrong namespace name, ignore short namespaces.

The state of this check now seems to be enough to enable it by default to gather
user feedback ;)

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209141 91177308-0d34-0410-b5e6-96231b3b80d8
Added a comment

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209146 91177308-0d34-0410-b5e6-96231b3b80d8
Fix clang-query on Windows: flush llvm::outs() after each command.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209313 91177308-0d34-0410-b5e6-96231b3b80d8
Add clang-tidy -line-filter option to filter findings by line ranges.

Summary:
This is going to be used for a clang-tidy-diff script to display
warnings in changed lines only. The option uses JSON, as its value is not
intended to be entered manually.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209450 91177308-0d34-0410-b5e6-96231b3b80d8
Update the code according to the changes in r209468.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209470 91177308-0d34-0410-b5e6-96231b3b80d8
clang-tidy: Only add 'override' before inlined bodies.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209505 91177308-0d34-0410-b5e6-96231b3b80d8
clang-tools-extra/test/clang-tidy/line-filter.cpp: Tweak line-filter.

On win32, %s is expanded to X:\path\to\test\line-filter.cpp. It was incompatible to yaml.
Although "%/s" could be available in Lit, ClangTidyDiagnosticConsumer::passesLineFilter() is unaware of comparision between '/' and '\\'.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209569 91177308-0d34-0410-b5e6-96231b3b80d8
ClangTidyOptionsTest.cpp: Rewrite literals. Raw string literals are unavailable on msc17.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209583 91177308-0d34-0410-b5e6-96231b3b80d8
Renamed runClangTidy argument Ranges to InputFiles, removed a TODO comment.
No functional changes.


git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209743 91177308-0d34-0410-b5e6-96231b3b80d8
Remove redundant check discovered in post-commit review of r209505.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209882 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Remove redundant check discovered in post-commit review of r209505."

This breaks with MSVC.
With IsLateTemplateParsed, FunctionDecl::doesThisDeclarationHaveABody() returns true regardless of Body.

This reinstates what was fixed in r208985.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209896 91177308-0d34-0410-b5e6-96231b3b80d8
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209953 91177308-0d34-0410-b5e6-96231b3b80d8