summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
* Fix windows buildbots that don't have full shell supportSimon Pilgrim2017-02-171-0/+1
| | | | llvm-svn: 295498
* [clang-tidy] Add -path option to clang-tidy-diff.pyEhsan Akhgari2017-02-172-0/+7
| | | | | | | | | | | | | | | Summary: This flag allows specifying a custom path for the compilation database. Unfortunately we can't use the -p flag like other clang-tidy tools because it's already taken. Reviewers: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29806 llvm-svn: 295482
* [Docs] 'Limitations' should be a subsectionAlex Lorenz2017-02-171-1/+1
| | | | | | | | The 'Limitations' section in thedocumentation for readability-misleading-indentation should be a subsection, as otherwise the link to 'Limitations' isn't indented in the 'Clang-Tidy Checks' documentation page. llvm-svn: 295471
* [clang-tidy] Add cert-dcl58-cpp (do not modify the 'std' namespace) check.Gabor Horvath2017-02-179-0/+207
| | | | | | Differential Revision: https://reviews.llvm.org/D23421 llvm-svn: 295435
* Fix clang-move test after clang-format update r295312Krasimir Georgiev2017-02-161-3/+3
| | | | llvm-svn: 295317
* [clangd] Fix Output.log errorKrasimir Georgiev2017-02-161-1/+1
| | | | llvm-svn: 295305
* [clangd] Implement format on typeKrasimir Georgiev2017-02-166-4/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds onTypeFormatting to clangd. The trigger character is '}' and it works by scanning for the matching '{' and formatting the range in-between. There are problems with ';' as a trigger character, the cursor position is before the `|`: ``` int main() { int i;| } ``` becomes: ``` int main() { int i;| } ``` which is not likely what the user intended. Also formatting at semicolon in a non-properly closed scope puts the following tokens in the same unwrapped line, which doesn't reformat nicely. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29990 llvm-svn: 295304
* [clang-tidy] Ignore spaces between globs in the Checks option.Alexander Kornienko2017-02-162-1/+2
| | | | llvm-svn: 295303
* [clang-tidy] Fix test modernize-return-braced-init-listJonas Devlieghere2017-02-151-2/+1
| | | | llvm-svn: 295207
* Fixed indentation issue in release notesJonas Devlieghere2017-02-151-1/+1
| | | | llvm-svn: 295205
* [clang-tidy] Add check 'modernize-return-braced-init-list'Jonas Devlieghere2017-02-158-0/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Replaces explicit calls to the constructor in a return with a braced initializer list. This way the return type is not needlessly duplicated in the return type and the return statement. ``` Foo bar() { Baz baz; return Foo(baz); } // transforms to: Foo bar() { Baz baz; return {baz}; } ``` Reviewers: hokein, Prazek, aaron.ballman, alexfh Reviewed By: Prazek, aaron.ballman, alexfh Subscribers: malcolm.parsons, mgorny, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D28768 llvm-svn: 295199
* [clangd] Fix another use after free that I missed because COW strings.Benjamin Kramer2017-02-151-1/+1
| | | | llvm-svn: 295198
* [clangd] Silence GCC warning about falling off a fully covered switch.Benjamin Kramer2017-02-151-0/+1
| | | | llvm-svn: 295196
* [clangd] Synchronize logs access.Benjamin Kramer2017-02-155-12/+17
| | | | | | | I don't think that this is necessary for correctness, but makes tsan much more useful. llvm-svn: 295194
* [clangd] Initialize the thread after the mutex.Benjamin Kramer2017-02-151-3/+4
| | | | | | | Otherwise locking the mutex yields a racy assertion failure on picky implementations. llvm-svn: 295193
* [clang-tidy] Don't delay parsing of templates in test for ↵Malcolm Parsons2017-02-151-1/+1
| | | | | | misc-unconventional-assign-operator llvm-svn: 295192
* [clangd] Fix use after free.Benjamin Kramer2017-02-151-1/+1
| | | | llvm-svn: 295187
* [clangd] Add missing include.Benjamin Kramer2017-02-151-0/+1
| | | | llvm-svn: 295184
* [clangd] Wire up ASTUnit and publish diagnostics with it.Benjamin Kramer2017-02-156-5/+343
| | | | | | | | | | | | | | Summary: This requires an accessible compilation database. The parsing is done asynchronously on a separate thread. Reviewers: klimek, krasimir Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D29886 llvm-svn: 295180
* [clang-tidy] Ignore instantiated functions and static data members of ↵Haojian Wu2017-02-152-3/+16
| | | | | | | | | | | | | | classes in misc-definitions-in-headers. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29957 llvm-svn: 295178
* [clang-tidy] Don't warn about call to unresolved operator*Malcolm Parsons2017-02-152-1/+26
| | | | | | | | | | | | | | | | | | Summary: The misc-unconventional-assign-operator check had a false positive warning when the 'operator*' in 'return *this' was unresolved. Change matcher to allow calls to unresolved operator. Fixes PR31531. Reviewers: alexfh, aaron.ballman Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29393 llvm-svn: 295176
* [clang-tidy] Add support for NOLINTNEXTLINE.Benjamin Kramer2017-02-142-0/+62
| | | | | | | | | | Reviewers: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29899 llvm-svn: 295049
* [clang-tidy] Improve diagnostic message for misc-definitions-in-header.Haojian Wu2017-02-142-5/+7
| | | | | | | | | | | | | | | | | | | Summary: Users might get confused easily when they see the check's message on full template function speciliations. Add a note to the output message, which mentions these kind of function specializations are treated as regular functions. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29928 llvm-svn: 295048
* [clang-tidy] Add readability-misleading-indentation check.Gabor Horvath2017-02-148-0/+272
| | | | | | Differential Revision: https://reviews.llvm.org/D19586 llvm-svn: 295041
* [clang-tidy] Reduce indentation. NFC.Benjamin Kramer2017-02-131-10/+10
| | | | llvm-svn: 294974
* [change-namespace] add an option to dump changed files in YAML.Eric Liu2017-02-132-3/+36
| | | | | | | | | | | | Reviewers: hokein Reviewed By: hokein Subscribers: fhahn, cfe-commits Differential Revision: https://reviews.llvm.org/D29893 llvm-svn: 294969
* [clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not ↵Mads Ravn2017-02-121-1/+1
| | | | | | | | work for class members Fix for commit r294912 which had a small error in the AST matcher. llvm-svn: 294913
* [clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not ↵Mads Ravn2017-02-123-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | work for class members I have made a small fix for readability-delete-null-pointer check so it also checks for class members. Example of case that it fixes ``` struct A { void foo() { if(mp) delete mp; } int *mp; }; ``` Reviewers: JDevlieghere, aaron.ballman, alexfh, malcolm.parsons Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29726 llvm-svn: 294912
* Fix memory leak by using unique_ptrDavid Blaikie2017-02-113-11/+11
| | | | llvm-svn: 294823
* [clangd] Move isDone from the JSONOutput to ShutdownHandler.Benjamin Kramer2017-02-103-11/+10
| | | | | | | This is just as easy to check from main but prevents random code from shutting down the server. llvm-svn: 294760
* [clang-tidy] Fix handling of function types in google-readability-castingAlexander Kornienko2017-02-102-7/+100
| | | | llvm-svn: 294751
* [clangd] Refactor stream output into a single thread-safe output object.Benjamin Kramer2017-02-105-39/+63
| | | | | | | This abstracts away the passing of raw_ostreams everywhere, thread safety will be used soon. llvm-svn: 294747
* [CMake] Fix pthread handling for out-of-tree buildsEric Fiselier2017-02-101-1/+1
| | | | | | | | | | | | | | | LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects to correctly link the threading library when needed. Unfortunately `PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed and therefore can't be used when configuring out-of-tree builds. This causes such builds to fail since `pthread` isn't being correctly linked. This patch attempts to fix that problem by renaming and exporting `LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB` because It seemed likely to cause collisions with downstream users of `LLVMConfig.cmake`. llvm-svn: 294690
* Adds the commandline need to run clang-tidy tests.David L. Jones2017-02-101-0/+6
| | | | | | | | Patch by Jorge Gorbe (lethalantidote) Differential Revision: https://reviews.llvm.org/D29737 llvm-svn: 294689
* Don't try to link to the 4.0 release notesHans Wennborg2017-02-091-2/+2
| | | | llvm-svn: 294657
* [clang-tidy] Add -quiet option to suppress extra outputEhsan Akhgari2017-02-098-13/+82
| | | | | | | | | | | | | | | Summary: This new flag instructs clang-tidy to not output anything except for errors and warnings. This makes it easier to script clang-tidy to run as part of external build systems. Reviewers: bkramer, alexfh, klimek Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29661 llvm-svn: 294607
* [clang-tidy] Fix misc-unused-using-decls false positives in presence of ↵Alexander Kornienko2017-02-092-0/+15
| | | | | | compile errors llvm-svn: 294578
* [clang-tidy] Add -extra-arg and -extra-arg-before to clang-tidy-diff.pyEhsan Akhgari2017-02-081-0/+12
| | | | | | | | | | | | | | Summary: These flags allow specifying extra arguments to the tool's command line which don't appear in the compilation database. Reviewers: alexfh, klimek, bkramer Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D29699 llvm-svn: 294491
* [clang-tidy] hasErrorOccurred() -> hasUncompilableErrorOccurred()Alexander Kornienko2017-02-083-4/+18
| | | | | | | hasErrorOccurred() -> hasUncompilableErrorOccurred(), since we only care about errors that lead to invalid AST. llvm-svn: 294467
* [clang-tidy] Supresses misc-move-constructor-init warning for const fields.Alexander Kornienko2017-02-082-0/+13
| | | | | | | | Patch by CJ DiMeglio! Differential revision: https://reviews.llvm.org/D28973 llvm-svn: 294459
* [clangd] Strip file:// from the URI when calling formatting.Benjamin Kramer2017-02-071-0/+3
| | | | | | It confuses FileManager on windows. llvm-svn: 294314
* [clangd] Ignore comments in clangd input, so we can write tests without sed.Benjamin Kramer2017-02-072-2/+7
| | | | | | Another attempt on making this work on windows. llvm-svn: 294312
* [clangd] Fix subtle use after return.Benjamin Kramer2017-02-071-1/+4
| | | | | | | | I didn't find this because my main development machine still happens to use libstdc++ with the broken C++11 ABI, which has a global empty string. llvm-svn: 294309
* Disable test on windows buildbots without shell supportSimon Pilgrim2017-02-071-0/+1
| | | | llvm-svn: 294299
* [clangd] Set stdin to binary to fix tests on windows.Benjamin Kramer2017-02-071-0/+4
| | | | llvm-svn: 294297
* [clangd] Harden test against sed implementations that strip \r.Benjamin Kramer2017-02-072-7/+5
| | | | | | Also clean up logging and don't print \0. llvm-svn: 294294
* [clang-tidy] misc-argument-comment - extended gmock supportAlexander Kornienko2017-02-072-23/+40
| | | | | | | It looks like direct calls to mocked methods happen in the wild. This patch add support for these as well. llvm-svn: 294293
* [clangd] Add missing include.Benjamin Kramer2017-02-071-0/+1
| | | | llvm-svn: 294292
* Add a prototype for clangdBenjamin Kramer2017-02-0712-0/+1169
| | | | | | | | | | | | | | | | | | clangd is a language server protocol implementation based on clang. It's supposed to provide editor integration while not suffering from the confined ABI of libclang. This implementation is limited to the bare minimum functionality of doing (whole-document) formatting and rangeFormatting. The JSON parsing is based on LLVM's YAMLParser but yet most of the code of clangd is currently dealing with JSON serialization and deserialization. This was only tested with VS Code so far, mileage with other LSP clients may vary. Differential Revision: https://reviews.llvm.org/D29451 llvm-svn: 294291
* [clang-tidy] Cleanup of no-assembler checkJonathan Coe2017-02-071-3/+2
| | | | | | Address outstanding comments from https://reviews.llvm.org/D29267 llvm-svn: 294283
OpenPOWER on IntegriCloud