[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

[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=137188#toc Repository: rCTE

[PATCH] D44732: [clangd] Set CLANGD_EDITOR environment variable in vscode extension.

2018-04-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein abandoned this revision. hokein added a comment. Herald added a subscriber: MaskRay. As discussed, we infer the editor from process tree which won't require changes in all clients. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44732

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

2018-04-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. pfultz2@, could you rebase this patch? The check has been moved to bugprone. https://reviews.llvm.org/D44231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45479: [Tooling] Optmized memory usage in InMemoryToolResults.

2018-04-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, klimek. Repository: rC Clang https://reviews.llvm.org/D45479 Files: include/clang/Tooling/Execution.h lib/Tooling/Execution.cpp Index: lib/Tooling/Execution.cpp

[PATCH] D45478: [clangd] Merge symbols in global-sym-builder on the go

2018-04-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for digging it out! In upstream, we use `InMemoryToolResults` which saves all duplicated "std::string"s into the memory, I think we could optimize `InMemoryToolResults` by using Arena to keep the memory low, I will try it to see whether it can reduce the memory.

[PATCH] D45479: [Tooling] Optmized memory usage in InMemoryToolResults.

2018-04-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 141822. hokein added a comment. Update. Repository: rC Clang https://reviews.llvm.org/D45479 Files: include/clang/Tooling/Execution.h lib/Tooling/AllTUsExecution.cpp lib/Tooling/Execution.cpp Index: lib/Tooling/Execution.cpp

[PATCH] D45426: [clangd] Allow using customized include path in URI.

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE329578: [clangd] Allow using customized include path in URI. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D45426?vs=141654=141655#toc Repository: rCTE

[PATCH] D45426: [clangd] Allow using customized include path in URI.

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 141650. hokein marked 3 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45426 Files: clangd/ClangdServer.cpp clangd/URI.cpp clangd/URI.h

[PATCH] D45426: [clangd] Allow using customized include path in URI.

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 141654. hokein marked an inline comment as done. hokein added a comment. includeSpelling Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45426 Files: clangd/ClangdServer.cpp clangd/URI.cpp clangd/URI.h

[PATCH] D45479: [Tooling] Optimize memory usage in InMemoryToolResults.

2018-04-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 141842. hokein edited the summary of this revision. hokein added a comment. Add a comment. Repository: rC Clang https://reviews.llvm.org/D45479 Files: include/clang/Tooling/Execution.h lib/Tooling/AllTUsExecution.cpp lib/Tooling/Execution.cpp

[PATCH] D45512: [Tooling] Correct the "-std" compile command option.

2018-04-11 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329786: [Tooling] Correct the -std compile command option. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D45512 Files:

[PATCH] D45512: [Tooling] Correct the "-std" compile command option.

2018-04-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a subscriber: klimek. "-std c++11" is not valid in compiler, we have to use "-std=c++11". Test in vscode with this patch, code completion for header works as expected. Repository: rC Clang

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: MaskRay, ioeric, jkorous-apple, ilya-biryukov, klimek. LSP is using Line & column as symbol position, clangd needs to transfer file offset to Line & column when sending results back to LSP client, which is

[PATCH] D45479: [Tooling] Optimize memory usage in InMemoryToolResults.

2018-04-11 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC329784: [Tooling] Optimize memory usage in InMemoryToolResults. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D45479?vs=141842=141956#toc Repository: rC

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 142170. hokein marked 5 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45513 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/SymbolCollector.cpp

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:39 // using half-open range, [StartOffset, EndOffset). + // FIXME(hokein): remove these fields in favor of Position. unsigned StartOffset = 0; sammccall wrote: > I don't think we should remove

[PATCH] D44882: [clangd] Implementation of workspace/symbol request

2018-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. @malaperle, what's your plan of this patch? Are you going to land it before https://reviews.llvm.org/D45513? With the Line info in the index, this patch could be simplified. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44882

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 142195. hokein marked 3 inline comments as done. hokein added a comment. Update the patch, address remaining issues. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45513 Files: clangd/index/Index.cpp clangd/index/Index.h

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:32 +// Character offset on a line in a document (zero-based). +int Character = 0; + }; sammccall wrote: > sammccall wrote: > > Column? > > > > LSP calls this "character" but this is

[PATCH] D45426: [clangd] Allow using customized include path in URI.

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/URI.h:66 + /// + /// If the returned string is non-empty, clangd will use it directly when + /// doing include insertion; otherwise we will fall back to the clang to

[PATCH] D45426: [clangd] Allow using customized include path in URI.

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: MaskRay, ioeric, jkorous-apple, ilya-biryukov, klimek. Calculating the include path from absolute file path does not always work for all build system, e.g. bazel uses symlink as the build working

[PATCH] D45405: [clang-tidy] [modernize-use-auto] Add a threshold for minimal type name length to be replaced with 'auto'

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: docs/clang-tidy/checks/modernize-use-auto.rst:202 + neither warn nor fix type names having a length less than the option value. + The option affects expressions only, not iterators. + nit: document the default value.

[PATCH] D45285: [clangd-vscode] Update VScode dependencies

2018-04-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D45285#1061243, @ilya-biryukov wrote: > In https://reviews.llvm.org/D45285#1058567, @malaperle wrote: > > > Do we need to bump the version of the extension and do a new release or > > anything like that? Or leave this for later? > > > We

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:32 +// Character offset on a line in a document (zero-based). +int Character = 0; + }; MaskRay wrote: > hokein wrote: > > sammccall wrote: > > > sammccall wrote: > > > > Column? > > > > > >

[PATCH] D45513: [clangd] Add line and column number to the index symbol.

2018-04-13 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE329997: [clangd] Add line and column number to the index symbol. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D45513?vs=142195=142349#toc Repository: rCTE

[PATCH] D44882: [clangd] Implementation of workspace/symbol request

2018-04-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D44882#1065932, @malaperle wrote: > In https://reviews.llvm.org/D44882#1065787, @hokein wrote: > > > @malaperle, what's your plan of this patch? Are you going to land it before > > https://reviews.llvm.org/D45513? With the Line info in the

[PATCH] D45692: [clangd] Fix "fail to create file URI" warnings in FileIndexTest.

2018-04-17 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL330182: [clangd] Fix fail to create file URI warnings in FileIndexTest. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: MaskRay, ioeric, jkorous-apple, ilya-biryukov, klimek. This patch adds index support for GoToDefinition -- when we don't get the definition from local AST, we query our index (Static) index to get it.

[PATCH] D45697: [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.

2018-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: test/clang-tidy/read_file_config.cpp:5 +// RUN: echo '[{"command": "cc -c -o test.o test.cpp", "directory": "%T/read-file-config", "file": "%T/read-file-config/test.cpp"}]' > %T/read-file-config/compile_commands.json +// RUN:

[PATCH] D45697: [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.

2018-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 142759. hokein marked an inline comment as done. hokein added a comment. Add one more test to ensure the test code triggering "clang-analyzer-*" checks. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45697 Files:

[PATCH] D44882: [clangd] Implementation of workspace/symbol request

2018-04-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Herald added a subscriber: jkorous. Comment at: clangd/FindSymbols.cpp:117 +} +auto Path = URI::resolve(*Uri); +if (!Path) { The current URI scheme (`file`, `test`) works fine without `HintPath` because they don't use

[PATCH] D45697: [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.

2018-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: test/clang-tidy/read_file_config.cpp:1 +// RUN: mkdir -p %T/read-file-config/ +// RUN: cp %s %T/read-file-config/test.cpp JonasToth wrote: > Will this work on windows? I believe it works on windows (although I don't have

[PATCH] D45697: [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.

2018-04-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL330245: [clang-tidy] Fix clang-tidy doesnt read .clangtidy configuration file. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D45692: [clangd] Fix "fail to create file URI" warnings in FileIndexTest.

2018-04-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Herald added subscribers: MaskRay, jkorous-apple, ilya-biryukov, klimek. When running the FileIndexTest, it shows "Failed to create an URI for file XXX: not a valid absolute file path" warnings, and the generated Symbols is missing

[PATCH] D45697: [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.

2018-04-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: alexfh. Herald added subscribers: xazax.hun, klimek. Fix https://bugs.llvm.org/show_bug.cgi?id=34900. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45697 Files: clang-tidy/ClangTidyOptions.cpp

[PATCH] D46035: [clangd] Fix unicode handling, using UTF-16 where LSP requires it.

2018-04-25 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. Cool, the code looks good to me (just a few nits), thanks for the descriptive comments! > This seems likely to cause problems with editors that have the same bug, and > treat the protocol as

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 143508. hokein marked 7 inline comments as done. hokein added a comment. Refine the patch and address all review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45717 Files: clangd/ClangdServer.cpp clangd/XRefs.cpp

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I have updated the patch according to offline discussion -- for each symbol, we will return both decl and def locations (if available, def first) as they seems to be most sensible to users. We always prefer location from AST over Index when conflicts.

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the useful comments! I refined the patch, and it becomes a bit larger (including some moving stuff). Comment at: clangd/XRefs.cpp:137 + +IdentifiedSymbol getSymbolAtPosition(ParsedAST , SourceLocation Pos) { + auto DeclMacrosFinder =

[PATCH] D45717: [clangd] Using index for GoToDefinition.

2018-04-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 143728. hokein marked 14 inline comments as done. hokein added a comment. Address review comments: - clarify the flow of go to definition. - simplify the test code. - some function move-out stuff. Repository: rCTE Clang Tools Extra

[PATCH] D45697: [clang-tidy] Fix clang-tidy doesn't read .clangtidy configuration file.

2018-04-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 142817. hokein marked an inline comment as done. hokein added a comment. Make grep pattern more obvious. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45697 Files: clang-tidy/ClangTidyOptions.cpp clang-tidy/ClangTidyOptions.h

[PATCH] D46065: [clangd] Add "str()" method to SymbolID.

2018-04-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Herald added subscribers: jkorous, MaskRay, ilya-biryukov, klimek. This is a convenient function when we try to get std::string of SymbolID. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D46065 Files:

[PATCH] D46065: [clangd] Add "str()" method to SymbolID.

2018-04-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/index/Index.h:72 + // Returns a 40-bytes hex encoded string. + std::string str() const; ioeric wrote: > I think Sam wants to reduce the size to 20 bytes. Maybe just

[PATCH] D46065: [clangd] Add "str()" method to SymbolID.

2018-04-25 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 rL330835: [clangd] Add str() method to SymbolID. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM

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

2018-04-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329073: [clang-tidy] Check for sizeof that call functions (authored by hokein, committed by ). Herald added subscribers: llvm-commits, klimek. Changed prior to commit:

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

2018-04-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks, I have committed for you. Repository: rL LLVM https://reviews.llvm.org/D44231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44882: [clangd] Implementation of workspace/symbol request

2018-04-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/ClangdLSPServer.cpp:258 +if (!Items) + return replyError(ErrorCode::InvalidParams, +llvm::toString(Items.takeError())); `InvalidParams` doesn't match all cases where

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

2018-04-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Sorry for the delay -- everyone was out because of the long Easter weekend. I'll commit for you. https://reviews.llvm.org/D44231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D44732: [clangd] Set CLANGD_EDITOR environment variable in vscode extension.

2018-03-21 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 would allow us to log the editor using custom-built clangd. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44732 Files:

[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] 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] 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

[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.

[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

[PATCH] D48687: [clangd] Avoid duplicates in findDefinitions response

2018-06-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > Could we try to figure out why the duplicates were there in the first place > and why the paths were different? +1, I think there are two issues here: 1. the result contains two candidates, which should be one, IIUC. 2. the absolute file path problem, we encountered

[PATCH] D48714: [clang-tidy] fix PR37913, templated exception factory diagnosed correctly

2018-06-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: test/clang-tidy/hicpp-exception-baseclass.cpp:191 +void templated_thrower() { throw T{}(); } +// CHECK-MESSAGES: [[@LINE-1]]:34: warning: throwing an exception whose type 'int' is not derived from 'std::exception' + I

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

2018-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 168638. hokein added a comment. clang-format. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52979 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h unittests/clangd/FileIndexTests.cpp Index:

[PATCH] D52976: [clangd] Update the out-of-date yaml-symbol-file flag in clangd.

2018-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D52976#1257614, @sammccall wrote: > Hmm, I wonder if we should remove "experimental" text and the hidden bit. Or > wait to see if we want to move to automatic index entirely? Our plan seems unclear at the moment, so I would suggest not doing

[PATCH] D52976: [clangd] Update the out-of-date yaml-symbol-file flag in clangd.

2018-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 168639. hokein added a comment. address comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52976 Files: clangd/tool/ClangdMain.cpp Index: clangd/tool/ClangdMain.cpp

[PATCH] D52445: [Index] Use locations to uniquify function-scope BindingDecl USR

2018-10-08 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. The change looks reasonable to me, so lg. I'd wait a bit to see whether other reviewers have comments. Comment at: lib/Index/USRGeneration.cpp:339 +void

[PATCH] D52976: [clangd] Update the out-of-date yaml-symbol-file flag in clangd.

2018-10-08 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343963: [clangd] Update the out-of-date yaml-symbol-file flag in clangd. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D52976: [clangd] Update the out-of-date yaml-symbol-file flag in clangd.

2018-10-08 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 flag is stale due to the recent changes of clangd indexer, this patch rename it to "index-file". Repository: rCTE Clang Tools Extra

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

2018-10-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: ioeric, sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Currently we don't cleanup dynamic index if a file is closed in clangd, which may result in large memory consumption in clangd (if we open many

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

2018-10-08 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: > should we use this somewhere? E.g. when file is closed in ClangdServer? Yes,

[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:

[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

[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:

[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

[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

[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=169684#toc Repository: rCTE Clang

[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

[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 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=169713#toc Repository: rCTE Clang Tools Extra

[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] 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

[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:

[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=170094#toc Repository: rL LLVM

[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.

[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",

[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 >

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

2018-10-19 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344777: [clangd] Remove the overflow log. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53400 Files:

[PATCH] D53369: [CodeComplete] Fix accessibility of protected members when accessing members implicitly.

2018-10-19 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. The change looks reasonable to me, I'd let @ilya-biryukov take a second look. Repository: rC Clang https://reviews.llvm.org/D53369 ___

[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

[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:

[PATCH] D53489: [change-namespace] Enhance detection of conflicting namespaces.

2018-10-22 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/D53489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[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

[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=169968#toc Repository: rCTE Clang Tools Extra

[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

[PATCH] D53347: [clangd] Simplify auto hover

2018-10-17 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 &&

[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

[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

[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:

[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

[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

<    3   4   5   6   7   8   9   10   11   12   >