Граф коммитов

1512 Коммитов

Автор SHA1 Сообщение Дата
Piotr Padlewski 889329f9f2 Add boost-use-to-string
http://reviews.llvm.org/D18136

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268079 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:58:29 +00:00
Piotr Padlewski 80f25a0692 small reformat to test access
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:45:20 +00:00
Benjamin Kramer 54a3251dbc [find-all-symbols] Parallelize the merge step.
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
2016-04-29 12:46:27 +00:00
Benjamin Kramer 39ce4a2b03 Make run-find-all-symbols executable.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268022 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 10:33:11 +00:00
Benjamin Kramer 62b3188df0 [find-all-symbols] Fix racy yaml file writing.
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
2016-04-29 10:16:28 +00:00
Haojian Wu 1d3304248a [find-all-symbols] Save absolute file path instead of relative file path in SymbolInfo.
Reviewers: bkramer

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 09:45:09 +00:00
Haojian Wu 10c1dd6c94 [include-fixer] Add Yaml database integration.
Reviewers: bkramer

Subscribers: cfe-commits, klimek, djasper

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@268017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 09:23:38 +00:00
Alexander Kornienko 669f9af538 [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain about static variables
Summary:
Variables with static storage duration are zero-initialized per
[stmt.dcl]p4 and [basic.start.init]p2.

Reviewers: sbenza, aaron.ballman

Subscribers: michael_miller, flx, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:20:01 +00:00
Benjamin Kramer cdbd585312 [include-fixer] Add an option to minimize include paths.
This will always pick the shortest possible path based on -I options. Based
on the #include suggestion code for modules.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 11:21:29 +00:00
Manuel Klimek 694009c01e Add missing newline in clang-rename output.
Patch by Miklos Vajna.

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 06:46:44 +00:00
NAKAMURA Takumi 0e49fada08 FindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.
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
2016-04-28 02:15:16 +00:00
Stephen Hines a64349e622 Fix include path in ClangTidy.cpp.
Summary:
https://llvm.org/bugs/show_bug.cgi?id=27355
To compile with other binary output directory structures in build systems like Android.

Reviewers: srhines, alexfh

Subscribers: tberghammer, danalbert, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 01:42:12 +00:00
NAKAMURA Takumi 15e6bf3d39 clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-member-init-cxx98.cpp: Appease ms targets with -fno-delayed-template-parsing.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:39:48 +00:00
Simon Pilgrim d52761aec1 Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:43:32 +00:00
David Blaikie f237ae162c Fix a bunch of sign-compare warnings
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 18:47:45 +00:00
Benjamin Kramer bed80b3dc9 [find-all-symbols] Also update unittest dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 16:56:29 +00:00
Benjamin Kramer 619c27aff7 [find-all-symbols] Clean up dependencies, fixing cmake shared build.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267738 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 16:50:17 +00:00
Haojian Wu 6c51024a49 Fix explain-check failure test on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 16:39:42 +00:00
Haojian Wu 374711cb92 Don't search compilation database in explain-check, fixing buildbot test
failure.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 16:09:34 +00:00
Benjamin Kramer 7e310d176e Add missing dependency.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 14:32:36 +00:00
Haojian Wu 5096bca15b [include-fixer] Add a find-all-symbols tool for include-fixer.
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
2016-04-27 14:27:05 +00:00
Benjamin Kramer 952a4e3e21 Clean up the include fixer 'driver' a bit and make the database configurable.
Also add a test for it. The library is covered by unit tests, the driver
was not.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 14:24:32 +00:00
Haojian Wu defdbb3405 Remove explain-config testcase that detect hard-coded check.
Remove it for now, we need to better way to figure out how to test it.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 13:23:39 +00:00
Haojian Wu 0dcfb3a14f Fix a crash in cppcoreguidelines-pro-type-member-init when checking a type with a template parameter as a base class.
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
2016-04-27 12:17:04 +00:00
Alexander Kornienko c471abc387 clang-tidy -list-checks should exit with non-zero code when no checks are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 11:45:14 +00:00
Haojian Wu 5de88d6b4c Don't search compilation database in explain-check test.
Reviewers: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267687 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 10:22:31 +00:00
Haojian Wu 67b26d6f44 [ClangTidy] Add an 'explain-checks' option to diagnose where each checks comes from.
Reviewers: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 09:15:01 +00:00
Alexander Kornienko 60e27af3d9 [clang-tidy] Now adding correct misc-move-const-arg documentation ;]
+ brushed the code a bit and renamed the test file to match the check name

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 19:33:49 +00:00
Alexander Kornienko 2bb621a11e [clang-tidy] Added misc-move-const-arg docs.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 18:48:59 +00:00
Eugene Zelenko 83addc4c01 [Release notes] Mention Clang-tidy misc-fold-init-type check.
Highlighting consistency in Clang-tidy misc-fold-init-type check documentation.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 17:54:00 +00:00
Etienne Bergeron bec644754c [clang-tidy] New checker for redundant expressions.
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
2016-04-26 17:30:30 +00:00
Etienne Bergeron 46085a7f46 [clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.
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
2016-04-26 16:53:21 +00:00
Alexander Kornienko 186b9c6529 A clang-tidy check for std:accumulate.
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
2016-04-26 10:05:45 +00:00
NAKAMURA Takumi 46f563960f clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp: Use raw_string_ostream::str() to flush the buffer explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 14:54:28 +00:00
Alexander Kornienko 4345dad2ab [clang-tidy] Fix misc-macro-repeated-side-effects false positive with stringified arguments
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 00:00:08 +00:00
Eugene Zelenko e4e1c0eec0 [Clang-tidy] Fix Clang warning in misc/StringConstructorCheck.h.
Using LLVM_ENABLE_WARNINGS=ON is good idea.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 21:33:33 +00:00
Haojian Wu 4f8a4add8b [clang-tidy] fix link in Release Notes
Summary: This is intended to fix https://llvm.org/bugs/show_bug.cgi?id=27426

Patch by Kirill Bobyrev!

Reviewers: alexfh, LegalizeAdulthood, hokein

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 14:43:39 +00:00
NAKAMURA Takumi 98d6ff1888 clangTidyReadabilityModule: Add clangTidyUtils in libdeps, corresponding to r267003.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 00:33:39 +00:00
Etienne Bergeron 910e7758be [clang-tidy] Fix broken build bot.
Summary:
There is a build bot that doesn't support 'constexpr'.

```
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe   /nologo /TP /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -Itools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\include -Itools\clang\include -Iinclude -ID:\buildslave\clang-x64-ninja-win7\llvm\include    -UNDEBUG  /EHs-c- /GR- /showIncludes -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Fotools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\SuspiciousStringCompareCheck.cpp.obj /Fdtools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\ /FS -c D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C2144: syntax error : 'char' should be preceded by ';'
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ninja: build stopped: subcommand failed.
program finished with exit code 1
```

Reviewers: alexfh, sbenza

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:15:35 +00:00
Eugene Zelenko 16cf66af8c [Release Notes] Mention Clang-tidy misc-string-constructor and misc-suspicious-string-compare checks.
Fix excessive line in misc-string-constructor documentation.


git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:13:09 +00:00
Etienne Bergeron ca213c19ef [clang-tidy] New checker to detect suspicious string constructor.
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
2016-04-21 17:28:08 +00:00
Etienne Bergeron ce3ece373a [clang-tidy] Add new checker for comparison with runtime string functions.
Summary:
This checker is validating suspicious usage of string compare functions.

Example:
```
  if (strcmp(...))       // Implicitly compare to zero
  if (!strcmp(...))      // Won't warn
  if (strcmp(...) != 0)  // Won't warn
```

This patch was checked over large amount of code.
There is three checks:
  [*] Implicit comparator to zero (coding-style, many warnings found),
  [*] Suspicious implicit cast to non-integral (bugs!?, almost none found),
  [*] Comparison to suspicious constant (bugs!?, found two cases),

Example:
[[https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c |
https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c]]

```
      else if(strcmp(id, "select") == 0)
      {
         array->array[i].key1 = 25;
      }
      else if(strcmp(id, "sk") == 28)      // BUG!?
      {
         array->array[i].key1 = 20;
      }
```

Reviewers: alexfh

Subscribers: Eugene.Zelenko, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 17:19:36 +00:00
Etienne Bergeron 4ad9607fb2 [clang-tidy] Cleanup some ast-matchers and lift some to utils.
Summary:
Little cleanup to lift-out and to remove some frequently used
ast-matchers.

Some of theses matchers are candidates to be lifted to ASTMatchers.h.

Reviewers: alexfh

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@267003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 16:57:56 +00:00
Alexander Kornienko d1f3b6cd34 [Clang-tidy] Fix for crash in modernize-raw-string-literal check
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
2016-04-21 14:39:12 +00:00
Haojian Wu 0543069a94 Fix cast compiler warning message in include-fixer.
Reviewers: bkramer

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 09:16:32 +00:00
NAKAMURA Takumi d8689d1c5b IncludeFixerTest.cpp: Tweak not to assume clang-tools-extra were onto clang/tools/extra.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 14:14:16 +00:00
Benjamin Kramer cf8ed12c68 [include-fixer] Add a prototype for a new include fixing tool.
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
2016-04-20 12:43:43 +00:00
Daniel Jasper 92463f0dfd clang-tidy: [misc-unused-using-decls] Support template types.
This fixes llvm.org/PR27429.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 09:48:56 +00:00
Daniel Jasper a2a9da6a86 clang-tidy: [misc-unused-using-decls] Always use the canonical decl to
identify things.

This fixes llvm.org/PR27430.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@266864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 08:58:27 +00:00
Haojian Wu 633d674362 Fix a crash in cppcoreguidelines-pro-type-member-init related to missing constructor bodies.
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
2016-04-20 08:29:08 +00:00