Use CommonOptionsParser in clang-query. This fixes its support of the fixed
compilation database and makes it behave consistently with other clang tools.

Reviewers: klimek, pcc

Reviewed By: pcc

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214607 91177308-0d34-0410-b5e6-96231b3b80d8
Changed tool-template to use CommonOptionsParser.

Reviewers: pcc, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214621 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Make the named parameter check only warn on declarations if a definition is visible.

Summary:
This allows us to copy the parameter name from the definition (as a comment)
or insert /*unused*/ in both places.

Reviewers: alexfh, klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214701 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Fix unnamed parameter comment insertion with multiple parameters.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214703 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Rewrite a for-range loop in the old style.

Haven't thought that I ever needed to do this, but in this case comparing the
index using pointer arithmetic turns out to be really ugly. It also generates
nasty sign-compare warnings on 32 bit targets.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214705 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Simplify ast matcher.

Turns out there is a better way to do this. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214874 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] forward arguments of the testing script to clang-tidy.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214952 91177308-0d34-0410-b5e6-96231b3b80d8
check_clang_tidy_fix.sh: added comments, use set -o errexit instead of '|| exit $?' on each command

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214956 91177308-0d34-0410-b5e6-96231b3b80d8
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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214961 91177308-0d34-0410-b5e6-96231b3b80d8
[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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215152 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Fix sed flag.

GNU sed does not recognize -E. Use -r that is supported by
both BSD and GNU instead.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215163 91177308-0d34-0410-b5e6-96231b3b80d8
[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.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215171 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Fix sed flag, third try



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215175 91177308-0d34-0410-b5e6-96231b3b80d8
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>

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215179 91177308-0d34-0410-b5e6-96231b3b80d8
Closing the loop. Now this sed invocation is back to what it was before the attempts to 'improve' it.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215189 91177308-0d34-0410-b5e6-96231b3b80d8
Reverting to Rui's last version, as it actually works both in Darwin and in Linux

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215192 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Don't index past the end of a vector.

We actually want the end iterator so just replace it with iterator arithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215195 91177308-0d34-0410-b5e6-96231b3b80d8
Updating branches/google/stable to r215195

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/google/stable@215509 91177308-0d34-0410-b5e6-96231b3b80d8