summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/index/IndexAction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Set RetainCommentsFromSystemHeaders to trueIlya Biryukov2019-11-071-0/+1
| | | | | | | | | | clangd should retain comments from system headers. fixes https://github.com/clangd/clangd/issues/96 Patch by lh123! Differential revision: https://reviews.llvm.org/D69928
* [clangd] Use pre-populated mappings for standard symbolsIlya Biryukov2019-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: This takes ~5% of time when running clangd unit tests. To achieve this, move mapping of system includes out of CanonicalIncludes and into a separate class Reviewers: sammccall, hokein Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67172 llvm-svn: 371408
* [clang][Index][NFC] Put IndexingOptions to a separate headerJan Korous2019-09-061-0/+1
| | | | llvm-svn: 371250
* [Index] Added a ShouldSkipFunctionBody callback to libIndex, and refactored ↵Dmitri Gribenko2019-08-291-30/+9
| | | | | | | | | | | | clients to use it instead of inventing their own solution Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66879 llvm-svn: 370338
* [Index] Stopped wrapping FrontendActions in libIndex and its usersDmitri Gribenko2019-08-291-43/+34
| | | | | | | | | Exposed a new function, createIndexingASTConsumer, that creates an ASTConsumer. ASTConsumers compose well. Removed wrapping functionality from createIndexingAction. llvm-svn: 370337
* Fix clangd's IndexAction for FileSkipped API updateAlex Lorenz2019-08-271-2/+2
| | | | llvm-svn: 370004
* [clangd] Skip function bodies inside processed files while indexingIlya Biryukov2019-08-201-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This significantly improves performance of background indexing. We do not collect references and declarations inside the processed files, so this does not affect the final indexing results. The idea is borrowed from libclang, which has a similar optimization in its indexing functionality. Measurements show a nice decrease in indexing time, up to ~40% for building the whole index. These are not proper benchmarks, so one should not rely on these results too much. 1. Rebuilding the whole index for LLVM: - Before. Total time: 14m58s. ./bin/clangd -pch-storage=memory < ./clangd.input 23917.67s user 515.86s system 2718% cpu 14:58.68 total - After. Total time: 8m41s. ./bin/clangd -pch-storage=memory < ./clangd.input 13627.29s user 288.10s system 2672% cpu 8:40.67 total 2. Rebuilding index after removing shards matching '*clangd*' (case-insensitively): - Before. Total time: 30s. ./bin/clangd -pch-storage=memory < ./clangd.input 130.94s user 6.82s system 452% cpu 30.423 total - After. Total time: 26s. ./bin/clangd -pch-storage=memory < ./clangd.input 80.51s user 5.40s system 333% cpu 25.777 total Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66226 llvm-svn: 369349
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-3/+3
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clangd] Add HadErrors field into shardsKadir Cetinkaya2019-07-041-1/+3
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64133 llvm-svn: 365122
* [clangd] Also cache failures while indexingKadir Cetinkaya2019-07-041-6/+3
| | | | | | | | | | | | | | | | Summary: Clangd currently doesn't cache any indexing failures, which results in retrying those failed files even if their contents haven't changed. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63986 llvm-svn: 365120
* [clangd] Add include-mapping for C symbols.Haojian Wu2019-06-211-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This resolves the issue of introducing c++-style includes for C files. - refactor the gen_std.py, make it reusable for parsing C symbols. - add a language mode to the mapping method to use different mapping for C and C++ files. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63270 llvm-svn: 364044
* [clangd] Index API and implementations for relationsNathan Ridge2019-06-151-1/+8
| | | | | | | | | | | | | | | | | Summary: This builds on the relations support added in D59407, D62459, and D62471 to expose relations in SymbolIndex and its implementations. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62839 llvm-svn: 363481
* [clangd] Count number of references while merging RefSlabs inside FileIndexKadir Cetinkaya2019-05-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Summary: For counting number of references clangd was relying on merging every duplication of a symbol. Unfortunately this does not apply to FileIndex(and one of its users' BackgroundIndex), since we get rid of duplication by simply dropping symbols coming from non-canonical locations. So only one or two(coming from canonical declaration header and defined source file, if exists) replications of the same symbol reaches merging step. This patch changes reference counting logic to rather count number of different RefSlabs a given SymbolID exists. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, mgrang, arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59481 llvm-svn: 360344
* Disable warnings when indexing as a standalone action.Sam McCall2019-03-281-0/+5
| | | | | | | | | | | | | | | | | | | 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
* [clangd] Support utf-8 offsets (rather than utf-16) as a protocol extensionSam McCall2019-03-271-1/+0
| | | | | | | | | | | | | | | | 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] Respect Origin option in createStaticIndexingActionKadir Cetinkaya2019-03-111-1/+2
| | | | | | | | | | | | | | | | | | | Summary: Currently createStaticIndexingAction always set Origin to Static, which makes it hard to change it later on by different indexers(One needs to go over each symbol making a new copy). This patch changes that behavior to rather respect it if set by user. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59205 llvm-svn: 355820
* Added missing license headersDmitri Gribenko2019-02-281-1/+8
| | | | | | | | | | | | Reviewers: ioeric Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58781 llvm-svn: 355092
* Moved SymbolOrigin into its own header and implementation fileDmitri Gribenko2019-02-281-0/+2
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58773 llvm-svn: 355086
* [clangd] Drop documentation in static index if symbols are not indexed for ↵Haojian Wu2019-02-251-0/+1
| | | | | | | | | | | | | | | | | | | completion. Summary: This is a further optimization of r350803, we drop docs in static index for symbols not being indexed for completion, while keeping the docs in dynamic index (we rely on dynamic index to get docs for class members). Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56539 llvm-svn: 354792
* [clangd] Remove 'using namespace llvm' from .cpp files. NFCIlya Biryukov2019-01-071-7/+6
| | | | | | | | The new guideline is to qualify with 'llvm::' explicitly both in '.h' and '.cpp' files. This simplifies moving the code between header and source files and is easier to keep consistent. llvm-svn: 350531
* [clangd] Populate include graph during static indexing action.Kadir Cetinkaya2018-11-301-7/+115
| | | | | | | | | | | | | | | Summary: This is the second part for introducing include hierarchy into index files produced by clangd. You can see the base patch that introduces structures and discusses the future of the patches in D54817 Reviewers: ilya-biryukov Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D54999 llvm-svn: 348005
* [clangd] Namespace style cleanup in cpp files. NFC.Sam McCall2018-10-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standardize on the most common namespace setup in our *.cpp files: using namespace llvm; namespace clang { namespace clangd { void foo(StringRef) { ... } And remove redundant llvm:: qualifiers. (Except for cases like make_unique where this causes problems with std:: and ADL). This choice is pretty arbitrary, but some broad consistency is nice. This is going to conflict with everything. Sorry :-/ Squash the other configurations: A) using namespace llvm; using namespace clang; using namespace clangd; void clangd::foo(StringRef); This is in some of the older files. (It prevents accidentally defining a new function instead of one in the header file, for what that's worth). B) namespace clang { namespace clangd { void foo(llvm::StringRef) { ... } This is fine, but in practice the using directive often gets added over time. C) namespace clang { namespace clangd { using namespace llvm; // inside the namespace This was pretty common, but is a bit misleading: name lookup preferrs clang::clangd::foo > clang::foo > llvm:: foo (no matter where the using directive is). llvm-svn: 344850
* [clangd] Collect refs from headers.Haojian Wu2018-10-171-1/+3
| | | | | | | | | | | | | | | | | Summary: Add a flag to SymbolCollector to collect refs fdrom headers. Note that we collect refs from headers in static index, and we don't do it for dynamic index because of the preamble (we skip function body in preamble, collecting it will result incomplete results). Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53322 llvm-svn: 344678
* [clangd] NFC fix semicolon warningJonas Toth2018-10-121-1/+1
| | | | llvm-svn: 344384
* [clangd] clangd-indexer gathers refs and stores them in index files.Sam McCall2018-10-041-6/+13
| | | | | | | | | | Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52531 llvm-svn: 343778
* Removed extra semicolon to fix Wpedantic. (NFCI).Simon Pilgrim2018-09-261-1/+1
| | | | llvm-svn: 343083
* [clangd] Extract mapper logic from clangd-indexer into a library.Sam McCall2018-09-251-0/+73
Summary: Soon we can drop support for MR-via-YAML. I need to modify some out-of-tree versions to use the library, first. Reviewers: kadircet Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52465 llvm-svn: 343019
OpenPOWER on IntegriCloud