[PATCH] D51291: [clangd] Support multiple #include headers in one symbol.

2018-09-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 163678. ioeric added a comment. - Document limitation for overload bundling. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51291 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/index/Index.cpp clangd/index/Index.h clan

[PATCH] D51291: [clangd] Support multiple #include headers in one symbol.

2018-09-03 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341304: [clangd] Support multiple #include headers in one symbol. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D51291 File

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/;:1 +//===--- Token.cpp - Symbol Search primitive *- C++ -*-===// +// The LLVM Compiler Infrastructure Unintended change? Comment at: clang-too

[PATCH] D51422: [clangd] Factor out the data-swapping functionality from MemIndex/DexIndex.

2018-09-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. Comment at: clangd/index/FileIndex.h:47 + // The shared_ptr keeps the symbols alive. + std::shared_ptr buildMemIndex(); kbobyrev wrote: > sammccall wrote: > > ioeric wrote: > > > Maybe avoid hardcod

[PATCH] D51598: [clangd] Avoid crashes in override completions

2018-09-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/CodeCompleteTests.cpp:1770 + // Check the completions call does not crash. + completions(R"cpp( +struct Base { ilya-biryukov wrote: > Was wondering if testing for crashes LG this way, or adding more

[PATCH] D51605: [clangd] SymbolOccurrences -> Refs and cleanup

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. nice! Comment at: clangd/index/Index.cpp:153 + // We can reuse the arena, as it only has unique strings and we need them all. + // Reallocate the ref lists on the arena to

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric requested changes to this revision. ioeric added a comment. This revision now requires changes to proceed. (and forgot to request changes ;) https://reviews.llvm.org/D51481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. There are a few changes/refactorings which I would suggest splitting from this patch, as they would require more thoughts and seem unrelated in this patch. Please see the inline comments :) Comment at: clang-tools-extra/clangd/Quality.h:130 +/// direct

[PATCH] D51585: [clangd] Define a compact binary serialization fomat for symbol slab/index.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Super cool! Just a few nits. Comment at: clangd/RIFF.cpp:58 + if (RIFF->ID != fourCC("RIFF")) +return makeError("Extra content after RIFF chunk"); + if (RIFF->Data.size() < 4) The error message seems wrong? Comme

[PATCH] D51585: [clangd] Define a compact binary serialization fomat for symbol slab/index.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D51638: [clangd] Load static index asynchronously, add tracing.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lg. Thanks! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D51475: [clangd] Load YAML static index asynchronously.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric abandoned this revision. ioeric added a comment. Dropping this in favor of https://reviews.llvm.org/D51638 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[PATCH] D51641: [VFS] Cache the current working directory for the real FS.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D51641 Files: lib/Basic/VirtualFileSystem.cpp Index: lib/Basic/VirtualFileSystem.cpp =

[PATCH] D51641: [VFS] Cache the current working directory for the real FS.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 163858. ioeric marked an inline comment as done. ioeric added a comment. - Guard CWDCache with mutex. Repository: rC Clang https://reviews.llvm.org/D51641 Files: lib/Basic/VirtualFileSystem.cpp Index: lib/Basic/VirtualFileSystem.cpp ==

[PATCH] D51641: [VFS] Cache the current working directory for the real FS.

2018-09-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Basic/VirtualFileSystem.cpp:275 return EC; - return Dir.str().str(); + CWDCache = Dir.str(); + return CWDCache; sammccall wrote: > Doesn't this need to be guarded by a lock? I know the current version is > th

[PATCH] D51641: [VFS] Cache the current working directory for the real FS.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 163986. ioeric marked an inline comment as done. ioeric added a comment. - s/Mutex/CWDMutex/ Repository: rC Clang https://reviews.llvm.org/D51641 Files: lib/Basic/VirtualFileSystem.cpp Index: lib/Basic/VirtualFileSystem.cpp ===

[PATCH] D51641: [VFS] Cache the current working directory for the real FS.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC341455: [VFS] Cache the current working directory for the real FS. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D51641?vs=163986&id=163994#toc Repository: rC

[PATCH] D51675: [Sema] Store MacroInfo in CodeCompletionResult for macro results.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added a subscriber: cfe-commits. This provides information about the macro definition. For example, it can be used to compute macro USRs. Repository: rC Clang https://reviews.llvm.org/D51675 Files: include/clang/Sema/

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/dex/DexIndex.cpp:59 LookupTable[Sym->ID] = Sym; -SymbolQuality[Sym] = quality(*Sym); +SymbolAndScores[I] = {Sym, static_cast(quality(*Sym))}; } ioeric wrote: > ioeric wrote:

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric requested changes to this revision. ioeric added a comment. This revision now requires changes to proceed. This should be the last round! ;) Comment at: clang-tools-extra/clangd/index/dex/DexIndex.cpp:45 +std::vector> +createPathIterators(llvm::ArrayRef ProximityPaths, +

[PATCH] D51675: [Sema] Store MacroInfo in CodeCompletionResult for macro results.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 164044. ioeric added a comment. - update comment about missing MacroInfo. Repository: rC Clang https://reviews.llvm.org/D51675 Files: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/SemaCodeComplete.cpp tools/libclang/CXCursor.cpp Index: tools/

[PATCH] D51675: [Sema] Store MacroInfo in CodeCompletionResult for macro results.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/Sema/CodeCompleteConsumer.h:847 + /// If the result is RK_Macro, this can store the information about the macro + /// definition. sammccall wrote: > Let's not make this maybe/optional: `If the result is

[PATCH] D51675: [Sema] Store MacroInfo in CodeCompletionResult for macro results.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341476: [Sema] Store MacroInfo in CodeCompletionResult for macro results. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D516

[PATCH] D51688: [clangd] Set SymbolID for sema macros so that they can be merged with index macros.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51688 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp c

[PATCH] D51688: [clangd] Set SymbolID for sema macros so that they can be merged with index macros.

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 164055. ioeric added a comment. - Set name for the test symbol. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51688 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/index/SymbolCollector.cpp unittests/clangd/CodeC

[PATCH] D51481: [clangd] Implement proximity path boosting for Dex

2018-09-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/URI.cpp:200 + return make_string_error("Couldn't convert " + AbsolutePath + + " to any given scheme."); +}

[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, kadircet. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov. Also set "deprecated" field in LSP CompletionItem. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51724 Files: clangd/

[PATCH] D51688: [clangd] Set SymbolID for sema macros so that they can be merged with index macros.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 164177. ioeric marked 2 inline comments as done. ioeric added a comment. - improve comment; remove dead code. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51688 Files: clangd/AST.cpp clangd/AST.h clangd/CodeComplete.cpp clangd/inde

[PATCH] D51688: [clangd] Set SymbolID for sema macros so that they can be merged with index macros.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341534: [clangd] Set SymbolID for sema macros so that they can be merged with index… (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.ll

[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Protocol.cpp:520 Result["additionalTextEdits"] = json::Array(CI.additionalTextEdits); + if (CI.deprecated) +Result["deprecated"] = CI.deprecated; sammccall wrote: > do we actually want this in JSON? > (ge

[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 164205. ioeric marked an inline comment as done. ioeric added a comment. - Pack flags in Symbol. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51724 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/Protocol.cpp clangd/Pro

[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 164258. ioeric marked 5 inline comments as done. ioeric added a comment. - addressed review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51724 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/Protocol.cpp clangd

[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 164259. ioeric added a comment. - merged with origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51724 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/Protocol.cpp clangd/Protocol.h clangd/Quality.cpp clangd

[PATCH] D51724: [clangd] Add "Deprecated" field to Symbol and CodeCompletion.

2018-09-06 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE341576: [clangd] Add "Deprecated" field to Symbol and CodeCompletion. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D51724?vs=164259&id=164260#toc Repository:

[PATCH] D51539: [clangd] Add symbol slab size to index memory consumption estimates

2018-09-07 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:144 +size_t FileIndex::estimateMemoryUsage() const { + return FSymbols.estimateMemoryUsage(); +} This can be a bit tricky. Generally, the size of a `FileIndex` is the size of

[PATCH] D51747: [clangd] Implement deprecation diagnostics with lower severity.

2018-09-07 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Diagnostics.cpp:299 +D.Severity = +D.Category == "Deprecations" ? DiagnosticsEngine::Note : DiagLevel; return D; kadircet wrote: > Couldn't find a better way to check for this one. Category types a

[PATCH] D51539: [clangd] Add symbol slab size to index memory consumption estimates

2018-09-07 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/FileIndex.cpp:144 +size_t FileIndex::estimateMemoryUsage() const { + return FSymbols.estimateMemoryUsage(); +} sammccall wrote: > ioeric wrote: > > This can be a bit tricky. Generally, the

[PATCH] D51747: [clangd] Implement deprecation diagnostics with lower severity.

2018-09-07 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D51747#1227089, @ilya-biryukov wrote: > Not sure if it's fine to hijack our own diagnostic-specific flags in to clang > command args. > > Cons that I see: > > 1. There is no way for the users to turn them off if they find them > non-useful. If

[PATCH] D51539: [clangd] Add symbol slab size to index memory consumption estimates

2018-09-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/index/Index.h:512 llvm::function_ref) const override; + void lookup(const LookupRequest &, nit:

[PATCH] D51297: [docs] Create a guide for Vim users on how to setup Clangd

2018-09-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D51297#1228441, @kbobyrev wrote: > In https://reviews.llvm.org/D51297#1225546, @ilya-biryukov wrote: > > > I would stamp this from my side, but concerns whether we should recommend > > YCM's LSP-based completer instead are probably still there.

[PATCH] D51860: [clangd] NFC: Use uint32_t for FuzzyFindRequest limits

2018-09-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/Index.cpp:186 + O.map("ProximityPaths", Request.ProximityPaths); + if (OK) +Request.MaxCandidateCount = MaxCandidateCount; I think we should not set `Request.MaxCandidateCount` if

[PATCH] D51864: [Tooling] Restore working dir in ClangTool.

2018-09-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lg Repository: rC Clang https://reviews.llvm.org/D51864 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/

[PATCH] D51860: [clangd] NFC: Use uint32_t for FuzzyFindRequest limits

2018-09-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/index/Index.h:440 /// return more than this, e.g. if it doesn't know which candidates are best. - size_t MaxCandidateCount = std:

[PATCH] D51860: [clangd] NFC: Use uint32_t for FuzzyFindRequest limits

2018-09-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/Index.h:440 /// return more than this, e.g. if it doesn't know which candidates are best. - size_t MaxCandidateCount = std::numeric_limits::max(); + uint32_t MaxCandidateCount = std::numeric_limits::max

[PATCH] D51977: [clangd] Clarify and hide -index flag.

2018-09-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. The wording implies global index support, which is confusing. As most users shouldn't care about this flag, also make it hidden to avoid furt

[PATCH] D51987: [clangd] Rename global-symbol-builder to clangd-symbol-builder.

2018-09-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm +1 to `clang-symbol-builder` Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51987 ___ cfe-commits mailing list cfe-commits

[PATCH] D51987: [clangd] Rename global-symbol-builder to clangd-symbol-builder.

2018-09-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a subscriber: ilya-biryukov. ioeric added a comment. I mean `clangd-symbol-builder` Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51987 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-

[PATCH] D51987: [clangd] Rename global-symbol-builder to clangd-symbol-builder.

2018-09-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D51987#1231971, @ilya-biryukov wrote: > `clangd-indexer` looks nice and short. @ioeric, WDYT? You beat it to me, but I thought we didn't use `indexer` as it could be confused with the actual `indexing`? Repository: rCTE Clang Tools Extra

[PATCH] D51987: [clangd] Rename global-symbol-builder to clangd-symbol-builder.

2018-09-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D51987#1231990, @ilya-biryukov wrote: > > You beat it to me, but I thought we didn't use indexer as it could be > > confused with the actual indexing? > > Sorry. Not a big deal, can revert back if needed. > Mostly like indexer since it's short

[PATCH] D51987: [clangd] Rename global-symbol-builder to clangd-symbol-builder.

2018-09-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. In https://reviews.llvm.org/D51987#1232021, @sammccall wrote: > In https://reviews.llvm.org/D51987#1231993, @ioeric wrote: > > > In https://reviews.llvm.org/D51987#1231990, @ilya-biryukov wrote: > > > > > > You beat it to me, but I thought we

[PATCH] D51297: [docs] Create a guide for Vim users on how to set up Clangd

2018-09-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/docs/clangd.rst:111 +Editor Integration +== While we are here, would you mind including some other editors/plugins that are known to work with clangd (just so that people don't think v

[PATCH] D51297: [docs] Create a guide for Vim users on how to set up Clangd

2018-09-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/docs/clangd.rst:114 + +There are multiple editors and plugins that are known to work with Clangd, such +as :program:`VSCode` and ``vscode-cl

[PATCH] D51297: [docs] Create a guide for Vim users on how to set up Clangd

2018-09-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/docs/clangd.rst:114 + +There are multiple editors and plugins that are known to work with Clangd, such +as :program:`VSCode` and ``vscode-clangd`` extension, :program:`Emacs` and Thanks! I would be nice

[PATCH] D51982: [clangd] Introduce PostingList interface

2018-09-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/dex/Dex.cpp:125 + for (const auto &TokenToPostingList : TempInvertedIndex) +InvertedIndex.insert( +{TokenToPostingList.first, nit: `InvertedIndex[TokenToPostingList.first] = bui

[PATCH] D51977: [clangd] Clarify and hide -index flag.

2018-09-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 165263. ioeric marked an inline comment as done. ioeric added a comment. - Remove `static`. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51977 Files: clangd/tool/ClangdMain.cpp Index: clangd/tool/ClangdMain.cpp

[PATCH] D51977: [clangd] Clarify and hide -index flag.

2018-09-13 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342134: [clangd] Clarify and hide -index flag. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D51977 Files: clang-tools-ex

[PATCH] D52078: [clangd] Store preamble macros in dynamic index.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: ilya-biryukov, sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. Pros: o Loading macros from preamble for every completion is slow (see profile). o Calculating macro USR is also slow (see profile). o Sema c

[PATCH] D52079: [Sema] Do not load macros from preamble when LoadExternal is false.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D52079 Files: include/clang/Sema/CodeCompleteOptions.h lib/Sema/SemaCodeComplete.cpp Index: lib/Sema/SemaCodeComplete.cpp ===

[PATCH] D52078: [clangd] Store preamble macros in dynamic index.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 165444. ioeric added a comment. - minor cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52078 Files: clangd/ClangdServer.cpp clangd/index/FileIndex.cpp clangd/index/FileIndex.h unittests/clangd/CodeCompleteTests.cpp unittest

[PATCH] D52078: [clangd] Store preamble macros in dynamic index.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/FileIndex.cpp:84 +Merged.insert(Macro); + for (const auto &Sym : Collector.takeSymbols()) +Merged.insert(Sym); ilya-biryukov wrote: > Why make an extra copy of the symbols? Why not add macros to the

[PATCH] D52089: [clangd] Get rid of AST matchers in SymbolCollector. NFC

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: ilya-biryukov, kadircet. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52089 Files: clangd/index/SymbolCollector.cpp Index: clangd/index/SymbolCollector.c

[PATCH] D52098: [Index] Add an option to collect macros from preprocesor.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, mgorny. Also added unit tests for the index library; lit+c-index-test is painful... Repository: rC Clang https://reviews.llvm.org/D52098 Files: include/clang/Index/IndexingAction.h

[PATCH] D52098: [Index] Add an option to collect macros from preprocesor.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 165514. ioeric added a comment. - remove debug message. Repository: rC Clang https://reviews.llvm.org/D52098 Files: include/clang/Index/IndexingAction.h lib/Index/IndexingAction.cpp unittests/CMakeLists.txt unittests/Index/CMakeLists.txt unittes

[PATCH] D52098: [Index] Add an option to collect macros from preprocesor.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 165516. ioeric added a comment. - another cleanup... Repository: rC Clang https://reviews.llvm.org/D52098 Files: include/clang/Index/IndexingAction.h lib/Index/IndexingAction.cpp unittests/CMakeLists.txt unittests/Index/CMakeLists.txt unittests/

[PATCH] D52078: [clangd] Store preamble macros in dynamic index.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 165517. ioeric added a comment. - Move macro collection to indexTopLevelDecls. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52078 Files: clangd/ClangdServer.cpp clangd/FindSymbols.cpp clangd/XRefs.cpp clangd/index/FileIndex.cpp c

[PATCH] D52078: [clangd] Store preamble macros in dynamic index.

2018-09-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D52078#1234667, @ilya-biryukov wrote: > ~1% increase in memory usage seems totally fine. Actually surprised it's that > small. Tested on a larger file: it's ~5% for `ClangdServer.cpp`. I think it's still worth it for the speedup.

[PATCH] D49540: [clangd] FuzzyMatch exposes an API for its word segmentation. NFC

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D49543: [clangd] Penalize non-instance members when accessed via class instances.

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov. The following are metrics for explicit member access completions. There is no noticeable impact on other completion types. Before: EXPLICIT_MEMBER_A

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337453: [CodeComplete] Fix accessibilty of protected members from base class. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337453: [CodeComplete] Fix accessibilty of protected members from base class. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D49421?vs=156146&id=156257#toc Repos

[PATCH] D48341: [clang-doc] Refactoring mapper to map by scope

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/test/clang-doc/yaml-record.cpp:44 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '06B5F6A19BA9F6A832E127C9968282B94619B210' +// CHECK-0-NEXT: Name:'C' juliehockett wrote: > ioeric wrote:

[PATCH] D49476: [Index] Set OrigD before D is changed.

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 156356. ioeric added a comment. - try to add a test case. Repository: rC Clang https://reviews.llvm.org/D49476 Files: lib/Index/IndexingContext.cpp test/Index/index-template-specialization.cpp tools/c-index-test/c-index-test.c tools/libclang/Index

[PATCH] D49476: [Index] Set OrigD before D is changed.

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D49476#1168604, @akyrtzi wrote: > `CXIndexDataConsumer.cpp` uses `ASTNode.OrigD`, that code is exercised when > you run `c-index-test -index-file <...>`. I'd recommend to at least check if > that command would produce a different output for th

[PATCH] D49476: [Index] Set OrigD before D is changed.

2018-07-20 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337529: [Index] Set OrigD before D is changed. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D49476 Files: cfe/trunk/lib/

[PATCH] D49543: [clangd] Penalize non-instance members when accessed via class instances.

2018-07-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 156738. ioeric marked 4 inline comments as done. ioeric added a comment. - addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49543 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/Quality.cpp clangd

[PATCH] D49543: [clangd] Penalize non-instance members when accessed via class instances.

2018-07-23 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337681: [clangd] Penalize non-instance members when accessed via class instances. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.

[PATCH] D49543: [clangd] Penalize non-instance members when accessed via class instances.

2018-07-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:146 +return false; + if (const auto *CM = dyn_cast(ND)) +return !CM->isStatic(); sammccall wrote: > I think we also have to consider template functions too? > And ideally I think we want to exc

[PATCH] D49667: [clangd] Tune down quality score for class constructors so that it's ranked after class types.

2018-07-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ilya-biryukov. Currently, class constructors have the same score as the class types, and they are often ranked before class types. This is often not desireable and

[PATCH] D49667: [clangd] Tune down quality score for class constructors so that it's ranked after class types.

2018-07-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:211 + case Constructor: +Score *= 1.0f; // Rank class constructors after class types. +break; ilya-biryukov wrote: > NIT: This does not seem to change the score, right? Maybe just the assignmen

[PATCH] D49667: [clangd] Tune down quality score for class constructors so that it's ranked after class types.

2018-07-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 156973. ioeric marked 2 inline comments as done. ioeric added a comment. - revert unintended changes. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49667 Files: clangd/Quality.cpp clangd/Quality.h unittests/clangd/QualityTests.cpp In

[PATCH] D49667: [clangd] Tune down quality score for class constructors so that it's ranked after class types.

2018-07-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/QualityTests.cpp:273 }); - SymbolRelevanceSignals Ctor; - Ctor.merge(CodeCompletionResult(CtorDecl, /*Priority=*/0)); - - EXPECT_EQ(Cls.Scope, SymbolRelevanceSignals::GlobalScope); - EXPECT_EQ(Ctor.Scope, SymbolRel

[PATCH] D49667: [clangd] Tune down quality score for class constructors so that it's ranked after class types.

2018-07-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE337816: [clangd] Tune down quality score for class constructors so that it's ranked… (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D49667?vs=156980&id=156981#t

[PATCH] D49667: [clangd] Tune down quality score for class constructors so that it's ranked after class types.

2018-07-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 156980. ioeric marked an inline comment as done. ioeric added a comment. - Make constructor boost no-op. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49667 Files: clangd/Quality.cpp clangd/Quality.h unittests/clangd/QualityTests.cpp

[PATCH] D49780: [clangd] Use a sigmoid style function for #usages boost in symbol quality.

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay. This has a shape to similar logrithm function but grows much slower for large #usages. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49780 F

[PATCH] D49780: [clangd] Use a sigmoid style function for #usages boost in symbol quality.

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 157207. ioeric marked 2 inline comments as done. ioeric added a comment. Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49780 Files: clangd/Quality.cpp unittests/clangd/CodeCompleteTests.cpp Index: unittests/

[PATCH] D49780: [clangd] Use a sigmoid style function for #usages boost in symbol quality.

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/Quality.cpp:200 +// f = 12.0 +// boost = f * sigmoid(m * std::log(References)) - 0.5 * f + 0.59 +// Sample data points: (10, 1.00), (100, 1.41), (1000, 1.82), ilya-biryukov wrote: > Made add referen

[PATCH] D49780: [clangd] Use a sigmoid style function for #usages boost in symbol quality.

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 157225. ioeric added a comment. s/better/nicely/ Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49780 Files: clangd/Quality.cpp unittests/clangd/CodeCompleteTests.cpp Index: unittests/clangd/CodeCompleteTests.cpp ==

[PATCH] D49780: [clangd] Use a sigmoid style function for #usages boost in symbol quality.

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE337907: [clangd] Use a sigmoid style function for #usages boost in symbol quality. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D49780?vs=157225&id=157226#toc

[PATCH] D49785: [clangd] Give an example for global-symbol-builder usage

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:153 - const char* Overview = - "This is an **experimental** tool to genera

[PATCH] D49546: [clangd] Proof-of-concept query iterators for Dex symbol index

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Implementation is in a good shape. I only have nits ;) Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:18 +namespace clangd { +namespace dex { + Please put all local classes and helpers in an anonymous namespace. ==

[PATCH] D49783: [clangd] Do not rebuild AST if inputs have not changed

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/TUScheduler.cpp:357 + +bool CanReuseAST = InputsAreTheSame && OldPreamble == NewPreamble; { nit: `(OldPreamble == NewPreamble)` Do you intend to compare the shared pointer instead of the values? ===

[PATCH] D49783: [clangd] Do not rebuild AST if inputs have not changed

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lg Comment at: clangd/TUScheduler.cpp:360 std::lock_guard Lock(Mutex); + OldPreamble.reset(); if (NewPreamble) ilya-biryukov wrote: > ioer

[PATCH] D48903: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

2018-07-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a subscriber: malaperle. ioeric added a comment. It would make it easier for your reviewers to look at the new changes if you just reopen this patch and update the diff :) Repository: rC Clang https://reviews.llvm.org/D48903 ___ cfe-

[PATCH] D49546: [clangd] Proof-of-concept query iterators for Dex symbol index

2018-07-26 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lg! just a few nits. Comment at: clang-tools-extra/clangd/index/dex/Iterator.cpp:109 +private: + /// Restores class invariants: each child should point to the same element.

[PATCH] D49991: [clangd] Do not build AST if no diagnostics were requested

2018-07-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D50045: [clangd] Report diagnostics even if WantDiags::No AST was reused

2018-07-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Overall LG, just a suggestion to make the code a bit easier to follow. Comment at: clangd/TUScheduler.cpp:379 + +if (DiagsWereReported) { // Take a shortcut and don't build the AST if neither the inputs nor the The implicit co

[PATCH] D50045: [clangd] Report diagnostics even if WantDiags::No AST was reused

2018-07-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clangd/TUScheduler.cpp:381 + DiagsWereReported = PrevDiagsWereReported; + if (DiagsWereReported) { +// Take a shortcut and don't report the

[PATCH] D48341: [clang-doc] Refactoring mapper to map by scope

2018-07-31 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clang-doc/Representation.cpp:49 +template +int isChildMergeNecessary(std::vector &Children, T &ChildToMerge) { + for (unsigned long I = 0; I < Children.size(); I++) { The function name doesn't describe

[PATCH] D50154: [clangd] capitalize diagnostic messages if '-capitialize-diagnostic-text' is provided

2018-08-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Is it possible for clangd to always capitalize diagnostics if `-capitialize-diagnostic-text` is found in the compile comand? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50154 ___ cfe-commits mailing list

[PATCH] D48341: [clang-doc] Refactoring mapper to map by scope

2018-08-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/test/clang-doc/bc-linkage.cpp:106 +// CHECK-0-NEXT: +// CHECK-0-NEXT: +// CHECK-0-NEXT:blob data = 'InnerClass' jul

<    1   2   3   4   5   6   7   8   9   10   >