[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 129272. hokein added a comment. Remove the temporary fix. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComp

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/CodeComplete.cpp:661 + if (CompletedName.SSInfo) { +// For a namespace scope specifier ("ns::"), we have disabled Sema from +// collecting completion results by setting IncludeNames

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rCTE322191: [clangd] Add static index for the global code completion. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D41668

[PATCH] D43766: [clang-tidy][modernize-make-unique] Checks c++14 flag before using std::make_unique

2018-02-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the patch! The check provides `MakeSmartPtrFunction` option. Users can use it to customize their self-implemented `make_unique` function (instead of using the c++14 available `std::make_unique`) even in their C++11 code. I think we need to keep the backward c

[PATCH] D43775: add UUID to the acronyms list of objc property name checks

2018-02-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The change seems good to me. I'd leave the approval to @benhamilton since he has more context on objc. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43775 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D43778: [clang-tidy] Adding RestrictIncludes check to Fuchsia module

2018-02-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: docs/clang-tidy/checks/fuchsia-restrict-includes.rst:27 + + A string containing a comma-separated list of header filenames to restrict. Default is an empty string. The check seems do nothing with the default option. D

[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

2018-03-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/CanonicalIncludes.cpp:83 + static const std::vector> SymbolMap = { + // Map symbols in to their preferred includes. + {"std::basic_filebuf", ""}, Looks like the list only contains stream-related s

[PATCH] D43847: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith

2018-03-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D43847#1021967, @aaron.ballman wrote: > I need a bit more context because I'm unfamiliar with `absl`. What is this > module's intended use? As `absl` has been open-sourced (https://github.com/abseil/abseil-cpp), I think there will be more ab

[PATCH] D43847: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith

2018-03-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/absl/StringFindStartswithCheck.cpp:1 +#include "StringFindStartswithCheck.h" + nit: We need a LICENSE comment at the top of the file. Comment at: clang-tidy/absl/StringFindStartswithCheck.cpp

[PATCH] D43847: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith

2018-03-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D43847#1025846, @Eugene.Zelenko wrote: > In https://reviews.llvm.org/D43847#1025833, @niko wrote: > > > Thanks everyone for your comments! I renamed the namespace and filenames to > > 'abseil'. > > > > @Eugene.Zelenko, definitely interested in

[PATCH] D44137: [clang-tidy] Fix one corner case in make-unique check.

2018-03-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: xazax.hun, klimek. Previously, we tried to cover all "std::initializer_list" implicit conversion cases in the code, but there are some corner cases that not covered (see newly-added test in the patch).

[PATCH] D44138: [clangd] Sort includes when formatting code or inserting new includes.

2018-03-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D44137: [clang-tidy] Fix one corner case in make-unique check.

2018-03-06 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE326799: [clang-tidy] Fix one corner case in make-unique check. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44137?vs=137136&id=137188#toc Repository: rCTE

[PATCH] D43847: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith

2018-03-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Looks good with a few nits. Comment at: clang-tidy/abseil/AbseilTidyModule.cpp:15 + +#include + What is this header used for? Comment at:

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: ioeric, jkorous-apple, ilya-biryukov, klimek. This also matches the range in symbol index. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44247 Files: clangd/SourceCode.cpp clangd/So

[PATCH] D44231: [clang-tidy] Check for sizeof that call functions

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Can you elaborate a bit more about this? I think we also need to update the check document (adding proper section of this new behavior, and the new option). Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44231 _

[PATCH] D44251: [clangd] Early return for #include goto definition.

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: ioeric, jkorous-apple, klimek. This would save cost of unnecessary parsing, NFC. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44251 Files: clangd/XRefs.cpp Index: clangd/XRefs.

[PATCH] D43847: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I will commit for you. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44251: [clangd] Early return for #include goto definition.

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D44251#1031373, @ilya-biryukov wrote: > Sorry, being pedantic here... We're not saving time on parsing, but on > walking over the AST :-) Yeah, rephased it. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44251 __

[PATCH] D44251: [clangd] Early return for #include goto definition.

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327023: [clangd] Early return for #include goto definition. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D44251 Files: c

[PATCH] D44251: [clangd] Early return for #include goto definition.

2018-03-08 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327023: [clangd] Early return for #include goto definition. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44251?vs=137559&id=137581#toc Repository: rCTE Cl

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: ioeric, jkorous-apple, klimek. DeclrationAndMacrosFinder will find some declarations (not macro!) that are referened inside the macro somehow, isSearchedLocation() is not sufficient, we don't know wheth

[PATCH] D44294: [clangd] Fix diagnostic errors in the test code, NFC.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: ioeric, jkorous-apple, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44294 Files: unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRefsTests.cpp ==

[PATCH] D43847: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327111: [clang-tidy] Add check: replace string::find(...) == 0 with absl::StartsWith (authored by hokein, committed by ). Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43847 Files:

[PATCH] D44294: [clangd] Fix diagnostic errors in the test code, NFC.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 137712. hokein marked an inline comment as done. hokein added a comment. Use #program once Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44294 Files: unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRefsTests.cpp ===

[PATCH] D44294: [clangd] Fix diagnostic errors in the test code, NFC.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: unittests/clangd/XRefsTests.cpp:587 - const char *HeaderContents = R"cpp([[]]int a;)cpp"; + const char *HeaderContents = R"cpp([[]]#ifndef TEST_H_ + #define TEST_H_ ilya-biryukov wr

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 137720. hokein marked 7 inline comments as done. hokein added a comment. Herald added a subscriber: mgorny. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44247 Files: clangd/AST.cpp clangd/AST.h clangd/CMakeLi

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the comments! Comment at: clangd/SourceCode.cpp:55 + const auto& SM = D->getASTContext().getSourceManager(); + SourceLocation SpellingLoc = SM.getSpellingLoc(D->getLocation()); + if (D->getLocation().isMacroID()) { sammccal

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327129: [clangd] Use identifier range as the definition range. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44247?vs=137720&id=137736#toc Repository: rL L

[PATCH] D44247: [clangd] Use identifier range as the definition range.

2018-03-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327129: [clangd] Use identifier range as the definition range. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D44247?vs=1

[PATCH] D44315: [clangd] Collect the number of files referencing a symbol in the static index.

2018-03-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Looks good. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:201 std::vector MacroInfos = DeclMacrosFinder->takeMacroInfos(); + if (!MacroInfos.empty()) { +for (auto Item : MacroInfos) { ilya-biryukov wrote: > I wonder whether we should fix the `DeclrationA

[PATCH] D44294: [clangd] Fix diagnostic errors in the test code, NFC.

2018-03-12 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327293: [clangd] Fix diagnostic errors in the test code, NFC. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44294?vs=137712&id=138039#toc Repository: rCTE

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 138147. hokein marked an inline comment as done. hokein added a comment. Address review comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44293 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRefs

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:201 std::vector MacroInfos = DeclMacrosFinder->takeMacroInfos(); + if (!MacroInfos.empty()) { +for (auto Item : MacroInfos) { ilya-biryukov wrote: > hokein wrote: > > ilya-biryukov wrote: > > > I

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 138160. hokein marked an inline comment as done. hokein added a comment. Rephrase the fixme. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44293 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRefsTest

[PATCH] D44293: [clangd] Fix irrelevant declaratations in goto definition (on macros).

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327387: [clangd] Fix irrelevant declaratations in goto definition (on macros). (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44293?vs=138160&id=138162#toc Re

[PATCH] D44423: [clangd] Use the macro name range as the definition range.

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: ioeric, jkorous-apple, ilya-biryukov, klimek. This also aligns with the behavior of declarations. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44423 Files: clangd/XRefs.cpp unittes

[PATCH] D44423: [clangd] Use the macro name range as the definition range.

2018-03-13 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE327401: [clangd] Use the macro name range as the definition range. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D44423?vs=138163&id=138189#toc Repository:

[PATCH] D43766: [clang-tidy][modernize-make-unique] Checks c++14 flag before using std::make_unique

2018-03-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. > I think all requested modifications were done. Next time, please consider marking all the review comments done in phabricator, so that reviewers can see it obviously. https://review

[PATCH] D44517: [change-namespace] Don't match a function call/ref multiple times.

2018-03-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44517 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D44231: [clang-tidy] Check for sizeof that call functions

2018-03-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. As this patch can catch some mistakes, I'm fine with checking it in. I agree that it is reasonable to write normal code like `sizeof(func_call())` (not false positive), maybe set the option to `false` by default? https://reviews.llvm.org/D44231 __

[PATCH] D47699: [clangd] Remove the dead offset fields in Symbol.

2018-06-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: jkorous, MaskRay, ioeric, ilya-biryukov, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47699 Files: clangd/index/Index.h Index: clangd/index/Index.h ==

[PATCH] D47699: [clangd] Remove the dead offset fields in Symbol.

2018-06-04 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL333882: [clangd] Remove the dead offset fields in Symbol. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D47699 Files: cla

[PATCH] D47704: [clang-tidy] Improve string type matcher for abseil-string-find-starts-with check.

2018-06-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: alexfh. Herald added subscribers: xazax.hun, klimek. This patch improves the check to match the desugared "string" type (so that it can handle custom-implemented string classes), see the newly-added test. Repository: rCTE Clang Tools Extra

[PATCH] D46684: [Frontend] Don't skip function body when the return type is dependent on the template parameter.

2018-06-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein abandoned this revision. hokein added a comment. Abandon this, since @ilya-biryukov has fixed it in https://reviews.llvm.org/D44480. Repository: rC Clang https://reviews.llvm.org/D46684 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D47821: [clangd] Make workspace/symbols actually rank its results.

2018-06-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clangd/FindSymbols.cpp:159 +else + return; +Relevance.merge(Sym); Should we add a log statement here? IMO, this rarely happens

[PATCH] D47869: [clangd] Fix using the incorrect Index for go-to-definition.

2018-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: jkorous, MaskRay, ioeric, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47869 Files: clangd/ClangdServer.cpp Index: clangd/ClangdServer.cpp

[PATCH] D47869: [clangd] Fix using the incorrect Index for go-to-definition.

2018-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 150276. hokein added a comment. this->Index => Index. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D47869 Files: clangd/ClangdServer.cpp Index: clangd/ClangdServer.cpp ===

[PATCH] D47869: [clangd] Fix using the incorrect Index for go-to-definition.

2018-06-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rCTE334176: [clangd] Fix using the incorrect Index for go-to-definition. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D47

[PATCH] D47704: [clang-tidy] Improve string type matcher for abseil-string-find-starts-with check.

2018-06-08 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL334270: [clang-tidy] Improve string type matcher for abseil-string-find-starts-with… (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.ll

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53019 Files: clangd/index/dex/dexp/Dexp.cpp Index: clangd/index/dex/dexp/De

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 168801. hokein marked 3 inline comments as done. hokein added a comment. Herald added a subscriber: mgorny. Address review comments: - provide query by qualified name (with -name) - add -name support for Lookup. Repository: rCTE Clang Tools Extra https://

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/dex/dexp/Dexp.cpp:204 {"lookup", "Dump symbol details by ID", llvm::make_unique}, +{"refs", "Find references by qualified name", llvm::make_unique}, }; sammccall wrote: > I'm not sure "by qualified

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 168802. hokein added a comment. Minor fix. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53019 Files: clangd/index/dex/dexp/CMakeLists.txt clangd/index/dex/dexp/Dexp.cpp Index: clangd/index/dex/dexp/Dexp.cpp ===

[PATCH] D53060: [clang-move] Remove clang:: qualifier

2018-10-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks for the cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53060 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D52979: [clangd] Add removeFile interface in FileIndex.

2018-10-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/FileIndex.h:78 + /// Remove all index data associated with the file \p Path. + void removeFile(PathRef Path); + ioeric wrote: > hokein wrote: > > ioeric wrote: > > > should we use this somewhere? E.g. when

[PATCH] D53186: [clangd] Support hover on "aut^o *".

2018-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53186 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index: unittests/clangd

[PATCH] D53188: [clangd] XRef C++ API returns structure results, NFC

2018-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. The representation of references in LSP is limitted (just location information). This patch makes our xref C++ API return structured results, w

[PATCH] D53186: [clangd] Support hover on "aut^o *".

2018-10-12 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344330: [clangd] Support hover on "aut^o *". (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D53186?vs=169357&id=169363#to

[PATCH] D53188: [clangd] XRef C++ API returns structure results, NFC

2018-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein planned changes to this revision. hokein added a comment. As discussed offline, we don't have a clear motivation to do it now, and LSP will likely introduce a new `References` type of xrefs (https://github.com/Microsoft/language-server-protocol/issues/396), so I'll leave this patch opene

[PATCH] D53273: [clangd] Fix some references missing in dynamic index.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Previously, SymbolCollector postfilters all references at the end to find all references of interesting symbols. It was incorrect when indxing m

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 169668. hokein marked 2 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53019 Files: clangd/index/dex/dexp/CMakeLists.txt clangd/index/dex/dexp/Dexp.cpp Index: cla

[PATCH] D53273: [clangd] Fix some references missing in dynamic index.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/SymbolCollector.cpp:348 + if (!shouldCollectSymbol(*ND, *ASTCtx, Opts)) +return true; sammccall wrote: > This seems better for the main-AST case, but substantially more expensive for > indexing preamb

[PATCH] D53273: [clangd] Fix some references missing in dynamic index.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 169671. hokein marked an inline comment as done. hokein added a comment. avoid calling shouldCollectSymbol every time during indexing. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53273 Files: clangd/index/SymbolCollector.cpp unittests

[PATCH] D53273: [clangd] Fix some references missing in dynamic index.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344507: [clangd] Fix some references missing in dynamic index. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53273 Files:

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 169683. hokein marked 3 inline comments as done. hokein added a comment. Fix global scope, and clang-format. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53019 Files: clangd/index/dex/dexp/CMakeLists.txt clangd/index/dex/dexp/Dexp.cpp

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/dex/dexp/Dexp.cpp:61 + Request.Scopes.emplace_back(); + std::tie(Request.Scopes.back(), Request.Query) = + clang::clangd::splitQualifiedName(QualifiedName); sammccall wrote: > Are you sure you want bot

[PATCH] D53019: [clangd] dump xrefs information in dexp tool.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344508: [clangd] dump xrefs information in dexp tool. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D53019?vs=169683&id=169684#toc Repository: rCTE Clang To

[PATCH] D53288: [clangd] Optionally use dex for the preamble parts of the dynamic index.

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clangd/ClangdServer.h:79 +/// Use a heavier and faster in-memory index implementation. +/// FIXME: we should make this true if it isn't too slow!. +

[PATCH] D53292: [clangd] Add createIndex in dexp

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. This would allow easily injecting our internal customization. Also updates the stale "symbol-collection-file" flag. Repository: rCTE Clang

[PATCH] D53292: [clangd] Add createIndex in dexp

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 169712. hokein marked 2 inline comments as done. hokein added a comment. createIndex => openIndex Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53292 Files: clangd/index/dex/dexp/Dexp.cpp Index: clangd/index/dex/dexp/Dexp.cpp ==

[PATCH] D53292: [clangd] Add createIndex in dexp

2018-10-15 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344521: [clangd] Add createIndex in dexp (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D53292?vs=169712&id=169713#toc Repository: rCTE Clang Tools Extra ht

[PATCH] D53322: [clangd] Collect refs from headers.

2018-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. 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 dyn

[PATCH] D53322: [clangd] Collect refs from headers.

2018-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. For references, the binary-format index file (for whole llvm project) size: | Before | WithRef | | 50MB | 91MB| Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53322 ___ cfe-commits mailing list cfe-com

[PATCH] D53347: [clangd] Simplify auto hover

2018-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. looks good! didn't know this API before. Comment at: clangd/XRefs.cpp:592 -auto DeclT = UnwrapReferenceOrPointer(D->getType()); -const AutoType *AT = dyn_cast(DeclT.getTypePtr()); -if (AT && !AT->getDeducedTyp

[PATCH] D53322: [clangd] Collect refs from headers.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 169963. hokein marked 5 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53322 Files: clangd/index/IndexAction.cpp clangd/index/IndexAction.h clangd/index/SymbolCo

[PATCH] D53322: [clangd] Collect refs from headers.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D53322#1266536, @sammccall wrote: > (please do check there are no duplicates in the output) We do deduplication when building the RefSlab. And double-checked with the output, no duplications there. Repository: rCTE Clang Tools Extra http

[PATCH] D53322: [clangd] Collect refs from headers.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 169967. hokein added a comment. minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53322 Files: clangd/index/IndexAction.cpp clangd/index/IndexAction.h clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unit

[PATCH] D53322: [clangd] Collect refs from headers.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344678: [clangd] Collect refs from headers. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D53322?vs=169967&id=169968#toc Repository: rCTE Clang Tools Extra

[PATCH] D53363: [clangd] Encode Line/Column as a 32-bits integer.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. This would buy us more memory. Using a 32-bits integer is enough for most human-readable source code (up to 4M lines and 4K columns). Previsoul

[PATCH] D53363: [clangd] Encode Line/Column as a 32-bits integer.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 170001. hokein marked 3 inline comments as done. hokein added a comment. Address review comments: - handle overflowed cases, and added tests - add getter/setters for line/column and clear all call sides Repository: rCTE Clang Tools Extra https://reviews.l

[PATCH] D53363: [clangd] Encode Line/Column as a 32-bits integer.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D53363#1267628, @sammccall wrote: > (I think your math is off in the description: 20 bits should be 1M lines, not > 4M) Oops...Update the desccription. > I think this is a win, as I think truncation will be rare and not terrible. > We shoul

[PATCH] D53377: [clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.

2018-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: alexfh. Herald added a subscriber: xazax.hun. Previously, ptr.reset(new char[5]) will be replaced with `p = make_unique(5)`, the fix has side effect -- doing default initialization, it may cause performace regression (we are bitten by this rec

[PATCH] D53363: [clangd] Encode Line/Column as a 32-bits integer.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 170053. hokein marked 6 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53363 Files: clangd/FindSymbols.cpp clangd/XRefs.cpp clangd/index/Index.cpp clangd/index

[PATCH] D53363: [clangd] Encode Line/Column as a 32-bits integer.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > In https://reviews.llvm.org/D53363#1267721, @hokein wrote: > >> Yeah, I have a rough patch for it, using char* will save us ~50MB memory, >> which will lead to ~300 MB memory usage in total. > > > For just the StringRef in SymbolLocation::Position, or for all our stri

[PATCH] D53377: [clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344733: [clang-tidy] Ignore a case where the fix of make_unique check introduces side… (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.

[PATCH] D53377: [clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344733: [clang-tidy] Ignore a case where the fix of make_unique check introduces side… (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D53377?vs=170012&id=170054

[PATCH] D53389: [clangd] Clear the semantic of RefSlab::size.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. The RefSlab::size can easily cause confusions, it returns the number of different symbols, rahter than the number of all references. - rename s

[PATCH] D53389: [clangd] Clear the semantic of RefSlab::size.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 170063. hokein added a comment. - reserve the size name, added a comment indicating its senmatic. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53389 Files: clangd/index/Background.cpp clangd/index/FileIndex.cpp clangd/index/Index.cpp

[PATCH] D53389: [clangd] Clear the semantic of RefSlab::size.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D53389#1268250, @sammccall wrote: > Adding numRefs() and fixing occurrences makes sense. > However I think `size()` needs to stay - it's an important part of the > "container" concept, and e.g. GTest relies on it. OK, and I added a comment f

[PATCH] D53363: [clangd] Encode Line/Column as a 32-bits integer.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344735: [clangd] Encode Line/Column as a 32-bits integer. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D53363?vs=170053&id=170064#toc Repository: rCTE Clan

[PATCH] D53400: [clangd] Remove the overflow log.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. LLVM codebase has generated files (all are build/Target/XXX/*.inc) that exceed the MaxLine & MaxColumn. Printing these log would be noisy. Rep

[PATCH] D53391: [clangd] Embed fixes as CodeAction, instead of clangd_fixes. Clean up serialization.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clangd/ClangdLSPServer.cpp:558 json::Object{ {"uri", URIForFile{File}}, +{"diagnostics", std::move

[PATCH] D53400: [clangd] Remove the overflow log.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 170091. hokein added a comment. Add log in XRefs.cpp. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53400 Files: clangd/XRefs.cpp clangd/index/Index.cpp Index: clangd/index/Index.cpp ===

[PATCH] D53389: [clangd] Clear the semantic of RefSlab::size.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344745: [clangd] Clear the semantic of RefSlab::size. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53389 Files: clang-t

[PATCH] D53389: [clangd] Clear the semantic of RefSlab::size.

2018-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344745: [clangd] Clear the semantic of RefSlab::size. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D53389?vs=170063&id=170094#toc Repository: rL LLVM http

[PATCH] D53400: [clangd] Remove the overflow log.

2018-10-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 170157. hokein marked an inline comment as done. hokein added a comment. Log the whole location when overflow happens. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53400 Files: clangd/XRefs.cpp clangd/index/Index.cpp clangd/index/Ind

[PATCH] D53400: [clangd] Remove the overflow log.

2018-10-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:43 + if (Line >= SymbolLocation::Position::MaxLine) +log("Get an overflowed line"); + return Line; sammccall wrote: > Log message could use more context. And I think it'd be really useful to > prin

[PATCH] D53400: [clangd] Remove the overflow log.

2018-10-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 170159. hokein added a comment. Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53400 Files: clangd/XRefs.cpp clangd/index/Index.cpp clangd/index/Index.h unittests/clangd/IndexTests.cpp Index: unittests/clangd/IndexTe

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