There is still more parallelism to get here because we synchonize on the
actual uniquing but just doing YAML parsing in parallel already gives a
significant speedup.
Merging all symbols in LLVM+clang+compiler-rt+lld+libc++, 48 cores.
before: 201.55s user 1.47s system 99% cpu 3:23.04 total
after: 276.99s user 7.63s system 838% cpu 33.947 total
Differential Revision: http://reviews.llvm.org/D19720
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268037 91177308-0d34-0410-b5e6-96231b3b80d8
If multiple find-all-symbols processes access the temporary directory
simultaneously with two files with the same name they would collide and
create a broken yaml file. Fix this by using the safe createUniqueFile
API from LLVM instead.
Differential Revision: http://reviews.llvm.org/D19717
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268021 91177308-0d34-0410-b5e6-96231b3b80d8
In file included from symbol.cc:1:
symbols.h:2:24: error: typedef redefinition with different types ('unsigned int'
vs 'unsigned long long')
typedef unsigned size_t;
^
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267841 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
The find-all-symbols tool generates a yaml symbol database for
include-fixer.
The symbol matcher is originally written by Xiaoyi Liu.
Reviewers: bkramer, djasper
Subscribers: cfe-commits, klimek, ioeric
Differential Revision: http://reviews.llvm.org/D19482
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267719 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: Fixed a crash in cppcoreguidelines-pro-type-member-init when encountering a type that uses one of its template parameters as a base when compiling for C++98.
Patch by Michael Miller!
Reviewers: aaron.ballman, alexfh, hokein
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19539
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267700 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This checker finds redundant expression on both side of a binary operator.
The current implementation provide a function to check whether expressions
are equivalent. This implementation is able to recognize the common
subset encounter in C++ program. Side-effects like "x++" are not considered
to be equivalent.
There are many False Positives related to macros and to floating point
computations (detecting NaN). The checker is ignoring these cases.
Example:
```
if( !dst || dst->depth != desired_depth ||
dst->nChannels != desired_num_channels ||
dst_size.width != src_size.width ||
dst_size.height != dst_size.height ) <<--- bug
{
```
Reviewers: alexfh
Subscribers: danielmarjamaki, fahlgren, jordan_rose, zaks.anna, Eugene.Zelenko, cfe-commits
Differential Revision: http://reviews.llvm.org/D19451
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267574 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
The checker was noisy when running over llvm code base.
This patch is impriving the way string-compare functions are matched.
1) By default, do not report !strcmp(...) unless it's activate by the user,
2) Only match suspicious expression over a subset of expression (binary operator),
3) Added matching of macro wrapper used with clang on linux.
See bug: 27465.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19497
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267570 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
For folds (e.g. std::accumulate), check matches between the provided init value and the range's value_type. A typical error is "std::accumulate(begin, end, 0);", where begin and end have float value_type. See the documentation for more examples.
For now we check std::accumulate, std::reduce and std::inner_product.
Reviewers: hokein, alexfh
Subscribers: Prazek, aaron.ballman, cfe-commits, courbet
Patch by Clément Courbet!
Differential Revision: http://reviews.llvm.org/D18442
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267542 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Checker to validate string constructor parameters.
A common mistake is to swap parameter for the fill-constructor.
```
std::string str('x', 4);
std::string str('4', x);
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19146
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267011 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
Clang-tidy modernize-raw-string-literal check crashes on run-time assert while it is evaluating compiler predefined identifiers such as
- __FUNCTION__
- __func__
- __PRETTY_FUNCTION__
Check is asserting because it cannot find opening quote for such string literal. It occurs only on debug build config.
I think that it would be good to prune such cases by crossing off predefined expressions - there is no need to evaluate such matches.
Reviewers: LegalizeAdulthood, alexfh
Subscribers: cfe-commits
Patch by Marek Jenda!
Differential Revision: http://reviews.llvm.org/D19331
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266992 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
The goal of this tool is fairly simple, look up unknown identifiers in a
global database and add the corresponding #include line. It accomplishes
this by hooking into Sema as an ExternalSemaSource and responding to typo
correction callbacks. This means we can see the unknown identifier before
it's being munged by error recovery.
This doesn't work perfectly yet as some typo corrections don't emit
callbacks (delayed typos), but I think this is fixable. We also handle
only one include at a time as this is meant to be run directly from
the editing environment eventually. Adding multiple includes at the same
time is tricky because of error recovery.
This version only has a a dummy database, so all you can do is fixing
missing includes of <string>, but the indexer to build a database will
follow soon.
Reviewers: djasper
Subscribers: ioeric, hokein, cfe-commits
Differential Revision: http://reviews.llvm.org/D19314
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266870 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: Fixes a crash in cppcoreguidelines-pro-type-member-init when checking some record types with a constructor without a body. We now check to make sure the constructor has a body before looking for missing members and base initializers.
Patch by Michael Miller!
Reviewers: aaron.ballman, alexfh, hokein
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19270
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266862 91177308-0d34-0410-b5e6-96231b3b80d8