Commit Graph

697 Commits

Author SHA1 Message Date
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
Benjamin Kramer f5847cf84c [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.

llvm-svn: 214705
2014-08-04 10:11:47 +00:00
Benjamin Kramer 78cd5465f7 [clang-tidy] Fix unnamed parameter comment insertion with multiple parameters.
llvm-svn: 214703
2014-08-04 09:42:18 +00:00
Benjamin Kramer 610ba533d0 [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

llvm-svn: 214701
2014-08-04 09:33:58 +00:00
Alexander Kornienko da2734d4d0 Changed tool-template to use CommonOptionsParser.
Reviewers: pcc, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 214621
2014-08-02 08:24:10 +00:00
Alexander Kornienko 228dda5ac5 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

llvm-svn: 214607
2014-08-02 01:02:33 +00:00
Benjamin Kramer 1188792480 [clang-tidy] Add a checker for code that looks like a delegate constructors but doesn't delegate.
Summary:
class Foo {
  Foo() {
    Foo(42); // oops
  }
  Foo(int);
};

This is valid code but it does nothing and we can't emit a warning in clang
because there might be side effects. The checker emits a warning for this
pattern and also for base class initializers written in this style.

There is some overlap with the unused-rtti checker but they follow different
goals and fire in different places most of the time.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 214397
2014-07-31 09:58:52 +00:00
Alexander Kornienko 326e48cd09 Don't warn on NewCallback argument comments, as they are arguments for the
function the callback points to.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 214307
2014-07-30 14:31:36 +00:00
Daniel Jasper 2d9e0b782c clang-tidy: [use-override] Tweak messages.
It doesn't make sense to suggest 'virtual' as clang-tidy would complain
about that on the next iteration (we are never issuing warnings for the
base function).

llvm-svn: 214063
2014-07-28 07:29:29 +00:00
Benjamin Kramer 6e9142474d Plug memory leaks.
Most of the changes are mechanic std::unique_ptr insertions. All leaks were
detected by LeakSanitizer.

llvm-svn: 213851
2014-07-24 10:23:33 +00:00
Benjamin Kramer c1730e9bb9 [clang-tidy] Fix a heap use-after-free bug detected by asan.
llvm-svn: 213845
2014-07-24 08:34:42 +00:00
Benjamin Kramer 4ff1ffa1ce Add the fix that should've accompanied r213738.
llvm-svn: 213740
2014-07-23 11:50:54 +00:00
Benjamin Kramer d025f90c99 check_clang_tidy_fix.sh: Fail immediately if clang-tidy crashes.
Otherwise we'll get confusing messages from FileCheck instead of seeing the real issue.

llvm-svn: 213739
2014-07-23 11:49:49 +00:00
Benjamin Kramer da3658e2b7 Reapply r213647 with a fix.
ASTMatchers currently have problems mixing bound TypeLoc nodes with Decl/Stmt
nodes. That should be fixed soon but for this checker there we only need the
TypeLoc to generate a fixit so postpone the potentially heavyweight AST walking
until after we know that we're going to emit a warning.

This is covered by existing test cases.

Original message:
[clang-tidy] Add a check for RAII temporaries.

This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
  {
    scoped_lock(&global_mutex);
    critical_section();
  }

This checker will have false positives if someone uses this pattern
to legitimately invoke a destructor immediately (or the statement is
at the end of a scope anyway). To reduce the number we ignore this
pattern in macros (this is heavily used by gtest) and ignore objects
with no user-defined destructor.

llvm-svn: 213738
2014-07-23 11:49:46 +00:00
Richard Smith a714469d02 Revert r213647; the added test triggers an assertion.
llvm-svn: 213722
2014-07-23 04:13:00 +00:00
Benjamin Kramer 8ca8651171 [clang-tidy] Add a check for RAII temporaries.
Summary:
This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
  {
    scoped_lock(&global_mutex);
    critical_section();
  }

This checker will have false positives if someone uses this pattern
to legitimately invoke a destructor immediately (or the statement is
at the end of a scope anyway). To reduce the number we ignore this
pattern in macros (this is heavily used by gtest) and ignore objects
with no user-defined destructor.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

llvm-svn: 213647
2014-07-22 12:30:35 +00:00
Benjamin Kramer ddf36dea13 [clang-tidy] Fix a false positive in the make_pair checker if an argument 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.

llvm-svn: 213509
2014-07-21 09:40:52 +00:00
Daniel Jasper 58ed9c9167 clang-tidy: [misc-use-override] Slightly tweak the wording of warning.
'final' should really be used with care.

llvm-svn: 213501
2014-07-21 06:06:38 +00:00
David Blaikie 5bae2c87d5 Revert "unique_ptr-ify ownership of ASTConsumers"
This reverts commit r213308.

Reverting to have some on-list discussion/confirmation about the ongoing
direction of smart pointer usage in the LLVM project.

llvm-svn: 213324
2014-07-17 22:33:56 +00:00
David Blaikie b9574aceae unique_ptr-ify ownership of ASTConsumers
llvm-svn: 213308
2014-07-17 20:40:47 +00:00
Alexander Kornienko 834609d80b Make the diagnostic message more complete to check the check name.
llvm-svn: 213245
2014-07-17 10:05:26 +00:00
Benjamin Kramer 01f5686298 [clang-tidy] MemsetZeroLenghtChecker: Don't crash trying to evaluate dependent values.
llvm-svn: 213238
2014-07-17 08:56:55 +00:00
Benjamin Kramer 1f14262720 [clang-tidy] Provide links to the google style guide for checks derived from it.
llvm-svn: 213233
2014-07-17 08:23:24 +00:00
Alp Toker e208dfc2af Track clang r213171
The clang rewriter is now a core facility.

llvm-svn: 213172
2014-07-16 16:50:17 +00:00
Benjamin Kramer 806bcabcda [clang-tidy] As a simple heuristic don't emit a swap fixit that would create
negative-sized memsets.

memset(x, -1, 0) is still useless but swapping makes no sense here. Just emit
a warning.

llvm-svn: 213157
2014-07-16 14:52:07 +00:00
Benjamin Kramer d6a499077a [clang-tidy] Also emit a warning for memset(x, 0, 0)
It doesn't make sense to suggest swapping the arguments here but it's
still useless code

llvm-svn: 213156
2014-07-16 14:42:43 +00:00
Benjamin Kramer ebab1500e0 [clang-tidy] Add a checker for zero-length memset.
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

llvm-svn: 213155
2014-07-16 14:30:19 +00:00
Benjamin Kramer 2252cbf4e8 [clang-tidy] Add namespaces checkers.
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

llvm-svn: 213153
2014-07-16 14:16:56 +00:00
Alexander Kornienko 1f317d6c05 Avoid adding redundant parens.
Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, sbenza

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

llvm-svn: 213149
2014-07-16 13:38:48 +00:00
Alexander Kornienko c5ac729131 Added documentation on how clang diagnostics are reported by clang-tidy.
llvm-svn: 213147
2014-07-16 13:26:51 +00:00
Benjamin Kramer b1039759fb [clang-tidy] Add a checker that warns on const string & members.
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

llvm-svn: 213133
2014-07-16 10:00:14 +00:00
Reid Kleckner 230660cf21 Fix the diagnostic.cpp test to explicitly disable more google checks
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.

llvm-svn: 213085
2014-07-15 18:52:34 +00:00
Benjamin Kramer 14d42d9d1e [clang-tidy] Add a checker that flags unnamed parameters.
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

llvm-svn: 213075
2014-07-15 16:47:09 +00:00
Benjamin Kramer 2b584f3cab [clang-tidy] extend make_pair test for fixits in template definitions.
llvm-svn: 213068
2014-07-15 13:11:49 +00:00
Benjamin Kramer feff134142 [clang-tidy] Add a checker that flags all instances of overloaded unary operator&
This handles both methods and freestanding overloads.

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

llvm-svn: 213067
2014-07-15 12:48:14 +00:00
NAKAMURA Takumi 04b8b37f56 Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.
I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill.

llvm-svn: 213064
2014-07-15 11:37:03 +00:00
Benjamin Kramer 47c4d101e0 [clang-tidy] Add a checker that removes deducible arguments from std::make_pair
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

llvm-svn: 213058
2014-07-15 09:50:32 +00:00
Alp Toker 6462e9e695 Fix build when various clang feature flags are enabled/disabled
llvm-svn: 212994
2014-07-14 22:15:29 +00:00
Benjamin Kramer 082bf7f637 [clang-tidy] Add a checker for swapped arguments.
This looks for swapped arguments by looking at implicit conversions of arguments

void Foo(int, double);
Foo(1.0, 3); // Most likely a bug

llvm-svn: 212942
2014-07-14 14:24:30 +00:00
Alexander Kornienko ad21688625 Set up clang-tidy diagnostic consumer to print types etc.
Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits

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

llvm-svn: 212941
2014-07-14 14:10:03 +00:00
Alexander Kornienko 7366616a93 Suggest automated replacements of C-style casts with C++ casts.
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

llvm-svn: 212924
2014-07-14 07:37:05 +00:00
NAKAMURA Takumi 23b702c8de [CMake] Update libdeps.
llvm-svn: 212920
2014-07-14 05:01:53 +00:00
NAKAMURA Takumi 4a070dc428 [CMake] Reorder libdeps by alphabetical order.
llvm-svn: 212919
2014-07-14 04:59:27 +00:00
Alexander Kornienko 2ff9541eaa Fixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fix.sh.
Reviewers: sbenza, djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 212876
2014-07-12 13:16:58 +00:00
Alexander Kornienko a2c4950e6e Modify the tests to use FileCheck -implicit-check-not option being proposed in D4462
Reviewers: djasper, sbenza, bkramer

Reviewed By: bkramer

Subscribers: cfe-commits

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

llvm-svn: 212814
2014-07-11 13:44:51 +00:00
Alexander Kornienko b666eee1c8 Fixed the test to work with -implicit-check-not.
llvm-svn: 212811
2014-07-11 12:54:51 +00:00
Benjamin Kramer 1c8b31753b [clang-tidy] Add a checker for implicit bool conversion of a bool*.
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

llvm-svn: 212797
2014-07-11 08:08:47 +00:00
Tobias Grosser 0fcf3cce2b [doc] Fix incorrect reference to clang-format -> clang-tidy
llvm-svn: 212755
2014-07-10 18:59:25 +00:00
Alexander Kornienko 47d7ae9875 Removed the "-fix" suffix from tests that verify both fixes and messages.
llvm-svn: 212658
2014-07-09 21:21:39 +00:00
Alexander Kornienko af9ccfad87 Check messages and fixes in the same test.
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

llvm-svn: 212653
2014-07-09 21:09:26 +00:00
Daniel Jasper 616f58b5c6 Delete removed formatting option.
llvm-svn: 212593
2014-07-09 08:18:31 +00:00
Benjamin Kramer a054343415 As funny as it might look, this wasn't what I intended to test.
llvm-svn: 212549
2014-07-08 16:42:54 +00:00
Benjamin Kramer 5fc40fe28c Use explicit if and restore lost FileCheck error code checking.
llvm-svn: 212546
2014-07-08 16:15:48 +00:00
Benjamin Kramer ee58721875 [clang-tidy] Address review comments for the Twine checker.
- Remove unused includes.
- Minor wording fix.
- Added support to check for clang-tidy messages to check_clang_tidy_fix.sh
= Updated test case.

llvm-svn: 212540
2014-07-08 15:41:20 +00:00
Benjamin Kramer 190e2cfd74 [clang-tidy] Add a little checker for Twine locals in LLVM.
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.

llvm-svn: 212535
2014-07-08 14:32:17 +00:00
Rafael Espindola 43f0aa6caf Update for llvm api change.
llvm-svn: 212406
2014-07-06 17:43:19 +00:00
Alp Toker 06164dd854 Track changes from clang r212387, r212388
llvm-svn: 212390
2014-07-06 05:29:14 +00:00
Alp Toker 573583e2f2 Track IntrusiveRefCntPtr::get() changes from LLVM r212366
llvm-svn: 212367
2014-07-05 03:04:33 +00:00
NAKAMURA Takumi b52c761a3c Let test/Unit/lit.cfg add config.shlibdir to $PATH on DLL platforms like cygming.
This makes unittests run with BUILD_SHARED_LIBS on DLL platforms.

llvm-svn: 212316
2014-07-04 05:11:55 +00:00
NAKAMURA Takumi 71b982b41f clang-tidy: Instantiate llvm::Registry<clang::tidy::ClangTidyModule>.
llvm-svn: 212271
2014-07-03 14:12:47 +00:00
NAKAMURA Takumi 3dd23a337c clang-modernize: Instantiate llvm::Registry<TransformFactory>.
llvm-svn: 212270
2014-07-03 14:12:37 +00:00
Alexander Kornienko 742790cd9f Consistently handle clang-tidy check names in ClangTidyError.
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

llvm-svn: 212180
2014-07-02 15:05:04 +00:00
Alexander Kornienko 94a656477d Initialize ClangTidyMessage::FileOffset field to avoid unitialized variable access when sorting errors on output.
llvm-svn: 212042
2014-06-30 14:29:03 +00:00
Alexander Kornienko e3b7839bfc Added a comment to document relation of this check to -Wold-style-cast.
llvm-svn: 212033
2014-06-30 09:54:12 +00:00
Alexander Kornienko 276fc642d3 Another attempt to add a clang-tidy check for flagging C-style casts.
Summary:
The first version failed the SubstNonTypeTempateParmExpr-related test
on some buildbots. This one uses the new substNonTypeTempateParmExpr matcher to
filter out implicit C-style casts.

This patch depends on D4327.

Reviewers: djasper

Reviewed By: djasper

Subscribers: aemerson, cfe-commits

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

llvm-svn: 212002
2014-06-29 22:19:53 +00:00
NAKAMURA Takumi 360096e701 Make clang-tidy-diff.py py3-compatible.
llvm-svn: 211834
2014-06-27 01:10:18 +00:00
NAKAMURA Takumi 25dadfd2a8 Suppress clang-tools-extra/test/clang-tidy/clang-tidy-diff.cpp on win32 due to dos path issue.
I'll fix it later.

llvm-svn: 211831
2014-06-27 00:55:16 +00:00
Alexander Kornienko 47e8e72a80 Make the clang-tidy-diff.py test conditional on the presence of Python 2.7. Use the python binary from the configuration.
llvm-svn: 211789
2014-06-26 16:32:26 +00:00
NAKAMURA Takumi 2d8dcc5bd1 Suppress clang-tidy-diff.py. It is incompatible to py26 due to argparse.
llvm-svn: 211741
2014-06-25 23:13:34 +00:00
Alexander Kornienko cd11179374 Rolling back, as the test fails on one of the buildbots:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/13505/steps/check-all/logs/Clang%20Tools%3A%3Ac-style-casts.cpp

llvm-svn: 211708
2014-06-25 15:33:35 +00:00
Alexander Kornienko a9b7ec18f1 Apparently, some versions of diff like -U0 more than -u0.
llvm-svn: 211703
2014-06-25 14:56:58 +00:00
Alexander Kornienko 73ba424506 Add a check to flag the usage of C-style casts (Google Style).
Summary:
Add a check to flag the usage of C-style casts, as per Google Style
Guide:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Casting#Casting

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 211702
2014-06-25 14:52:44 +00:00
Alexander Kornienko 1de35e719f Add clang-tidy-diff.py script to run clang-tidy and display warnings on changed lines only.
Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 211698
2014-06-25 14:09:52 +00:00
Alp Toker b5fbfa2bab Track changes from clang r211448.
llvm-svn: 211450
2014-06-21 23:33:00 +00:00
Daniel Jasper 024ebf4a65 clang-tidy: [misc-use-override] Correctly handle defaulted destructors.
Also, minor implementation and test fixes.

llvm-svn: 211345
2014-06-20 09:12:46 +00:00
David Blaikie 92fc741998 Unbreak the build after r211244.
These operator overloads were unneeded (once the const correctness in
PooledStringPtr was corrected) and inefficient (since the strings are
pooled the pointers can just be compared for equality instead of doing
strcmp).

llvm-svn: 211245
2014-06-19 00:43:19 +00:00
Alexander Kornienko 72f1e754a7 Move google-explicit-constructor check to a separate source file.
Summary: No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 211154
2014-06-18 09:33:46 +00:00
Rafael Espindola c7f0d23f56 Prefix error_code with std.
llvm-svn: 210840
2014-06-12 22:08:48 +00:00
Rafael Espindola 002840cf66 Quick build fix.
llvm-svn: 210838
2014-06-12 22:01:48 +00:00
Rafael Espindola fd85bb3424 include system_error directly.
llvm-svn: 210797
2014-06-12 16:53:02 +00:00
Rafael Espindola 15c5784d3c Replace llvm::error_code with std::error_code.
llvm-svn: 210776
2014-06-12 13:32:11 +00:00
Alexander Kornienko 3095b420f4 A follow-up to r210260: updated a comment. No functional changes.
llvm-svn: 210767
2014-06-12 11:25:45 +00:00
Alp Toker f77acce059 Track clang changes from r210758
llvm-svn: 210759
2014-06-12 10:16:11 +00:00
Rafael Espindola d9ba837bfd Use generic_category from the std namespace.
llvm-svn: 210735
2014-06-12 01:57:33 +00:00
Daniel Jasper 05bdb09da1 clang-tidy: [use-override] Remove 'override' if 'final' is also present.
Also, make warning more precise by distinguishing different cases.

llvm-svn: 210651
2014-06-11 12:18:24 +00:00
Alp Toker 9d63b5eb7f Prospective build fix following clang r210518
llvm-svn: 210521
2014-06-10 09:58:45 +00:00
Craig Topper 6014c49921 Simplify code. No functional change.
llvm-svn: 210508
2014-06-10 04:50:50 +00:00
Craig Topper f61be9c971 [C++11] Use 'nullptr'.
llvm-svn: 210447
2014-06-09 02:03:06 +00:00
Alexander Kornienko a46952221e Allow per-file clang-tidy options.
Summary:
This patch makes it possible for clang-tidy clients to provide
different options for different translation units. The option, which doesn't
make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions
struct. Added parsing of ClangTidyOptions.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 210260
2014-06-05 13:31:45 +00:00
Daniel Jasper c0a3fa977d clang-tidy: Make use-override tests stricter.
As per post review comment.

llvm-svn: 210173
2014-06-04 08:47:25 +00:00
Daniel Jasper 0ab7902755 clang-tidy use override: Don't generate incorrect warnings without fixes
Add basic testing for the emitted diagnostics.

llvm-svn: 210171
2014-06-04 08:26:02 +00:00
Alp Toker f88da971e5 Remove inclusions of LLVM's private config.h
llvm-svn: 210146
2014-06-04 03:34:26 +00:00
Rafael Espindola f145137516 Don't assume an implicit error_code -> bool operator.
llvm-svn: 210070
2014-06-03 04:40:55 +00:00