[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: clang-tools-extra/t

[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 ___ cfe-com

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-10-19 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 save us 8 bytes per ref, and buy us ~50MB in total for llvm index (from ~350MB to ~300 MB). The char pointer must be null-terminated

[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 http://lists.l

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Could you also update the check documentation `clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst`? Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:83 + } else { +llvm_unreachable("Invalid state"); } ---

[PATCH] D53572: [clangd] Lazily create CDB, remove setCompileCommandsDir.

2018-10-23 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/D53572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D53577: [clangd] Hide position line and column fields.

2018-10-23 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/D53577 Files: clangd/index/Index.h Index: clangd/index/Index.h =

[PATCH] D53339: [clang-tidy] Add the abseil-duration-factory-float check

2018-10-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. looks good, just a few nits. Comment at: clang-tidy/abseil/AbseilTidyModule.cpp:32 +CheckFactories.registerCheck( +"abseil-duration-factory-float"); CheckFactories.registerCheck( Maybe drop the `factory`? we already have

[PATCH] D53577: [clangd] Hide position line and column fields.

2018-10-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345134: [clangd] Hide position line and column fields. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D53577 Files: clang-

[PATCH] D53339: [clang-tidy] Add the abseil-duration-factory-float check

2018-10-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. LGTM. Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:94 + diag(MatchedCall->getBeginLoc(), + (llvm::Twine("Use integer version of absl::") + +MatchedCall->getDirectCallee()->getName()

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D53488#1275750, @gchatelet wrote: > In https://reviews.llvm.org/D53488#1274205, @JonasToth wrote: > > > Did you run this code over a real-world code-base and did you find new > > stuff and/or false positives or the like? > > > Yes I did run it

[PATCH] D53808: [clangd] Don't collect refs from non-canonical headers.

2018-10-29 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. With this patch, we only collect refs for canonical headers (headers with header guards). As non-canonical headers are usually generated, and no

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 181232. hokein added a comment. Rebase Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55256/new/ https://reviews.llvm.org/D55256 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServe

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I think this patch is ready for review now. ClangTidy configurations are complicated, and we aim to support only a small subset of them (most are about controlling which checks are going to run in clangd). I'd like to get some initial feedbacks before making further chan

[PATCH] D56597: [clangd] Add Limit parameter for xref.

2019-01-11 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/D56597 Files: clangd/ClangdLSPServer.cpp clangd/ClangdServer.cpp clangd/Cl

[PATCH] D56597: [clangd] Add Limit parameter for xref.

2019-01-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 181481. hokein added a comment. Fix an issue and add comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56597/new/ https://reviews.llvm.org/D56597 Files: clangd/ClangdLSPServer.cpp clangd/ClangdServer.c

[PATCH] D56655: [clangd] Fix mac buildbot failure.

2019-01-14 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. Fix a use-after-free bug. The inner loop may add element to `Dependencies` vector, which may cause memory reallocation of the vector. Also fix an assertion

[PATCH] D56655: [clangd] Fix mac buildbot failure.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 181502. hokein added a comment. remove unrelated blank changes. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56655/new/ https://reviews.llvm.org/D56655 Files: clangd/index/Background.cpp Index: clangd/index

[PATCH] D56597: [clangd] Add Limit parameter for xref.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 181543. hokein marked 14 inline comments as done. hokein added a comment. Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56597/new/ https://reviews.llvm.org/D56597 Files: clangd/ClangdLSPServe

[PATCH] D56597: [clangd] Add Limit parameter for xref.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: unittests/clangd/DexTests.cpp:673 - std::vector Files; - RefsRequest Req; - Req.IDs.insert(Foo.ID); - Req.Filter = RefKind::Declaration | RefKind::Definition; - Dex(std::vector{Foo, Bar}, Refs).refs(Req, [&](const Ref &R) { -Fi

[PATCH] D56655: [clangd] Fix mac buildbot failure.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein abandoned this revision. hokein added a comment. In D56655#1356000 , @kadircet wrote: > https://reviews.llvm.org/D56656 has landed to fix that issue Thanks! I have verified that the test failure is gone after your patch. Repository: rCTE Clang

[PATCH] D56597: [clangd] Add Limit parameter for xref.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 181575. hokein marked an inline comment as done. hokein added a comment. Remove scopes. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56597/new/ https://reviews.llvm.org/D56597 Files: clangd/ClangdLSPServer.cp

[PATCH] D56597: [clangd] Add Limit parameter for xref.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL351081: [clangd] Add Limit parameter for xref. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56

[PATCH] D56680: [Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

2019-01-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added a reviewer: EricWF. This is a regression of r348365. When clang-tools run on a file without a complation database (`clang-check /tmp/t.cc`), we will use fixed compilation database as a fallback. However the actual

[PATCH] D56680: [Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

2019-01-15 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC351222: [Tooling] Make clang-tool find libc++ dir on mac when running on a file without… (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D56680?vs=181637&id=181827

[PATCH] D56424: [clang-tidy] Add check for underscores in googletest names.

2019-01-21 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. Sorry for the delay, I was OOO last week. The check looks good. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56424/new/ https://reviews.llvm.org

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 182768. hokein marked 7 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55256/new/ https://reviews.llvm.org/D55256 Files: clangd/ClangdLS

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/ClangdLSPServer.h:132 - RealFileSystemProvider FSProvider; /// Options used for code completion sammccall wrote: > ilya-biryukov wrote: > > Could we instead call `getRealFS()` when we try to initialize a clan

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 182778. hokein marked 5 inline comments as done. hokein added a comment. Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55256/new/ https://reviews.llvm.org/D55256 Files: clangd/ClangdLSPServer

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/tool/ClangdMain.cpp:438 + auto OverrideClangTidyOptions = tidy::ClangTidyOptions::getDefaults(); + if (!ClangTidyChecks.empty()) +OverrideClangTidyOptions.Checks = ClangTidyChecks; sammccall wrote: > This pre

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/ClangdLSPServer.h:132 - RealFileSystemProvider FSProvider; /// Options used for code completion ilya-biryukov wrote: > hokein wrote: > > sammccall wrote: > > > ilya-bi

[PATCH] D55256: [clangd] Support clang-tidy configuration in clangd.

2019-01-22 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE351792: [clangd] Support clang-tidy configuration in clangd. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D55256?vs=182778&id=182862#toc Repository: rCTE C

[PATCH] D57043: [clangd] Use the shared forced-linking code.

2019-01-22 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, mgorny, srhines. Also add a missing MPI module. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D57043 Files: clangd/CMakeLi

[PATCH] D57047: [clangd] Fix broken build after r351793.

2019-01-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I think it is safe to use the empty one (constructed by the default constructor) here -- since `getDefaults` is not free, and we don't need the configurations in codeComplete, fixed in rL351826 . Repository: rCTE Clang Tools Extra

[PATCH] D57057: [clangd] Log clang-tidy configuration, NFC

2019-01-22 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 is used for debugging purpose. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D57057 Files: clangd/ClangdUnit.cpp In

[PATCH] D56540: [clangd] Clean the cache of file statuses on vscode-clangd when clangd crashes.

2019-01-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE352049: [clangd] Clean the cache of file statuses on vscode-clangd when clangd crashes. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D56540?vs=181035&id=18329

[PATCH] D56540: [clangd] Clean the cache of file statuses on vscode-clangd when clangd crashes.

2019-01-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/clients/clangd-vscode/src/extension.ts:127 +(fileStatus) => { status.onFileUpdated(fileStatus); }); +} else if (newState == vscodelc.State.Stopped) { +

[PATCH] D56424: [clang-tidy] Add check for underscores in googletest names.

2019-01-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352183: [clang-tidy] Add check for underscores in googletest names. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D56424

[PATCH] D56424: [clang-tidy] Add check for underscores in googletest names.

2019-01-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D56424#1370461 , @karepker wrote: > Rebasing against master. > > Not sure if re-arc diffing this is necessary, but I hope it doesn't hurt. Didn't notice that you don't have commit access, committed in rL352183

[PATCH] D57057: [clangd] Log clang-tidy configuration, NFC

2019-01-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL352184: [clangd] Log clang-tidy configuration, NFC (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D55739: [Clangd] Index main-file macros (bug 39761)

2019-01-28 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE352367: [clangd] Index main-file macros (bug 39761) (authored by hokein, committed by ). Herald added a subscriber: cfe-commits. Changed prior to commit: https://reviews.llvm.org/D55739?vs=183320&id=1

[PATCH] D57325: [clangd] Collect macros in static index.

2019-01-28 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. We are missing macros in static index. symbols: before 407 K vs after 420 K dex memory usage (static index): before 299 MB vs 304 MB Reposito

[PATCH] D57057: [clangd] Log clang-tidy configuration, NFC

2019-01-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D57057#1375249 , @sammccall wrote: > This turns out to be excessively spammy in unit tests, can we change this to > dlog()? Sure, done in rL352485 . Repository: rL LLVM CHANGES SINCE LAS

[PATCH] D57388: [clangd] Implement textDocument/declaration from LSP 3.14

2019-01-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Looks good overall, most are nits. > textDocument/definition now returns a definition if one is found, otherwise > the declaration. It no longer returns declaration + definition if they are > distinct. > textDocument/declaration returns the best declaration we can find.

[PATCH] D57325: [clangd] Collect macros in static index.

2019-01-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:128 runFuzzyFind(Idx, ""), UnorderedElementsAre(Named("common"), Named("A_CC"), Named("g"), AllOf(Named("f_b"), D

[PATCH] D53953: [clang-tidy] Get ClangTidyContext out of the business of storing diagnostics. NFC

2018-11-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. > There is a test that asserts clang-tidy exits with 0 when processing a > nonexistent file (test added in https://reviews.llvm.org/D17335 which you > wrote/reviewed). This seems like a bug to me, do I need to preserve this behavior? (See p

[PATCH] D54033: [clang-tidy] Untangle layering in ClangTidyDiagnosticConsumer somewhat. NFC

2018-11-02 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. This looks clearer! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D54061: [clang-tidy] run() doesn't update the SourceManager.

2018-11-05 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. In https://reviews.llvm.org/D54061#1286505, @steveire wrote: > After this change, it seems that `ClangTidyCheck::check` is not needed and > all callers shou

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. We can run the tools on a subset files of compilation database. Repository: rC Clang https://reviews.llvm.org/D54092 Files: lib/Tooling/AllTUsExecution.cpp Index: lib/Tooling/AllTUsExecution.cpp ==

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172560. hokein marked an inline comment as done. hokein added a comment. Update comment. Repository: rC Clang https://reviews.llvm.org/D54092 Files: lib/Tooling/AllTUsExecution.cpp Index: lib/Tooling/AllTUsExecution.cpp ===

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/AllTUsExecution.cpp:120 for (std::string File : Files) { + if (Filter.getNumOccurrences() != 0 && !RegexFilter.match(File)) +continue; ioeric wrote: > > `Filter.getNumOccurrences() != 0 ` > W

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/AllTUsExecution.cpp:120 for (std::string File : Files) { + if (Filter.getNumOccurrences() != 0 && !RegexFilter.match(File)) +continue; ioeric wrote: > hokein wrote: > > ioeric wrote: > > > >

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172571. hokein added a comment. Remove the default value check. Repository: rC Clang https://reviews.llvm.org/D54092 Files: lib/Tooling/AllTUsExecution.cpp Index: lib/Tooling/AllTUsExecution.cpp

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172574. hokein added a comment. Add test. Repository: rC Clang https://reviews.llvm.org/D54092 Files: include/clang/Tooling/AllTUsExecution.h lib/Tooling/AllTUsExecution.cpp unittests/Tooling/ExecutionTest.cpp Index: unittests/Tooling/ExecutionTes

[PATCH] D54092: [Tooling] Add "-filter" option to AllTUsExecution

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC346131: [Tooling] Add "-filter" option to AllTUsExecution (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D54092?vs=172574&id=172575#toc Repository: rC Clang h

[PATCH] D54104: [Tooling] Correct the total number of files being processed when `filter` is provided.

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Repository: rC Clang https://reviews.llvm.org/D54104 Files: lib/Tooling/AllTUsExecution.cpp Index: lib/Tooling/AllTUsExecution.cpp === --- lib/Tooling/AllTUsExecut

[PATCH] D54104: [Tooling] Correct the total number of files being processed when `filter` is provided.

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172585. hokein marked 2 inline comments as done. hokein added a comment. Address comments. Repository: rC Clang https://reviews.llvm.org/D54104 Files: lib/Tooling/AllTUsExecution.cpp Index: lib/Tooling/AllTUsExecution.cpp =

[PATCH] D54104: [Tooling] Correct the total number of files being processed when `filter` is provided.

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346135: [Tooling] Correct the total number of files being processed when `filter` is… (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.l

[PATCH] D54106: [clangd] Limit the index-returned results in dexp.

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. When the limit of FuzzyFindRequest is not specified, MemIndex and DexIndex will set it MAX_UINT, which doesn't make sense in the active tool dexp (we might

[PATCH] D54106: [clangd] Limit the index-returned results in dexp.

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172598. hokein added a comment. Address review comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54106 Files: clangd/index/dex/dexp/Dexp.cpp Index: clangd/index/dex/dexp/Dexp.cpp

[PATCH] D54106: [clangd] Limit the index-returned results in dexp.

2018-11-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/dex/dexp/Dexp.cpp:128 }; cl::opt Limit{ "limit", ioeric wrote: > I think we should make it configurable like what we do here. Made it configurable for `Lookup`. `Limit` option is used to restrict

[PATCH] D54106: [clangd] Limit the index-returned results in dexp.

2018-11-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172736. hokein added a comment. Update based on the offline discussion. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54106 Files: clangd/index/dex/dexp/Dexp.cpp Index: clangd/index/dex/dexp/Dexp.cpp

[PATCH] D54141: [clang-tidy] add deduplication support for run-clang-tidy.py

2018-11-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the patch and nice improvements. Some initial thoughts: - The output of clang-tidy diagnostic is YAML, and YAML is not an space-efficient format (just for human readability). If you want to save space further, we might consider using some compressed formats,

[PATCH] D54141: [clang-tidy] add deduplication support for run-clang-tidy.py

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. >> If you're suggesting proceeding with this regex based solution, I > > don't think that's a good idea. Why commit a hack which people will object to > ever removing? Just see if we can do the right thing instead. +1, my main concern is the complexity of the patch and m

[PATCH] D54202: [clangd] Drop namespace references in the index.

2018-11-07 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. Namespace references is less useful compared with other symbols, and they contribute large part of the index. This patch drops them. The number

[PATCH] D54202: [clangd] Drop namespace references in the index.

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172926. hokein added a comment. Fix a typo. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54202 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd/SymbolCollectorTests.cpp Index: unittests/clangd

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172949. hokein added a comment. Move forward the patch based on the offline discussion. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53427 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/Merge.cpp clangd/index/Seria

[PATCH] D54202: [clangd] Drop namespace references in the index.

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/SymbolCollector.cpp:359 return true; - if (CollectRef && + if (CollectRef && !isa(ND) && (Opts.RefsInHeaders || SM.getFileID(SpellingLoc) == SM.getMainFileID())) kadircet wrote: > Why not handle

[PATCH] D54202: [clangd] Drop namespace references in the index.

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 172950. hokein marked an inline comment as done. hokein added a comment. Fix another typo. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54202 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd/Sym

[PATCH] D54202: [clangd] Drop namespace references in the index.

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346319: [clangd] Drop namespace references in the index. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D54202 Files: clan

[PATCH] D54204: [clangd] Initial clang-tidy diagnostics support.

2018-11-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I think this is in a good shape as initial patch! Comment at: clangd/ClangdUnit.cpp:168 +// The placeholder check here does not use hasAncestor() so is unaffected. +CTOpts.Checks = "bugprone-sizeof-expression"; +CTContext.emplace(llvm::make_u

[PATCH] D54257: [clang-tidy] **Prototype** use AllTUsExecutors

2018-11-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, mgrang, xazax.hun. Only works on StandaloneToolExecutor, crashes happen when running AllTUsExecutors with multithreads (I believe it is because ClangTidyContext is not threadsafe). // Restrict thread to 1. ./bin/clang-tidy -

[PATCH] D54300: [clangd] Respect shouldIndexFile when collecting symbols.

2018-11-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54300 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittest

[PATCH] D54246: [clang-tidy] Add the abseil-duration-factory-scale check

2018-11-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/abseil/DurationFactoryScaleCheck.cpp:36 +GetScaleForFactory(llvm::StringRef FactoryName) { + static const auto *ScaleMap = + new std::unordered_map( aaron.ballman wrote: > hwright wrote: > > Eugene.Zelenk

[PATCH] D54300: [clangd] Respect shouldIndexFile when collecting symbols.

2018-11-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173324. hokein marked 2 inline comments as done. hokein added a comment. Address comments and simplify the code. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54300 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h

[PATCH] D54300: [clangd] Respect shouldIndexFile when collecting symbols.

2018-11-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/SymbolCollector.cpp:555 + auto Loc = findNameLoc(&ND); + if (!shouldIndexFile(SM, SM.getFileID(Loc), Opts, &FilesToIndexCache)) +return nullptr; ioeric wrote: > Should we use `getTokenLocation` like wha

[PATCH] D54300: [clangd] Respect shouldIndexFile when collecting symbols.

2018-11-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173326. hokein added a comment. clang-format and fix typos Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54300 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd/SymbolCollectorTests.cpp Index: un

[PATCH] D54300: [clangd] Respect shouldIndexFile when collecting symbols.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173662. hokein marked 3 inline comments as done. hokein added a comment. Update the patch based on offline discussion. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54300 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollec

[PATCH] D54300: [clangd] Respect shouldIndexFile when collecting symbols.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/SymbolCollector.cpp:217 +bool shouldIndexFile(const Decl& D, const SymbolCollector::Options &Opts, + llvm::DenseMap *FilesToIndexCache) { ioeric wrote: > nit: this is very easily confuse

[PATCH] D54427: [clangd] Allow symbols from AnyScope in dexp.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. We should allow symbols from any scope in dexp results, othewise `find StringRef` doesn't return any results (llvm::StringRef). Repository: rCTE Clang T

[PATCH] D54427: [clangd] Allow symbols from AnyScope in dexp.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173676. hokein marked 2 inline comments as done. hokein added a comment. Address comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54427 Files: clangd/index/dex/dexp/Dexp.cpp Index: clangd/index/dex/dexp/Dexp.cpp =

[PATCH] D54427: [clangd] Allow symbols from AnyScope in dexp.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/dex/dexp/Dexp.cpp:55 FuzzyFindRequest Request; + Request.AnyScope = true; // Remove leading "::" qualifier as FuzzyFind doesn't need leading "::" ioeric wrote: > I don't think you would want AnyScope h

[PATCH] D54427: [clangd] Allow symbols from AnyScope in dexp.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL34: [clangd] Allow symbols from AnyScope in dexp. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D54427 Files: clang-t

[PATCH] D54430: [clangd] Don't show all refs results if -name is ambiguous in dexp.

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

[PATCH] D54430: [clangd] Don't show all refs results if -name is ambiguous in dexp.

2018-11-12 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346671: [clangd] Don't show all refs results if -name is ambiguous in dexp. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D5

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173842. hokein marked an inline comment as done. hokein added a comment. update the patch. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53427 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/Merge.cpp clangd/index/Se

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:84 inline bool operator==(const SymbolLocation &L, const SymbolLocation &R) { - return std::tie(L.FileURI, L.Start, L.End) == - std::tie(R.FileURI, R.Start, R.End); + return std::make_tuple(llvm::StringRef(

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173856. hokein marked 3 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53427 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/Merge.cpp clangd/i

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:93 +return Cmp < 0; + return std::tie(L.Start, L.End) < std::tie(R.Start, R.End); } sammccall wrote: > tie(strcmp(L.FileURI, R.FileURI), ...) < tie(0, ...)? tie doesn't support this usage, it ex

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 173861. hokein marked an inline comment as done. hokein added a comment. Add assert. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53427 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/Merge.cpp clangd/index/Serializ

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:306 +llvm::StringRef S(P); +CB(S); +P = S.data(); sammccall wrote: > hokein wrote: > > sammccall wrote: > > > ```assert (!S.data()[S.size()] && "Visited StringRef must be > > > null-termi

[PATCH] D54519: [clangd] Fix no results returned for global symbols in dexp

2018-11-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. For symbols in global namespace (without any scope), we need to add global scope "" to the fuzzy request. Repository: rCTE Clang Tools Extra https://re

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-14 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346852: [clangd] Replace StringRef in SymbolLocation with a char pointer. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D534

[PATCH] D54204: [clangd] Initial clang-tidy diagnostics support.

2018-11-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Looks mostly good, just a few nits. This patch contains two parts (clang-tidy and clangd), I think we could split into two, but I'm not insisting, up to you. Comment at: clang-tidy/modernize/LoopConvertUtils.h:59 /// \brief Run the analysis on th

[PATCH] D53427: [clangd] Replace StringRef in SymbolLocation with a char pointer.

2018-11-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/trunk/clangd/index/Index.h:71 + // via llvm::StringRef. + const char *FileURI = ""; }; alexfh wrote: > If the users of the SymbolLocation have a way to get a common "context", you > could keep a list

[PATCH] D54519: [clangd] Fix no results returned for global symbols in dexp

2018-11-15 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL346947: [clangd] Fix no results returned for global symbols in dexp (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D54519 Fi

[PATCH] D54579: [clang-tidy] Update checks to play nicely with limited traversal scope added in r346847

2018-11-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: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:567 replaceCompoundReturnWithCondition(Result, Compound, true); - else if (const auto TU = Result.N

[PATCH] D54204: [clangd] Initial clang-tidy diagnostics support.

2018-11-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. looks good! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D54622: [clangd] Truncate SymbolID to 8 bytes.

2018-11-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. This is our goal. It has a non-zero rick, but so far we haven't see any collision (externally and internally). Repository: rCTE Clang Tools

[PATCH] D54622: [clangd] Truncate SymbolID to 8 bytes.

2018-11-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL347044: [clangd] Truncate SymbolID to 8 bytes. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D54622 Files: clang-tools-ex

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