summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Documentation] Fix incorrect documentation references, new checks order in ↵Eugene Zelenko2018-07-111-8/+8
| | | | | | Release Notes git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336850 91177308-0d34-0410-b5e6-96231b3b80d8
* [Documentation] Link format and order of Clang-tidy changes in Release NotesEugene Zelenko2018-07-111-11/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336849 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Uprank delcarations when "using q::name" is present in the main fileKirill Bobyrev2018-07-112-12/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | Having `using qualified::name;` for some symbol is an important signal for clangd code completion as the user is more likely to use such symbol. This patch helps to uprank the relevant symbols by saving UsingShadowDecl in the new field of CodeCompletionResult and checking whether the corresponding UsingShadowDecl is located in the main file later in ClangD code completion routine. While the relative importance of such signal is a subject to change in the future, this patch simply bumps DeclProximity score to the value of 1.0 which should be enough for now. The patch was tested using `$ ninja check-clang check-clang-tools` No unexpected failures were noticed after running the relevant testsets. Reviewers: sammccall, ioeric Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49012 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336810 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Ignore sema code complete callback with recovery context.Eric Liu2018-07-112-3/+32
| | | | | | | | | | | | | | | | | | | Summary: Sema code complete in the recovery mode is generally useless. For many cases, sema first completes in recovery context and then recovers to more useful context, in which it's favorable to ignore results from recovery (as results are often bad e.g. all builtin symbols and top-level symbols). There is also case where only sema would fail to recover e.g. completions in excluded #if block. Sema would try to give results, but the results are often useless (see the updated excluded #if block test). Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49175 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336801 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Upgrade logging facilities with levels and formatv.Sam McCall2018-07-1120-110/+177
| | | | | | | | | | | | | | | | | | | | | | Summary: log() is split into four functions: - elog()/log()/vlog() have different severity levels, allowing filtering - dlog() is a lazy macro which uses LLVM_DEBUG - it logs to the logger, but conditionally based on -debug-only flag and is omitted in release builds All logging functions use formatv-style format strings now, e.g: log("Could not resolve URI {0}: {1}", URI, Result.takeError()); Existing log sites have been split between elog/log/vlog by best guess. This includes a workaround for passing Error to formatv that can be simplified when D49170 or similar lands. Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49008 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336785 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ExprMutationAnalyzer in performance-for-range-copyShuai Wang2018-07-102-3/+17
| | | | | | | | | | | | | | | | | | | | | Summary: This gives better coverage to the check as ExprMutationAnalyzer is more accurate comparing to isOnlyUsedAsConst. Majority of wins come from const usage of member field, e.g.: for (auto widget : container) { // copy of loop variable if (widget.type == BUTTON) { // const usage only recognized by ExprMutationAnalyzer // ... } } Reviewers: george.karpenkov Subscribers: a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D48854 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336737 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Make sure macro information exists before increasing usage count.Eric Liu2018-07-091-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336581 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Support indexing MACROs.Eric Liu2018-07-093-25/+147
| | | | | | | | | | | | | | Summary: This is not enabled in the global-symbol-builder or dynamic index yet. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D49028 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336553 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Mark "Document Symbols" as implemented in the docsMarc-Andre Laperle2018-07-091-1/+1
| | | | | | | | | | Summary: Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48996 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336550 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Remove JSON library in favor of llvm/Support/JSONSam McCall2018-07-0914-1675/+245
| | | | | | | | | | | | | | | | | | | | Summary: The library has graduated from clangd to llvm/Support. This is a mechanical change to move to the new API and remove the old one. Main API changes: - namespace clang::clangd::json --> llvm::json - json::Expr --> json::Value - Expr::asString() etc --> Value::getAsString() etc - unsigned longs need a cast (due to r336541 adding lossless integer support) Reviewers: ilya-biryukov Subscribers: mgorny, ioeric, MaskRay, jkorous, omtcyfz, cfe-commits Differential Revision: https://reviews.llvm.org/D49077 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336549 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Do not write comments into Preamble PCHIlya Biryukov2018-07-092-32/+12
| | | | | | | | | | | | | | | | | | | | Summary: To avoid wasting time deserializing them on code completion and further reparses. We do not use the comments anyway, because we cannot rely on the file contents staying the same for reparses that reuse the prebuilt preamble PCH. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48943 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336540 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Wait for first preamble before code completionIlya Biryukov2018-07-093-0/+61
| | | | | | | | | | | | | | | | Summary: To avoid doing extra work of processing headers in the preamble mutilple times in parallel. Reviewers: sammccall Reviewed By: sammccall Subscribers: javed.absar, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48940 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336538 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Added a test for preambles and -isystemIlya Biryukov2018-07-091-0/+36
| | | | | | | | | | | | | | | | Summary: Checks that preambles are properly invalidated when headers from -isystem paths change. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48947 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336530 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Make SymbolOrigin an enum class, rather than a plain enum.Sam McCall2018-07-065-16/+24
| | | | | | | I never intended to define namespace pollution like clangd::AST, clangd::Unknown etc. Oops! git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336431 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Implementation of textDocument/documentSymbolMarc-Andre Laperle2018-07-0519-16/+512
| | | | | | | | | | | | | | | | | Summary: An AST-based approach is used to retrieve the document symbols rather than an in-memory index query. The index is not an ideal fit to achieve this because of the file-centric query being done here whereas the index is suited for project-wide queries. Document symbols also includes more symbols and need to keep the order as seen in the file. Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Subscribers: tomgr, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D47846 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336386 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-move] ClangMoveTests: Remove dots in output pathsSimon Marchi2018-07-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Following D48903 ([VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name), the paths output by clang-move in the FileToReplacements map may contain leading "./". For example, where we would get "foo.h", we'll now get "./foo.h". This breaks the tests, because we are doing exact string lookups in the FileToFileID and Results maps (they contain "foo.h", but we search for "./foo.h"). To mitigate this, try to normalize a little bit the paths output by clang-move to remove that leading "./". This patch should be safe to merge before D48903, remove_dots will just be a no-op. Reviewers: ilya-biryukov, hokein Reviewed By: hokein Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D48951 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336358 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFS] Wipe trailing whitespacesKirill Bobyrev2018-07-051-62/+63
| | | | | | | | This patch is a preparation for another one containing meaningful changes. This patch simply removes trailing whitespaces in few files affected by the upcoming patch and reformats git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336330 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix -Wunused-variable warning. NFCI.Simon Pilgrim2018-07-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336329 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Log sema completion context kind and query scopes. NFCEric Liu2018-07-051-2/+9
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48724 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336321 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[clangd] FileDistance: temporarily disable in CodeComplete, it's ↵Sam McCall2018-07-051-2/+1
| | | | | | | | | behaving badly" The bad behavior seems to have been fixed by r336242 after all. I thought it was persisting, but that was a different bug fixed by D48940 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336320 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Treat class constructor as in the same scope as the class in ranking.Eric Liu2018-07-054-7/+52
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48933 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336318 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Track origins of symbols (various indexes, Sema).Sam McCall2018-07-0513-13/+85
| | | | | | | | | | | | Summary: Surface it in the completion items C++ API, and when a flag is set. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48938 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336309 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding some documentation changes that were missed in r336301.Aaron Ballman2018-07-052-0/+42
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336302 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the cert-msc51-cpp and cert-msc32-c checks.Aaron Ballman2018-07-058-0/+434
| | | | | | | | These checks flag use of random number generators with poor seeds that would possibly lead to degraded random number generation. Patch by Borsik Gábor git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336301 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] Fix http://llvm.org/PR38055Alexander Kornienko2018-07-042-2/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336283 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] only ignore collected symbols if TU has uncompilable errors.Eric Liu2018-07-041-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336260 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tools-extra] Cleanup documentation routineKirill Bobyrev2018-07-042-1817/+14
| | | | | | | | | | | | | | | | | | | | | | | | The following issues are resolved: * Doxygen didn't generate documentation for a bunch of existing tools due to the absence of their directories in the doxygen configuration file. This patch adds all relevant directories to the appropriate list. * clang-tools-extra/docs/Doxyfile seems to be unused and irrelevant, doxygen.cfg.in is passed to the CMake's Doxygen invocation, hence Doxyfile is removed. The validity of proposed changes was manually checked by building doxygen-clang-tools and making sure that clangd and other tools are present in Doxygen-generated docs of clang-tools-extra. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47537 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336257 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Cleanup unittest: URIs. NFC.Eric Liu2018-07-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336253 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.Eric Liu2018-07-041-0/+8
| | | | | | | | | | | | | | Summary: For example, template parameter might not be resolved in a broken TU, which can result in wrong USR/SymbolID. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48881 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336252 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix FileDistance test on windows.Eric Liu2018-07-041-2/+8
| | | | | | http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11510/steps/ninja%20check%201/logs/FAIL%3A%20Extra%20Tools%20Unit%20Tests%3A%3AFileDistanceTests.URI git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336249 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] FileDistance: temporarily disable in CodeComplete, it's behaving badlySam McCall2018-07-041-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336248 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] FileDistance: missing constexprSam McCall2018-07-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336246 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] FileDistance: don't add duplicate edgesSam McCall2018-07-041-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336242 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Replace UniqueFunction with llvm::unique_function.Benjamin Kramer2018-07-039-84/+29
| | | | | | One implementation of this ought to be enough for everyone. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336228 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Use default format style and fallback style. NFCEric Liu2018-07-031-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336203 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Incorporate transitive #includes into code complete proximity scoring.Sam McCall2018-07-0317-259/+653
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We now compute a distance from the main file to the symbol header, which is a weighted count of: - some number of #include traversals from source file --> included file - some number of FS traversals from file --> parent directory - some number of FS traversals from parent directory --> child file/dir This calculation is performed in the appropriate URI scheme. This means we'll get some proximity boost from header files in main-file contexts, even when these are in different directory trees. This extended file proximity model is not yet incorporated in the index interface/implementation. Reviewers: ioeric Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48441 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336177 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Remove CompletionItem::SymbolScope extension.Sam McCall2018-07-033-8/+0
| | | | | | | This was never serialized, and embedders now have access to the CodeCompletion API, which includes this information. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336173 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Implement hover for "auto" and "decltype"Marc-Andre Laperle2018-07-024-3/+415
| | | | | | | | | | | | | | | | | | | Summary: This allows hovering on keywords that refer to deduced types. This should cover most useful cases. Not covered: - auto template parameters: Since this can be instantiated with many types, it would not be practical to show the types. - Structured binding: This could be done later to show multiple deduced types in the hover. - auto:: (part of concepts): Outside the scope of this patch. Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48159 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336119 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] ClangdServer::codeComplete return CodeCompleteResult, not LSP struct.Sam McCall2018-07-029-174/+207
| | | | | | | | | | | | | | | | | | | | Summary: This provides more structured information that embedders can use for rendering. ClangdLSPServer continues to call render(), so NFC. The patch is: - trivial changes to ClangdServer/ClangdLSPServer - mostly-mechanical updates to CodeCompleteTests etc for the new API - new direct tests of render() in CodeCompleteTests - tiny cleanups to CodeCompletionItem (operator<< and missing initializers) Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48821 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@336094 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] codeComplete returns more structured completion items, LSP. NFC.Sam McCall2018-06-294-197/+283
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: LSP has some presentational fields with limited semantics (e.g. 'detail') and doesn't provide a good place to return information like namespace. Some places where more detailed information is useful: - tools like quality analysis - alternate frontends that aren't strictly LSP - code completion unit tests In this patch, ClangdServer::codeComplete still return LSP CompletionList, but I plan to switch that soon (should be a no-op for ClangdLSPServer). Deferring this makes it clear that we don't change behavior (tests stay the same) and also keeps the API break to a small patch which can be reverted. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, cfe-commits, jkorous Differential Revision: https://reviews.llvm.org/D48762 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335980 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Improve output of --help and --version. NFC.Sam McCall2018-06-291-1/+11
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48634 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335972 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Use log10 instead of the natural logrithm for usage boost.Eric Liu2018-06-282-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335874 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] misc-unused-parameters - retain old behavior under StrictModeAlexander Kornienko2018-06-285-15/+107
| | | | | | | | | | | | | | Summary: This addresses https://bugs.llvm.org/show_bug.cgi?id=37467. Reviewers: klimek, ilya-biryukov, lebedev.ri, aaron.ballman Reviewed By: lebedev.ri, aaron.ballman Subscribers: aaron.ballman, lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D46951 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335863 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove explicit type from an initializer list. NFC.Alexander Kornienko2018-06-281-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335846 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix formatting. NFC.Alexander Kornienko2018-06-281-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335845 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Fix a data race in TUSchedulerIlya Biryukov2018-06-281-5/+5
| | | | | | | | | | By recomputing CompilerInvocation instead of copying it. The problem was caused by the fact that copies of CompilerInvocation store references to the shared state (DiagnosticOptions) when copied, causing data races when two different copies are destroyed from different threads. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335836 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup test to compile with -frtti when trying to use typeid() as the PS4 ↵Douglas Yung2018-06-281-4/+7
| | | | | | does not have it on by default and it was failing on the PS4 linux bot because of this. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335799 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy/ObjC] Add hashing algorithm acronyms to objc-property-declarationBen Hamilton2018-06-271-0/+6
| | | | | | | | | | | | | | | | Summary: This PR adds a few acronyms related to hashing algorithms to the standard list in `objc-property-declaration`. Reviewers: Wizard Reviewed By: Wizard Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48652 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335770 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] Add ExprMutationAnalyzer, that analyzes whether an expression ↵Alexander Kornienko2018-06-275-0/+927
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | is mutated within a statement. Summary: (Originally started as a clang-tidy check but there's already D45444 so shifted to just adding ExprMutationAnalyzer) `ExprMutationAnalyzer` is a generally useful helper that can be used in different clang-tidy checks for checking whether a given expression is (potentially) mutated within a statement (typically the enclosing compound statement.) This is a more general and more powerful/accurate version of isOnlyUsedAsConst, which is used in ForRangeCopyCheck, UnnecessaryCopyInitialization. It should also be possible to construct checks like D45444 (suggest adding const to variable declaration) or https://bugs.llvm.org/show_bug.cgi?id=21981 (suggest adding const to member function) using this helper function. This function is tested by itself and is intended to stay generally useful instead of tied to any particular check. Reviewers: hokein, alexfh, aaron.ballman, ilya-biryukov, george.karpenkov Reviewed By: aaron.ballman Subscribers: lebedev.ri, shuaiwang, rnkovacs, hokein, alexfh, aaron.ballman, a.sidorin, Eugene.Zelenko, xazax.hun, JonasToth, klimek, mgorny, cfe-commits Tags: #clang-tools-extra Patch by Shuai Wang. Differential Revision: https://reviews.llvm.org/D45679 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335736 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Sema ranking tweaks: downrank keywords and injected names.Sam McCall2018-06-272-7/+16
| | | | | | | | | | | | | Summary: Injected names being ranked too high was just a bug. The high boost for keywords was intended, but was too much given how useless keywords are. We should probably boost them on a case-by-case basis eventually. Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48368 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@335723 91177308-0d34-0410-b5e6-96231b3b80d8