summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-move] Dump whether a declaration is templated.Eric Liu2018-10-084-39/+55
| | | | llvm-svn: 343982
* [clangd] Update the out-of-date yaml-symbol-file flag in clangd.Haojian Wu2018-10-081-6/+6
| | | | | | | | | | | | | | Summary: The flag is stale due to the recent changes of clangd indexer, this patch renames the flag to "index-file". Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52976 llvm-svn: 343963
* [clangd] Migrate to LLVM STLExtras range APIFangrui Song2018-10-072-7/+6
| | | | llvm-svn: 343946
* [clangd] NFC: Migrate to LLVM STLExtras API where possibleKirill Bobyrev2018-10-0712-62/+48
| | | | | | | | | | | | | | This patch improves readability by migrating `std::function(ForwardIt start, ForwardIt end, ...)` to LLVM's STLExtras range-based equivalent `llvm::function(RangeT &&Range, ...)`. Similar change in Clang: D52576. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D52650 llvm-svn: 343937
* Revert rL343916: Fix -Wmissing-braces warning. NFCI.Simon Pilgrim2018-10-061-3/+3
| | | | llvm-svn: 343917
* Fix -Wmissing-braces warning. NFCI.Simon Pilgrim2018-10-061-3/+3
| | | | llvm-svn: 343916
* [clangd] Remove unused headers from CodeComplete.cppFangrui Song2018-10-061-3/+0
| | | | | | | queue is not used after index-provided completions' merge with those from Sema USRGeneration.h is not used after introduction of getSymbolID llvm-svn: 343912
* [clang-tidy] NFC refactor lexer-utils to be usable without ASTContextJonas Toth2018-10-056-17/+18
| | | | | | | | | | | | | | | | | | | Summary: This patch is a small refactoring necessary for 'readability-isolate-declaration' and does not introduce functional changes. It allows to use the utility functions without a full `ASTContext` and requires only the `SourceManager` and the `LangOpts`. Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52684 llvm-svn: 343850
* [clangd] Remove last usage of ast matchers from SymbolCollector. NFCSam McCall2018-10-051-4/+2
| | | | llvm-svn: 343849
* [clang-tidy] Replace deprecated std::ios_base aliasesJonas Toth2018-10-058-0/+383
| | | | | | | | | | | | | This check warns the uses of the deprecated member types of std::ios_base and replaces those that have a non-deprecated equivalent. Patch by andobence! Reviewd by: alexfh Revision ID: https://reviews.llvm.org/D51332 llvm-svn: 343848
* [clangd] Remove debugging output in testSam McCall2018-10-051-5/+0
| | | | llvm-svn: 343845
* [clangd] Fix a subtle case for GetBeginningOfIdentifier.Sam McCall2018-10-052-8/+25
| | | | | | | | | | Calling getMacroArgExpansionLocation too early was causing Lexer::getRawToken to do the wrong thing - lexing the macro name instead of the arg contents. Differential Revision: https://reviews.llvm.org/D52928 llvm-svn: 343844
* [clangd] Make binary index format the default, remove dead flag.Sam McCall2018-10-051-23/+4
| | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52872 llvm-svn: 343841
* [clang-doc] Clean up Markdown outputJulie Hockett2018-10-046-29/+53
| | | | | | | | Make the output for the MDGenerator cleaner and more readable. Differential Revision: https://reviews.llvm.org/D52754 llvm-svn: 343818
* [clangd] Simplify Dex query tree logic and fix missing-posting-list bugSam McCall2018-10-045-46/+38
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The bug being fixed: when a posting list doesn't exist in the index, it was previously just dropped from the query rather than being treated as empty. Now that we have the FALSE iterator, we can use it instead. The query tree logic previously had a bunch of special cases to detect whether subtrees are empty. Now we just naively build the whole tree, and rely on the query optimizations to drop the trivial parts. Finally, there was a bug in trigram generation: the empty query would generate a single trigram "$$$" instead of no trigrams. This had no effect (there was no posting list, so the other bug cancelled it out). But we now have to fix this bug too. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52796 llvm-svn: 343802
* [clangd] Dex: FALSE iterator, peephole optimizations, fix AND bugSam McCall2018-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The FALSE iterator will be used in a followup patch to fix a logic bug in Dex (currently, tokens that don't have posting lists in the index are simply dropped from the query, changing semantics). It can usually be optimized away, so added the following opmitizations: - simplify booleans inside AND/OR - replace effectively-empty AND/OR with booleans - flatten nested AND/ORs While working on this, found a bug in the AND iterator: its constructor sync() assumes that ReachedEnd is set if applicable, but the constructor never sets it. This crashes if a non-first iterator is nonempty. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52789 llvm-svn: 343801
* [clangd] Add std::move for converting-return to satisfy older compilersSam McCall2018-10-041-1/+1
| | | | llvm-svn: 343800
* [clang-tidy] fix failing unit testsJonas Toth2018-10-045-42/+30
| | | | | | | | The removal from the FIX-IT notes through the check-clang-tidy script was done incorrect. I did not detect beforehand but adjusted the script and tests accordingly llvm-svn: 343797
* [clangd] fix another ambigous constructor in DexTestJonas Toth2018-10-041-3/+3
| | | | llvm-svn: 343796
* [clangd] Fix ambiguous constructor in DexTestSam McCall2018-10-041-2/+2
| | | | llvm-svn: 343793
* [clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-argumentsJonas Toth2018-10-041-14/+13
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52688 llvm-svn: 343792
* [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-initJonas Toth2018-10-042-6/+10
| | | | | | | | | | | | Reviewers: alexfh, aaron.ballman, hokein Reviewed By: alexfh Subscribers: lebedev.ri, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52691 llvm-svn: 343791
* [clang-tidy] fix PR39167, bugprone-exception-escape hangs-upJonas Toth2018-10-041-0/+3
| | | | | | | | | | | | | | | | | Summary: The check bugprone-exception-escape should not register if -fno-exceptions is set for the compile options. Bailing out on non-cplusplus and non-exceptions language options resolves the issue. Reviewers: alexfh, aaron.ballman, baloghadamsoftware Reviewed By: alexfh Subscribers: lebedev.ri, xazax.hun, rnkovacs, cfe-commits Differential Revision: https://reviews.llvm.org/D52880 llvm-svn: 343789
* [clang-tidy] Added pointer types to clang-tidy readability-identifier-naming ↵Jonas Toth2018-10-042-3/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | check. Summary: Option to check for different naming conventions on the following types: - GlobalConstantPointer - GlobalPointer - LocalConstantPointer - LocalPointer - PointerParameter - ConstantPointerParameter When not specified, the conventions for the non pointer types will be applied (GlobalConstant, GlobalVariable, LocalConstant, ...). Patch by ffigueras! Reviewers: alexfh, kbobyrev Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D52882 llvm-svn: 343788
* [clangd] expose MergedIndex classSam McCall2018-10-049-146/+137
| | | | | | | | | | | | | | Summary: This allows inheriting from it, so index() can ga away and allowing TestTU::index) to be fixed. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52250 llvm-svn: 343780
* [clangd] clangd-indexer gathers refs and stores them in index files.Sam McCall2018-10-047-21/+232
| | | | | | | | | | Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52531 llvm-svn: 343778
* [clangd] Remove one-segment-skipping from Dex trigrams.Sam McCall2018-10-043-13/+7
| | | | | | | | | | | | | | | Summary: Currently queries like "ab" can match identifiers like a_yellow_bee. The value of allowing this for exactly one segment but no more seems dubious. It costs ~3% of overall ram (~9% of posting list ram) and some quality. Reviewers: ilya-biryukov, ioeric Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52885 llvm-svn: 343777
* [cland] Dex: fix/simplify short-trigram generationSam McCall2018-10-044-112/+93
| | | | | | | | | | | | | | | | Summary: 1) Instead of x$$ for a short-query trigram, just use x 2) Make rules more coherent: prefixes of length 1-2, and first char + next head 3) Fix Dex::fuzzyFind to mark results as incomplete, because short-trigram rules only yield a subset of results. Reviewers: ioeric Subscribers: ilya-biryukov, jkorous, mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52808 llvm-svn: 343775
* [clangd] Dex: FALSE iterator, peephole optimizations, fix AND bugSam McCall2018-10-043-25/+154
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The FALSE iterator will be used in a followup patch to fix a logic bug in Dex (currently, tokens that don't have posting lists in the index are simply dropped from the query, changing semantics). It can usually be optimized away, so added the following opmitizations: - simplify booleans inside AND/OR - replace effectively-empty AND/OR with booleans - flatten nested AND/ORs While working on this, found a bug in the AND iterator: its constructor sync() assumes that ReachedEnd is set if applicable, but the constructor never sets it. This crashes if a non-first iterator is nonempty. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52789 llvm-svn: 343774
* [clang-tidy] Sequence statements with multiple parents correctly (PR39149)Martin Bohme2018-10-044-6/+26
| | | | | | | | | | | | | | | | | | | | | Summary: Before this fix, the bugprone-use-after-move check could incorrectly conclude that a use and move in a function template were not sequenced. For details, see https://bugs.llvm.org/show_bug.cgi?id=39149 Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52782 llvm-svn: 343768
* [clangd] Revert accidental flag changeSam McCall2018-10-041-1/+1
| | | | llvm-svn: 343764
* [clangd] Use canonical declarations in ReferenceFinder.Haojian Wu2018-10-042-29/+39
| | | | | | | | | | | | | | | | | | Summary: handleDeclOccurrencce reports a canonical declartion, so stick to use canonical declarations to determine whether a declaration is in the target set. Also fix a previous ref test which misses a matched label (it fails without this patch). Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52871 llvm-svn: 343763
* [clangd] Support refs() in dex. Largely cloned from MemIndex.Sam McCall2018-10-045-35/+78
| | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52726 llvm-svn: 343760
* [clangd] clangd-indexer: Drop support for MR-via-YAMLSam McCall2018-10-043-136/+32
| | | | | | | | | | | | | | Summary: It's slow, and the open-source reduce implementation doesn't scale properly. While here, tidy up some dead headers and comments. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52517 llvm-svn: 343759
* [clang-doc] Avoid parsing undefined base classesJulie Hockett2018-10-037-344/+406
| | | | | | | | | Don't try to parse base classes for declarations that are not definitions (segfaults, as there is no DefinitionData to access). Differential Revision: https://reviews.llvm.org/D52313 llvm-svn: 343703
* [clang-tidy] NFC reorder registering in CppCoreGuidelines moduleJonas Toth2018-10-031-2/+2
| | | | llvm-svn: 343673
* [clang-query] Add comment token handlingStephen Kelly2018-10-032-0/+19
| | | | | | | | | | | | | | | | | Summary: It is possible to pass a file of commands to clang-query using the command line option -f or --preload. Make it possible to write comments in such files. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D52752 llvm-svn: 343666
* [clang-query] Add single-letter 'q' alias for 'quit'Stephen Kelly2018-10-033-1/+5
| | | | | | | | | | | | Reviewers: aaron.ballman, pcc Reviewed By: aaron.ballman Subscribers: Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52746 llvm-svn: 343664
* Fix compilation warning by removing unused variable [NFC]Mikael Holmen2018-10-031-1/+1
| | | | | | | | | | | clang complained with ../tools/clang/tools/extra/clangd/FS.cpp:19:12: error: unused variable 'Err' [-Werror,-Wunused-variable] if (auto Err = FS.makeAbsolute(PathStore)) ^ 1 error generated. llvm-svn: 343661
* [clangd] Temporarily disable VFS stats cache test for windows.Eric Liu2018-10-021-0/+3
| | | | llvm-svn: 343637
* [clangd] Try to fix windows buildbot after r343576Eric Liu2018-10-021-2/+3
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20347/steps/test/logs/stdio llvm-svn: 343623
* Reland r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold ↵Sam McCall2018-10-026-111/+127
| | | | | | | | constant. NFC"" This reverts commit r343610. llvm-svn: 343622
* Revert r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold ↵Reid Kleckner2018-10-026-127/+111
| | | | | | | | | | | | | | constant. NFC" Declaring a field with the same name as a type causes GCC to error out: Dex.h:104:10: error: declaration of 'clang::clangd::dex::Corpus clang::clangd::dex::Dex::Corpus' [-fpermissive] Corpus Corpus; ^ Iterator.h:127:7: error: changes meaning of 'Corpus' from 'class clang::clangd::dex::Corpus' [-fpermissive] class Corpus { llvm-svn: 343610
* [clangd] Don't make check-clangd as a dependency in check-clang-toolsHaojian Wu2018-10-021-11/+16
| | | | | | | | | | | | | | | | Summary: check-clang-tools will run check-clangd first, and then run the rest tests. If clangd tests fails, check-clang-tools would be stopped. This would block other clang-tools developers if clangd is broken. Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52781 llvm-svn: 343608
* [clangd] Add a #include completion test that triggers an assertion.Haojian Wu2018-10-021-0/+9
| | | | | | | | | | | | | | Summary: Test for https://reviews.llvm.org/D52774. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52775 llvm-svn: 343593
* [clangd] Zap TODONEsSam McCall2018-10-021-3/+0
| | | | llvm-svn: 343590
* [clangd] Dex: add Corpus factory for iterators, rename, fold constant. NFCSam McCall2018-10-026-111/+127
| | | | | | | | | | | | | | | | | | | Summary: - Corpus avoids having to pass size to the true iterator, and (soon) any iterator that might optimize down to true. - Shorten names of factory functions now they're scoped to the Corpus. intersect() and unionOf() rather than createAnd() or createOr() as this seems to read better to me, and fits with other short names. Opinion wanted! - DEFAULT_BOOST_SCORE --> 1. This is a multiplier, don't obfuscate identity. - Simplify variadic templates in Iterator.h Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52711 llvm-svn: 343589
* [clangd] Dex iterator printer shows query structure, not iterator state.Sam McCall2018-10-026-42/+62
| | | | | | | | | | | | | | Summary: This makes it suitable for logging (which immediately found a bug, to be fixed in the next patch...) Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52715 llvm-svn: 343580
* [clang-tidy] Ignore singe bit bitfield -> bool conversion in ↵Alexander Kornienko2018-10-023-1/+25
| | | | | | readability-implicit-bool-conversion llvm-svn: 343578
* [clangd] Cache FS stat() calls when building preamble.Eric Liu2018-10-0212-33/+319
| | | | | | | | | | | | | | | | | | | | Summary: The file stats can be reused when preamble is reused (e.g. code completion). It's safe to assume that cached status is not outdated as we assume preamble files to remain unchanged. On real file system, this made code completion ~20% faster on a measured file (with big preamble). The preamble build time doesn't change much. Reviewers: sammccall, ilya-biryukov Reviewed By: sammccall Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52419 llvm-svn: 343576
OpenPOWER on IntegriCloud