[PATCH] D80296: [clangd] Don't traverse the AST within uninteresting files during indexing

2020-05-25 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Correct me if I'm wrong, but this might lead to a file never being updated in the index, even after edit, right? Let's say you have file a.cpp that includes a.h. a.h has namespace foo { #define EXPAND(foo) whatever #include "b.h" } all nodes from b.h will be inside t

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-05-25 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. When preamble contains #undef, indexing code finds the matching #define and uses that during inde

[PATCH] D80296: [clangd] Don't traverse the AST within uninteresting files during indexing

2020-05-25 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz marked an inline comment as done. adamcz added a comment. I have no objections to landing this as-is, even if it represents a regression for some evil codebases. A possible solution is to iterate through all the includes in a given file (SourceManager knows that already) and if any of th

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-05-26 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 266240. adamcz marked 3 inline comments as done. adamcz added a comment. Addressed review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80525/new/ https://reviews.llvm.org/D80525 Files: clang-tools-

[PATCH] D77656: [clangd] Fix a crash bug in AddUsing tweak around template handling.

2020-04-07 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 255694. adamcz added a comment. Removed unnecessary change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77656/new/ https://reviews.llvm.org/D77656 Files: clang-tools-extra/clangd/refactor/tweaks/AddUsing.cp

[PATCH] D77656: [clangd] Fix a crash bug in AddUsing tweak around template handling.

2020-04-07 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. adamcz updated this revision to Diff 255694. adamcz added a comment. Removed unnecessary change.

[PATCH] D77656: [clangd] Fix a crash bug in AddUsing tweak around template handling.

2020-04-08 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz marked an inline comment as done. adamcz added a comment. Can you submit this? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77656/new/ https://reviews.llvm.org/D77656 ___ cfe-commits ma

[PATCH] D77656: [clangd] Fix a crash bug in AddUsing tweak around template handling.

2020-04-08 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 255950. adamcz added a comment. review comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77656/new/ https://reviews.llvm.org/D77656 Files: clang-tools-extra/clangd/refactor/tweaks/AddUsing.cpp clang-too

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-06-04 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: kadircet. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. In cases like: foo(a, ^b); We now additionally show the name and type of the parameter to foo that corre

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-06-05 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 268780. adamcz marked 11 inline comments as done. adamcz added a comment. addressed review comments, some UI questions remain open for now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81169/new/ https://review

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-06-05 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Hover.cpp:525 + if (const auto *Var = dyn_cast(D)) { +// Check if we are inside CallExpr kadircet wrote: > umm, is this a fixme or a leftover? I suppose it is from a previous version > of

[PATCH] D81958: [clangd] Add library to semantically strip flags by name.

2020-06-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/CompileCommands.cpp:256 + case Option::RemainingArgsClass: +return {1, 0}; + case Option::RemainingArgsJoinedClass: nit: could you replace 1 with some constant value with descriptive

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-07-02 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 275073. adamcz added a comment. Final review comment + rebase on top of HEAD Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81169/new/ https://reviews.llvm.org/D81169 Files: clang-tools-extra/clangd/Hover.cpp

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-07-02 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 275104. adamcz marked an inline comment as done. adamcz added a comment. removed some more {} Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81169/new/ https://reviews.llvm.org/D81169 Files: clang-tools-extra/

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-06-26 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 273742. adamcz marked 2 inline comments as done. adamcz added a comment. Formatting changed to spell out [const] reference and hide type unless conversion happens. Defining what the "correct" behavior is on various cases is very difficult. This is my best shot

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-06-29 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 274147. adamcz marked 8 inline comments as done. adamcz added a comment. Addressed review comments, also added some "const" here and there. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81169/new/ https://review

[PATCH] D81169: [clangd] Improve hover on arguments to function call

2020-06-29 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Hover.cpp:721 +// Extract matching argument from function declaration. +if (const ParmVarDecl *PVD = FD->getParamDecl(I)) { + HI.CalleeArgInfo.emplace(toHoverInfoParam(PVD, Policy));

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-06-30 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 274482. adamcz added a comment. Changed to just ignore undefs without matching def Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80525/new/ https://reviews.llvm.org/D80525 Files: clang-tools-extra/clangd/unit

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-06-30 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Resurrecting this, with the ignore #undef when #define is in a module approach. Still worth having a test, especially that it's the first test we have for modules. Note that the test code changed since last version due to introduction of ThreasafeFS since my original ch

[PATCH] D78454: [clangd] Highlight related control flow.

2020-04-20 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/XRefs.cpp:628 +return FD->getBody(); + if (const auto *FD = N.get()) +return FD->getBody(); You are checking for FunctionDecl twice Comment at: clang-tools-extra/clangd

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-07 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, mgorny. Herald added a project: clang. adamcz requested review of this revision. Herald added a subscriber: ilya-biryukov. This fixes a crash bug in clangd when used with modules. ASTWrite

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-07 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 283922. adamcz added a comment. This time the fix is included ;-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85532/new/ https://reviews.llvm.org/D85532 Files: clang-tools-extra/clangd/unittests/CMakeLists.

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 284329. adamcz marked 3 inline comments as done. adamcz added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85532/new/ https://reviews.llvm.org/D85532 Files: clang-tools-e

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/unittests/ModulesTests.cpp:28 +)cpp"); + TU.ExtraArgs.push_back("-fmodules"); + TU.ExtraArgs.push_back("-fmodule-name=M"); kadircet wrote: > this one is not needed right? I suppose not. ==

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 284360. adamcz marked 2 inline comments as done. adamcz added a comment. final(?) review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80525/new/ https://reviews.llvm.org/D80525 Files: clang-tools-ex

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp:1523 + TU.ExtraArgs.push_back("-fmodule-map-file=/module.map"); + TU.OverlayRealFileSystem = true; + sammccall wrote: > I'm a bit torn on this - this is obviou

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 284365. adamcz marked an inline comment as done. adamcz added a comment. more review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85532/new/ https://reviews.llvm.org/D85532 Files: clang-tools-extra/

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang/unittests/Frontend/ASTUnitTest.cpp:146 + auto File = AU->getFileManager().getFileRef("Textual.h", false, false); + assert(File); + // Verify that we do not crash here. kadircet wrote: > ASSERT_TRUE again You can

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang/unittests/Frontend/ASTUnitTest.cpp:146 + auto File = AU->getFileManager().getFileRef("Textual.h", false, false); + assert(File); + // Verify that we do not crash here. adamcz wrote: > kadircet wrote: > > ASSERT_T

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 284376. adamcz marked 2 inline comments as done. adamcz added a comment. var rename, comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80525/new/ https://reviews.llvm.org/D80525 Files: clang-tools-extra/

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/unittests/TestTU.h:71 + // required for use of modules. + // FIXME: Intercept the write of implicitly build module to disk and update + // TestFS with that content to avoid using real file system in tests.

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 284390. adamcz added a comment. assert() -> ASSERT_TRUE Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85532/new/ https://reviews.llvm.org/D85532 Files: clang-tools-extra/clangd/unittests/CMakeLists.txt clan

[PATCH] D85532: Correctly set CompilingPCH in PrecompilePreambleAction.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe2d61ae57333: Correctly set CompilingPCH in PrecompilePreambleAction. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-10 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4061d9e42cff: [clangd] Fix crash-bug in preamble indexing when using modules. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80525/new/

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-11 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. adamcz requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. This can happen when building implicit modules, as demonstrated in

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-11 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 284811. adamcz added a comment. log dropped dianostic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85753/new/ https://reviews.llvm.org/D85753 Files: clang-tools-extra/clangd/Diagnostics.cpp clang-tools-ext

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-11 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a reviewer: sammccall. adamcz added a comment. Hey Sam. What's your opinion on this? The options we have are: 1. Drop the diagnostics, like this change is doing 2. Relocate the diagnostic to the beginning of the "real" main file, like we do with SourceManager-less diagnostics 3. Tr

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-12 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Diagnostics.cpp:209 // Update diag to point at include inside main file. D.File = SM.getFileEntryForID(SM.getMainFileID())->getName().str(); D.Range = std::move(R); kadircet wrote: > can'

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-12 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Diagnostics.cpp:209 // Update diag to point at include inside main file. D.File = SM.getFileEntryForID(SM.getMainFileID())->getName().str(); D.Range = std::move(R); kadircet wrote: > adam

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. This is quite strange. I can't reproduce this with gcc 7.5.0, 9.3.0 or 10.0.1. Which version are you using? There are bugs around clangd + modules + diagnostics. I'm fixing one in https://reviews.llvm.org/D85753 (not in it's final form yet), but it doesn't seem to be th

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. In D80525#2215755 , @bjope wrote: > In D80525#2215641 , @adamcz wrote: > >> This is quite strange. I can't reproduce this with gcc 7.5.0, 9.3.0 or >> 10.0.1. Which version are you using? >>

[PATCH] D80525: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Looks like it's an issue with not clearing the module cache. I'll revert this change to fix the build, then re-submit with proper fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80525/new/ https://reviews.llvm.org/D80525

[PATCH] D85907: [clangd] Revert "[clangd] Fix crash-bug in preamble indexing when using modules."

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. adamcz requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. This reverts commit 4061d9e42c

[PATCH] D85907: [clangd] Revert "[clangd] Fix crash-bug in preamble indexing when using modules."

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG73f0772c0baf: [clangd] Revert "[clangd] Fix crash-bug in preamble indexing when using modules. (authored by adamcz). Repository: rG LLVM Github Mo

[PATCH] D85883: [clangd] Add ClangdServer::customAction() extension point

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85883/new/ https://reviews.llvm.org/D85883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[PATCH] D85923: [clangd] Fix crash-bug in preamble indexing when using modules.

2020-08-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. adamcz requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. When preamble contains #undef,

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Diagnostics.cpp:568 + // If the diagnostic was generated for a different SourceManager, skip it. + // This can happen when using implicit modules. + if (OrigSrcMgr && Info.hasSourceManager() &&

[PATCH] D85753: [clangd] Discard diagnostics from another SourceManager.

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 285961. adamcz marked 3 inline comments as done. adamcz added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85753/new/ https://reviews.llvm.org/D85753 Files: clang-tools-e

[PATCH] D86069: [clang] When loading preamble from AST file, re-export modules in Sema.

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. adamcz requested review of this revision. This addresses a FIXME in ASTReader. Modules were already re-exported for Preprocessor, but not for Sema. The resul

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/TUScheduler.cpp:172 +for (const auto &Elem : LRU) + TotalBytes += Elem.second->getUsedBytes(); +return TotalBytes; Any idea how expensive this is? I suppose TUScheduler::update() is r

[PATCH] D86077: [clangd] Add a way for exporting memory usage metrics

2020-08-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/TUScheduler.cpp:168 + size_t getUsedBytes() { +size_t TotalBytes = 0; nit: This is the same name as getUsedBytes(Key K). Maybe rename to getTotalUsedBytes()? Comment at:

[PATCH] D86069: [clang] When loading preamble from AST file, re-export modules in Sema.

2020-08-18 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang/test/PCH/preamble-modules.cpp:8 + +#ifndef MAIN_FILE +#define MAIN_FILE sammccall wrote: > what are these ifdefs about? you never seem to define this symbol > > (Possible you're copying from a test that is doing so

[PATCH] D79456: [clangd] Complete filenames after < / ".

2020-05-06 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1922 + Line.consume_front("include") || Line.consume_front("import") || + Line.consume_front("import_next"); + Line = Line.ltrim(); Did you mean include_next? Also, this w

[PATCH] D79488: [clangd] Do not offer "Add using" tweak in header files.

2020-05-06 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. sammccall accepted this revision. This revision is now accepted and ready to land. adamcz updated

[PATCH] D79488: [clangd] Do not offer "Add using" tweak in header files.

2020-05-06 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:2471 + EXPECT_UNAVAILABLE(Header + "void fun() { one::two::f^f(); }"); + FileName = "test.hpp"; + EXPECT_UNAVAILABLE(Header + "void fun() { one::two::f^f(); }"); sammcc

[PATCH] D79488: [clangd] Do not offer "Add using" tweak in header files.

2020-05-06 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 262364. adamcz marked 2 inline comments as done. adamcz added a comment. Addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79488/new/ https://reviews.llvm.org/D79488 Files: clang-tools-e

[PATCH] D79496: [clangd] Fix AddUsing tweak for out-of-line functions.

2020-05-06 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: hokein. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. We used getEnclosingNamespaceContext(), which calls getParent() rather than getLexicalParent(), so w

[PATCH] D79496: [clangd] Fix AddUsing tweak for out-of-line functions.

2020-05-07 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz marked an inline comment as done. adamcz added inline comments. Comment at: clang-tools-extra/clangd/unittests/TweakTests.cpp:2673 +void foo::fun() { + one::two::f^f(); +})cpp", hokein wrote: > IIUC, before this patch, the using was added inside the above

[PATCH] D79582: [clangd] Fix crash in AddUsing tweak due to non-identifier DeclName

2020-05-07 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: hokein. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D79582 Files: clang-tools-extra/c

[PATCH] D79582: [clangd] Fix crash in AddUsing tweak due to non-identifier DeclName

2020-05-08 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 262857. adamcz marked an inline comment as done. adamcz added a comment. Addressed review comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79582/new/ https://reviews.llvm.org/D79582 Files: clang-tools-ex

[PATCH] D78454: [clangd] Highlight related control flow.

2020-05-19 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz accepted this revision. adamcz added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/XRefs.cpp:907 +// Highlight the loop keyword itself. +Result.push_back(P->ASTNode.getSourceRange().getBegin()); +

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-25 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 418219. adamcz marked an inline comment as done. adamcz added a comment. added a comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121824/new/ https://reviews.llvm.org/D121824 Files: clang/lib/Sema/TreeTr

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-25 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Thanks for all the comments! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121824/new/ https://reviews.llvm.org/D121824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-25 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7e459126185f: [clang] Do not crash on arrow operator on dependent type. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D122894: [clangd] Record IO precentage for first preamble build of the instance

2022-04-01 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Thanks, I was just about to fix that! Comment at: clang-tools-extra/clangd/TUScheduler.cpp:115 bool IsFirstPreamble) { - static llvm::once_flag OnceFlag; - llvm::call_once(OnceFlag, [&] { + auto RecordWithLabel = [&Stats](llv

[PATCH] D130636: [clangd] Upgrade vlog() to log() for preamble build stats

2022-07-27 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. Herald added a project: All. adamcz requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. This is v

[PATCH] D130636: [clangd] Upgrade vlog() to log() for preamble build stats

2022-08-01 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Preamble.cpp:555 if (BuiltPreamble) { -vlog("Built preamble of size {0} for file {1} version {2} in {3} seconds", +log("Built preamble of size {0} for file {1} version {2} in {3} seconds", Bui

[PATCH] D130636: [clangd] Upgrade vlog() to log() for preamble build stats

2022-08-01 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6b2fed3ab419: [clangd] Upgrade vlog() to log() for preamble build stats (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-15 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, javed.absar. Herald added a project: All. adamcz requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extr

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-16 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: hokein. Herald added a project: All. adamcz requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D121824 Files: clang/lib/S

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-16 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 415919. adamcz marked 12 inline comments as done. adamcz added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121712/new/ https://reviews.llvm.org/D121712 Files: clang-tool

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-16 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. In D121712#3383944 , @Trass3r wrote: > Hmm just a few curious questions from the sidelines. > Why a "custom system" instead of something -ftime-trace based? I'm not sure if I understand. -ftime-trace is a one-off. I want to monito

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-18 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 416561. adamcz added a comment. changed to marking VarDecl as invalid if it's ref type and initializer is invalid Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121824/new/ https://reviews.llvm.org/D121824 File

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-18 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Thanks! I updated the change. Let me know if this is what you had in mind. I kept the original test too, can't hurt right? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121824/new/ https://reviews.llvm.org/D121824

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 416964. adamcz marked 3 inline comments as done. adamcz added a comment. more review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121712/new/ https://reviews.llvm.org/D121712 Files: clang-tools-extr

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/FS.h:91 +IntrusiveRefCntPtr +getTimeTrackingFS(std::shared_ptr Timer, + IntrusiveRefCntPtr FS); kadircet wrote: > adamcz wrote: > > kadircet wrote: > > > kadircet wrote: > > > > i

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 417006. adamcz marked an inline comment as done. adamcz added a comment. fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121712/new/ https://reviews.llvm.org/D121712 Files: clang-tools-extra/clangd

[PATCH] D121712: [clangd] Track time spent in filesystem ops during preamble builds

2022-03-21 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6009d0d5801d: [clangd] Track time spent in filesystem ops during preamble builds (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D122102: [clangd] Introduce "add subclass" tweak

2022-03-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Thanks, this looks really good! I always wanted a code action like this. I always envisioned this as a code action on a class to implement missing virtual methods though. The idea would be: class Foo : public B^ar { }; expands into: class Foo : public Bar { int baz

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-22 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 417331. adamcz added a comment. Reverted to previous version + new test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121824/new/ https://reviews.llvm.org/D121824 Files: clang/lib/Sema/TreeTransform.h clang

[PATCH] D121824: [clang] Do not crash on arrow operator on dependent type.

2022-03-22 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. In D121824#3399208 , @sammccall wrote: > I reduced something very similar recently as > https://github.com/clangd/clangd/issues/1073 > > This patch does not fix it, but looks closely related, want to take a look? Very similar. My

[PATCH] D123672: [clangd] Export preamble AST and serialized size as metrics

2022-04-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Preamble.cpp:500 + if (Stats != nullptr) { +Stats->TotalBuildTime = PreambleTimer.getTime(); This is a significant change. You are now exporting this information for failed preamble builds

[PATCH] D124176: [clangd] Add beforeExecute() callback to FeatureModules.

2022-04-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. Herald added a project: All. adamcz requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. It runs i

[PATCH] D124177: [Frontend] Simplify PrecompiledPreamble::PCHStorage. NFC

2022-04-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz accepted this revision. adamcz added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Frontend/PrecompiledPreamble.cpp:373 + } + llvm::StringRef filePath() const { return File->getFilePath(); } + llvm::StringRef memoryContents() co

[PATCH] D124176: [clangd] Add beforeExecute() callback to FeatureModules.

2022-04-21 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 424215. adamcz marked 5 inline comments as done. adamcz added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124176/new/ https://reviews.llvm.org/D124176 Files: clang-tools

[PATCH] D124176: [clangd] Add beforeExecute() callback to FeatureModules.

2022-04-21 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGad46aaede6e4: [clangd] Add beforeExecute() callback to FeatureModules. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D129499: [clang] Do not crash on "requires" after a fatal error occurred.

2022-07-11 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: ilya-biryukov. Herald added a project: All. adamcz requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The code would assume that SubstExpr() cannot fail on concept specialization. This is

[PATCH] D129499: [clang] Do not crash on "requires" after a fatal error occurred.

2022-07-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 444315. adamcz added a comment. improved the test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129499/new/ https://reviews.llvm.org/D129499 Files: clang/lib/Sema/SemaExprCXX.cpp clang/test/SemaCXX/concept-

[PATCH] D129499: [clang] Do not crash on "requires" after a fatal error occurred.

2022-07-13 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang/test/SemaCXX/concept-fatal-error.cpp:8 + // We test that we do not crash in such cases (#55401) + int i = requires { { i } f } // expected-error {{expected ';' at end of declaration list}} + ilya-biryukov wrote:

[PATCH] D129499: [clang] Do not crash on "requires" after a fatal error occurred.

2022-07-14 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcab3cfd013cf: [clang] Do not crash on "requires" after a fatal error occurred. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129499/new

[PATCH] D83814: [clangd] Add Random Forest runtime for code completion.

2020-09-14 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/unittests/DecisionForestTests.cpp:5 + +namespace clangd { +namespace clangd { This is supposed to be "namespace clang", right? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D83814: [clangd] Add Random Forest runtime for code completion.

2020-09-15 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added a comment. Looks good to me overall, some minor style comments included ;-) Do we expect this to be a generic model code generator that gets reused for other things? If not, maybe we can hardcode more (like the namespace, class name, etc), but if you think there's other use cases f

[PATCH] D87673: [clangd] Don't use zlib when it's unavailable.

2020-09-15 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz accepted this revision. adamcz added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/index/Serialization.cpp:209 Uncompressed = UncompressedStorage; + } else { +return error("Compressed string table, but zlib

[PATCH] D87710: [clangd] Actually parse Index section of the YAML file.

2020-09-15 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. adamcz requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. This fixes a bug in dbf486c0de

[PATCH] D87710: [clangd] Actually parse Index section of the YAML file.

2020-09-16 Thread Adam Czachorowski via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7029e5d4ca20: [clangd] Actually parse Index section of the YAML file. (authored by adamcz). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D87775: [clangd] Add option for disabling AddUsing tweak on some namespaces.

2020-09-16 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz created this revision. adamcz added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. adamcz requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. For style guides forbid "using

[PATCH] D87775: [clangd] Add option for disabling AddUsing tweak on some namespaces.

2020-09-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/ConfigFragment.h:167 + struct StyleBlock { +// List of namespaces that should not appear in "using" declarations. +std::vector> FullyQualifiedNamespaces; sammccall wrote: > Can we describ

[PATCH] D87775: [clangd] Add option for disabling AddUsing tweak on some namespaces.

2020-09-17 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 292521. adamcz marked 5 inline comments as done. adamcz added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87775/new/ https://reviews.llvm.org/D87775 Files: clang-tools-e

[PATCH] D87775: [clangd] Add option for disabling AddUsing tweak on some namespaces.

2020-09-18 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz updated this revision to Diff 292786. adamcz marked 2 inline comments as done. adamcz added a comment. addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87775/new/ https://reviews.llvm.org/D87775 Files: clang-tools-e

[PATCH] D87775: [clangd] Add option for disabling AddUsing tweak on some namespaces.

2020-09-18 Thread Adam Czachorowski via Phabricator via cfe-commits
adamcz added inline comments. Comment at: clang-tools-extra/clangd/Config.h:70 +// declarations, always spell out the whole name (with or without leading +// ::). All nested namespaces are affected as well. +std::vector FullyQualifiedNamespaces; sammc

  1   2   3   4   >