summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] Fix PR28406Alexander Kornienko2019-03-292-7/+17
| | | | | | | | Fix the crash resulting from a careless use of getLocWithOffset. At the beginning of a macro expansion it produces an invalid SourceLocation that causes an assertion failure later on. llvm-svn: 357312
* [clang-doc] Build as clang_toolJulie Hockett2019-03-291-1/+1
| | | | | | | | Instead of as clang_executable. Differential Revision: https://reviews.llvm.org/D59974 llvm-svn: 357274
* Fix MSVC "not all control paths return a value" warning. NFCI.Simon Pilgrim2019-03-291-0/+1
| | | | llvm-svn: 357253
* gn build: Add check-clang-tools to run clang-tools-extra lit testsNico Weber2019-03-291-2/+2
| | | | | | | | | | | Only runs the clang-tools-extra lit tests; not yet the unit tests. Add a build file for clangd-indexer too, since it's needed for the tests. Differential Revision: https://reviews.llvm.org/D59955 llvm-svn: 357232
* Add .py extension to clang-tools-extra lit cfg filesNico Weber2019-03-295-6/+10
| | | | | | | | Follow-up to r313892, which did this for clang and llvm. Differential Revision: https://reviews.llvm.org/D59953 llvm-svn: 357231
* Disable warnings when indexing as a standalone action.Sam McCall2019-03-282-0/+29
| | | | | | | | | | | | | | | | | | | Summary: - we don't record the warnings at all - we don't want to stop indexing if we hit error-limit due to warnings - this allows some analyses to be skipped which can save some CPU https://github.com/clangd/clangd/issues/24 Reviewers: hokein Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59935 llvm-svn: 357186
* gn build: Add some build files for clangdNico Weber2019-03-281-2/+2
| | | | | | | | | | | | | | Enough to build the clangd binaries, but this is still missing build files for: - fuzzer - indexer - index/dex/dexp - benchmarks - xpc Differential Revision: https://reviews.llvm.org/D59899 llvm-svn: 357182
* [clangd] Update error message to fix tests after r357173Sam McCall2019-03-281-3/+3
| | | | llvm-svn: 357175
* [clangd] Support UTF-32 (i.e. codepoint) offsets.Sam McCall2019-03-284-54/+171
| | | | | | | | | | | | | | | | Summary: (Changes to UTF-8/UTF-16 here are NFC, moving things around to make the cases more symmetrical) Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59927 llvm-svn: 357173
* [clang-tidy] Handle missing yaml module in run-clang-tidy.pyZinovy Nis2019-03-274-12/+17
| | | | | | | | | | | | The Yaml module is missing on some systems and on many of clang buildbots. But the test for run-clang-tidy.py doesn't fail due to 'NOT' statement masking a python runtime error. This patch conditionally imports and enables the yaml module only if it's present in the system. If not, then '-export-fixes' is disabled. Differential Revision: https://reviews.llvm.org/D59734 llvm-svn: 357114
* [clangd] Support utf-8 offsets (rather than utf-16) as a protocol extensionSam McCall2019-03-2711-27/+228
| | | | | | | | | | | | | | | | Summary: Still some pieces to go here: unit tests for new SourceCode functionality and a command-line flag to force utf-8 mode. But wanted to get early feedback. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58275 llvm-svn: 357102
* [clangd] Bump vscode-clangd v0.0.12.Haojian Wu2019-03-271-1/+1
| | | | | | | | | CHANGELOG: - add an explicit command to activate the extension. - support .cu files (the extension is not activated for .cu files by default, you need to manually activate the extension). llvm-svn: 357082
* [clangd] Fix the inconsistent code indent in vscode extension, NFC.Haojian Wu2019-03-271-21/+21
| | | | llvm-svn: 357078
* [clangd] Add activate command to the vscode extension.Haojian Wu2019-03-272-1/+10
| | | | | | | | | | | | | | | | Summary: This would help minizime the annoying part of not activating the extension for .cu file. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59817 llvm-svn: 357075
* Basic: Return a reference from FileManager::getVirtualFileSystem, NFCDuncan P. N. Exon Smith2019-03-263-5/+4
| | | | | | | | | | FileManager constructs a VFS in its constructor if it isn't passed one, and there's no way to reset it. Make that contract clear by returning a reference from its accessor. https://reviews.llvm.org/D59388 llvm-svn: 357038
* Frontend: Remove CompilerInstance::VirtualFileSystem, NFCDuncan P. N. Exon Smith2019-03-261-1/+1
| | | | | | | | | | | | | | | Remove CompilerInstance::VirtualFileSystem and CompilerInstance::setVirtualFileSystem, instead relying on the VFS in the FileManager. CompilerInstance and its clients already went to some trouble to make these match. Now they are guaranteed to match. As part of this, I added a VFS parameter (defaults to nullptr) to CompilerInstance::createFileManager, to avoid repeating construction logic in clients that just wanted to customize the VFS. https://reviews.llvm.org/D59377 llvm-svn: 357037
* [clangd][xpc][cmake] Respect explicit value of CLANGD_BUILD_XPCJan Korous2019-03-261-3/+10
| | | | | | | | | | | | | We shouldn't prevent user from disabling XPC framework build on Darwin. However, by keeping it on by default our CI systems also test it by default on macOS. Based on user request: http://lists.llvm.org/pipermail/cfe-dev/2019-March/061778.html Differential Revision: https://reviews.llvm.org/D59808 llvm-svn: 356974
* Attempt to fix sphinx bot after r356897Nico Weber2019-03-251-1/+1
| | | | llvm-svn: 356923
* [clangd] Add .cu files to VSCode extensionIlya Biryukov2019-03-251-1/+11
| | | | | | | | | | | | | | | | | | | | | | Summary: clangd should be able to handle those with a proper compilation database. However, users using 'nvcc' might start seeing spurious errors in '.cu' files after this change. My plan is to land and release this, but be ready to revert in case of negative user feedback. Reviewers: hokein Reviewed By: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59759 llvm-svn: 356916
* [clang-tidy] ClangTidy.h -> ClangTidyCheck.hAlexander Kornienko2019-03-251-1/+1
| | | | llvm-svn: 356902
* Rename directory housing clang-include-fixer to be eponymousNico Weber2019-03-2573-70/+73
| | | | | | | | | | | Makes the name of this directory consistent with the names of the other directories in clang-tools-extra. Similar to r356254. No intended behavior change. Differential Revision: https://reviews.llvm.org/D59750 llvm-svn: 356897
* [clangd] Add std subnamespace symbols to the symbol map.Haojian Wu2019-03-252-34/+291
| | | | | | | | | | | | | | Reviewers: ioeric, serge-sans-paille Reviewed By: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59364 llvm-svn: 356894
* [pp-trace] Use ClangTool in pp-trace, NFCHaojian Wu2019-03-251-10/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch partially reverts the commit rL356849. Unfortunately, tooling::createExecutorFromCommandLineArgs doesn't corperate well with our internal infrastructure, which leads failing lit tests. We use ClangTool at the moment, until we find a better solution to smooth it. Reviewers: ioeric Reviewed By: ioeric Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59764 llvm-svn: 356893
* [clang-tidy] Switch checks to #include "ClangTidyCheck.h"Alexander Kornienko2019-03-25172-172/+172
| | | | llvm-svn: 356892
* [clang-tidy] Separate the check-facing interfaceAlexander Kornienko2019-03-256-227/+273
| | | | | | | | | | | | | | | | | | | Summary: Move ClangTidyCheck to a separate header/.cpp Switch checks to #include "ClangTidyCheck.h" Mention ClangTidyCheck.h in the docs Reviewers: hokein, gribozavr, aaron.ballman Reviewed By: hokein Subscribers: mgorny, javed.absar, xazax.hun, arphaman, jdoerfert, llvm-commits, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D59714 llvm-svn: 356890
* [pp-trace] Try fixing MSVC C2248 after rCTE356849Fangrui Song2019-03-251-2/+2
| | | | llvm-svn: 356887
* [clangd] Send empty diagnostics when a file is closedIlya Biryukov2019-03-253-7/+36
| | | | | | | | | | | | | | | | | | | | | | Summary: The LSP clients cannot know clangd will not send diagnostic updates for closed files, so we send them an empty list of diagnostics to avoid showing stale diagnostics for closed files in the UI, e.g. in the "Problems" pane of VSCode. Fixes PR41217. Reviewers: hokein Reviewed By: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59757 llvm-svn: 356880
* Add llvm:: qualifer to make_unique, NFCHaojian Wu2019-03-251-3/+3
| | | | | | To avoid potential "make_unique is ambiguous" compiler errors. llvm-svn: 356878
* [clang-tidy] Fix more false positives for bugprone-string-integer-assignmentClement Courbet2019-03-252-24/+125
| | | | | | | | | | | | | | | | | Summary: And add various tests gleaned for our codebase. See PR27723. Reviewers: JonasToth, alexfh, xazax.hun Subscribers: rnkovacs, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59360 llvm-svn: 356871
* [pp-trace] Delete redundant clang::Fangrui Song2019-03-243-104/+87
| | | | | | And clarify command line options llvm-svn: 356851
* [pp-trace] Wrap code in clang::pp_traceFangrui Song2019-03-243-103/+89
| | | | llvm-svn: 356850
* [pp-trace] Modernize the codeFangrui Song2019-03-2410-124/+64
| | | | | | | | | Use InitLLVM and WithColor Delete PPTraceConsumer, add the callback in PPTraceAction Migrae to tooling::createExecutorFromCommandLineArgs Don't specialize empty OutputFileName llvm-svn: 356849
* [clang-tidy] openmp-exception-escape - a new checkRoman Lebedev2019-03-2211-0/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Finally, we are here! Analyzes OpenMP Structured Blocks and checks that no exception escapes out of the Structured Block it was thrown in. As per the OpenMP specification, structured block is an executable statement, possibly compound, with a single entry at the top and a single exit at the bottom. Which means, ``throw`` may not be used to to 'exit' out of the structured block. If an exception is not caught in the same structured block it was thrown in, the behaviour is undefined / implementation defined, the program will likely terminate. Reviewers: JonasToth, aaron.ballman, baloghadamsoftware, gribozavr Reviewed By: aaron.ballman, gribozavr Subscribers: mgorny, xazax.hun, rnkovacs, guansong, jdoerfert, cfe-commits, ABataev Tags: #clang-tools-extra, #openmp, #clang Differential Revision: https://reviews.llvm.org/D59466 llvm-svn: 356802
* [clang-tidy] openmp-use-default-none - a new checkRoman Lebedev2019-03-228-0/+326
| | | | | | | | | | | | | | | | | | | | | | | Summary: Finds OpenMP directives that are allowed to contain `default` clause, but either don't specify it, or the clause is specified but with the kind other than `none`, and suggests to use `default(none)` clause. Using `default(none)` clause changes the default variable visibility from being implicitly determined, and thus forces developer to be explicit about the desired data scoping for each variable. Reviewers: JonasToth, aaron.ballman, xazax.hun, hokein, gribozavr Reviewed By: JonasToth, aaron.ballman Subscribers: jdoerfert, openmp-commits, klimek, sbenza, arphaman, Eugene.Zelenko, ABataev, mgorny, rnkovacs, guansong, cfe-commits Tags: #clang-tools-extra, #openmp, #clang Differential Revision: https://reviews.llvm.org/D57113 llvm-svn: 356801
* [clang-tidy] A new OpenMP moduleRoman Lebedev2019-03-228-0/+59
| | | | | | | | | | | | | | | | | | Summary: Just the empty skeleton. Previously reviewed as part of D57113. Reviewers: JonasToth, aaron.ballman, alexfh, xazax.hun, hokein, gribozavr Reviewed By: JonasToth, gribozavr Subscribers: jdoerfert, mgorny, rnkovacs, guansong, arphaman, cfe-commits Tags: #clang-tools-extra, #openmp, #clang Differential Revision: https://reviews.llvm.org/D57571 llvm-svn: 356800
* [NFC] ExceptionEscapeCheck: small refactoringRoman Lebedev2019-03-222-1/+20
| | | | | | | | | | | | | | | | | | | Summary: D59466 wants to analyse the `Stmt`, and `ExceptionEscapeCheck` does not have that as a possible entry point. This simplifies addition of `Stmt` analysis entry point. Reviewers: baloghadamsoftware, JonasToth, gribozavr Reviewed By: gribozavr Subscribers: rnkovacs, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D59650 llvm-svn: 356799
* [clang-tidy] Move all checks to the new registerPPCallbacks APIAlexander Kornienko2019-03-2245-122/+146
| | | | llvm-svn: 356796
* Fix clang-move test.Alexander Kornienko2019-03-221-1/+1
| | | | llvm-svn: 356795
* [clang-tidy] anyOf(hasName(..), hasName(..)) -> hasAnyNameAlexander Kornienko2019-03-222-9/+7
| | | | | | + a minor style fix llvm-svn: 356792
* [clangd] Call the new ClangTidyCheck::registerPPCallbacks overloadAlexander Kornienko2019-03-221-0/+2
| | | | llvm-svn: 356788
* Make clang-move use same file naming convention as other toolsNico Weber2019-03-226-8/+8
| | | | | | | | | | | | In all the other clang-foo tools, the main library file is called Foo.cpp and the file in the tool/ folder is called ClangFoo.cpp. Do this for clang-move too. No intended behavior change. Differential Revision: https://reviews.llvm.org/D59700 llvm-svn: 356780
* [clang-tidy] Fix a compiler warning.Alexander Kornienko2019-03-222-12/+12
| | | | | | | | | | Rename the Preprocessor field to fix the declaration of ‘std::unique_ptr<clang::Preprocessor> clang::tooling::ExpandModularHeadersPPCallbacks::Preprocessor’ changes the meaning of ‘Preprocessor’ from ‘class clang::Preprocessor’ [-fpermissive] warning. llvm-svn: 356756
* [clang-tidy] Expand modular headers for PPCallbacksAlexander Kornienko2019-03-2214-24/+544
| | | | | | | | | | | | | | | | | | | | | | Summary: Add a way to expand modular headers for PPCallbacks. Checks can opt-in for this expansion by overriding the new registerPPCallbacks virtual method and registering their PPCallbacks in the preprocessor created for this specific purpose. Use module expansion in the readability-identifier-naming check Reviewers: gribozavr, usaxena95, sammccall Reviewed By: gribozavr Subscribers: nemanjai, mgorny, xazax.hun, kbarton, jdoerfert, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D59528 llvm-svn: 356750
* Reland r356547 after fixing the YAML module missing issue.Zinovy Nis2019-03-211-29/+153
| | | | | | | | | | | | | [clang-tidy] Parallelize clang-tidy-diff.py This patch has 2 rationales: - large patches lead to long command lines and often cause max command line length restrictions imposed by OS; - clang-tidy runs on modified files are independent and can be done in parallel, the same as done for run-clang-tidy. Differential Revision: https://reviews.llvm.org/D5766 llvm-svn: 356649
* Revert "Reland r356547 after fixing the tests for Linux."Douglas Yung2019-03-201-144/+26
| | | | | | | | | This reverts commit 538fb72226cf6dff95af83f7777e12b8dbd061ea (r356565). This is still breaking a build bot: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/45557 llvm-svn: 356630
* [clang-tidy] Disable google-runtime-int in Objective-C++ 🔓Stephane Moore2019-03-203-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In contrast to Google C++, Objective-C often uses built-in integer types other than `int`. In fact, the Objective-C runtime itself defines the types NSInteger¹ and NSUInteger² which are variant types depending on the target architecture. The Objective-C style guide indicates that usage of system types with variant sizes is appropriate when handling values provided by system interfaces³. Objective-C++ is commonly the result of conversion from Objective-C to Objective-C++ for the purpose of integrating C++ functionality. The opposite of Objective-C++ being used to expose Objective-C functionality to C++ is less common, potentially because Objective-C has a signficantly more uneven presence on different platforms compared to C++. This generally predisposes Objective-C++ to commonly being more Objective-C than C++. Forcing Objective-C++ developers to perform conversions between variant system types and fixed size integer types depending on target architecture when Objective-C++ commonly uses variant system types from Objective-C is likely to lead to more bugs and overhead than benefit. For that reason, this change proposes to disable google-runtime-int in Objective-C++. [1] https://developer.apple.com/documentation/objectivec/nsinteger?language=objc [2] https://developer.apple.com/documentation/objectivec/nsuinteger?language=objc [3] "Types long, NSInteger, NSUInteger, and CGFloat vary in size between 32- and 64-bit builds. Use of these types is appropriate when handling values exposed by system interfaces, but they should be avoided for most other computations." https://github.com/google/styleguide/blob/gh-pages/objcguide.md#types-with-inconsistent-sizes Subscribers: xazax.hun, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59336 llvm-svn: 356627
* Revert "[clangd] Print arguments in template specializations"Jordan Rupprecht2019-03-206-124/+63
| | | | | | This reverts commit 44a63f6a150dec72dea43730d2a89d292e58bd6f. It segfaults on an internal test case (will follow up off thread). llvm-svn: 356623
* [clang-tidy] Fix redundant check breaking the test on many platforms.Zinovy Nis2019-03-201-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D57662 llvm-svn: 356589
* gn build: Add build files for some clang-tools-extraNico Weber2019-03-202-2/+6
| | | | | | | | | Adds clang-change-namespace, clang-move, clang-query, clang-reorder-fields. Differential Revision: https://reviews.llvm.org/D59554 llvm-svn: 356567
* Reland r356547 after fixing the tests for Linux.Zinovy Nis2019-03-201-26/+144
| | | | | | | | | | | | | [clang-tidy] Parallelize clang-tidy-diff.py This patch has 2 rationales: - large patches lead to long command lines and often cause max command line length restrictions imposed by OS; - clang-tidy runs on modified files are independent and can be done in parallel, the same as done for run-clang-tidy. Differential Revision: https://reviews.llvm.org/D57662 llvm-svn: 356565
OpenPOWER on IntegriCloud