The check failed, 'Cla *C = new Cla();' was renamed to 'D *C = new Cla();'.
Reviewers: klimek
Differential Revision: http://reviews.llvm.org/D20635
llvm-svn: 271572
Summary: added PathConfig.cpp and use includer of .inc header to be the file path of a symbol from .inc header.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20855
llvm-svn: 271385
Summary:
And some improvements:
* Show better error messages on unfound symbols.
* Fix a typo.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20827
llvm-svn: 271382
This sorts based on the popularity of the header, not the symbol. If
there are mutliple matching symbols in one header we take the maximum
popularity for that header and deduplicate. If we know nothing we sort
lexicographically based on the header path.
Differential Revision: http://reviews.llvm.org/D20814
llvm-svn: 271283
Summary: [include-fixer] use tooling::Replacements since the order of replacements don't matter anymore.
Differential Revision: http://reviews.llvm.org/D20813
llvm-svn: 271279
Summary:
* Abstract the DB setting code to a function.
* Remove the unused FallbackStyle.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20808
llvm-svn: 271273
Summary:
[include-fixer] collect the number of times a symbols is found in an
indexing run and use it for symbols popularity ranking.
Reviewers: bkramer
Subscribers: cfe-commits, hokein, djasper
Differential Revision: http://reviews.llvm.org/D20804
llvm-svn: 271268
Summary:
Some changes in the patch:
* Add two commandline flags in clang-include-fixer.
* Introduce a IncludeFixerContext for the queried symbol.
* Pull out CreateReplacementsForHeader.
Reviewers: bkramer
Subscribers: klimek, cfe-commits, ioeric
Differential Revision: http://reviews.llvm.org/D20621
llvm-svn: 271258
Summary:
Also trigger the check in the following case:
void foo() {
ExpensiveToCopy Obj;
const auto UnnecessaryCopy = Obj.constReference();
Obj.onlyUsedAsConst();
}
i.e. when the object the method is called on is not const but is never
modified.
Reviewers: alexfh, fowles
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20010
llvm-svn: 271239
Summary:
The `getName()` call is useless. It's better to show a better example
as tutorial.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20766
llvm-svn: 271207
Summary:
We should check whether a UsingDecl is defined in macros or in class
definition, not TargetDecls of the UsingDecl.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20666
llvm-svn: 271199
Summary:
Use a recursive visitor instead of forEachDescendant() matcher.
The latter requires several layers of virtual function calls for each node and
it is more expensive than the visitor.
Benchmark results show improvement of ~6% walltime in clang-tidy.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20597
llvm-svn: 270714
Summary: [include-fixer] moved STLPostfixMap into findAllSymbols library and make it a static variable in function.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D20619
llvm-svn: 270696
Modified the clang-tidy PassByValue check. It now stops adding std::move to type which is trivially copyable because that caused the clang-tidy MoveConstArg to complain and revert, thus creating a cycle.
I have also added a lit-style test to verify the bugfix.
This is the bug on bugzilla: https://llvm.org/bugs/show_bug.cgi?id=27731
This is the code review on phabricator: http://reviews.llvm.org/D20365
llvm-svn: 270565