Page MenuHomePhabricator
Feed Advanced Search

Nov 7 2022

upsj accepted D137555: [cmake] Add missing CMakePushCheckState include to FindLibEdit.cmake.

LGTM! My bad, thanks for fixing this

Nov 7 2022, 8:53 AM · Restricted Project, Restricted Project

Oct 14 2022

upsj added a comment to D135518: [clangAST] support TypeLoc in TextNodeDumper.

Let me backtrack my previous question: I misremembered where AddChild is actually being called in the traversal (ASTNodeTraverser, not TextNodeDumper), so I'll see if adding this to the JSON output is feasible

Oct 14 2022, 1:15 AM · Restricted Project, Restricted Project
upsj added inline comments to D135518: [clangAST] support TypeLoc in TextNodeDumper.
Oct 14 2022, 12:20 AM · Restricted Project, Restricted Project
upsj updated the diff for D135518: [clangAST] support TypeLoc in TextNodeDumper.

I incorporated the cast, ASTContext and StringRef suggestions. About JSONDumper, I was surprised to see that it doesn't seem to use AddChild for the AST hierarchy at all, so I'm not quite clear how (if?) it builds a nested output. What's the easiest way to invoke it?

Oct 14 2022, 12:19 AM · Restricted Project, Restricted Project

Oct 8 2022

upsj requested review of D135518: [clangAST] support TypeLoc in TextNodeDumper.
Oct 8 2022, 12:37 PM · Restricted Project, Restricted Project

Jul 22 2022

upsj added inline comments to D130260: [clangd] Make forwarding parameter detection logic resilient.
Jul 22 2022, 4:00 AM · Restricted Project, Restricted Project
upsj accepted D130260: [clangd] Make forwarding parameter detection logic resilient.

Not sure I qualify as a suitable reviewer, but this looks really good to me, save for maybe a small safety measure :)

Jul 22 2022, 3:11 AM · Restricted Project, Restricted Project
upsj added a comment to D130260: [clangd] Make forwarding parameter detection logic resilient.

Your approach to handling implicit conversions is much nicer than mine, so I abandoned my revision. There is still one case (that might even occur in the code base I'm working on?) that this change would lead to incorrect hints on. WDYT about keeping the other changes, but using my pack detection logic?

Jul 22 2022, 2:22 AM · Restricted Project, Restricted Project
upsj abandoned D130259: [clangd] fix crash and handle implicit conversions in inlay hints for forwarding functions.

Superseded by https://reviews.llvm.org/D130260

Jul 22 2022, 2:15 AM · Restricted Project, Restricted Project

Jul 21 2022

upsj requested review of D130265: [clangd] resolve forwarded parameters in Hover.
Jul 21 2022, 6:09 AM · Restricted Project, Restricted Project
upsj added inline comments to D130259: [clangd] fix crash and handle implicit conversions in inlay hints for forwarding functions.
Jul 21 2022, 5:47 AM · Restricted Project, Restricted Project
upsj requested review of D130259: [clangd] fix crash and handle implicit conversions in inlay hints for forwarding functions.
Jul 21 2022, 5:42 AM · Restricted Project, Restricted Project

Jul 6 2022

upsj committed rGa638648fef76: [clangd] add inlay hints for std::forward-ed parameter packs (authored by upsj).
[clangd] add inlay hints for std::forward-ed parameter packs
Jul 6 2022, 1:33 PM · Restricted Project, Restricted Project
upsj closed D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
Jul 6 2022, 1:32 PM · Restricted Project, Restricted Project

Jul 5 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

@nridge @sammccall if you don't have any further comments, I will commit this tomorrow, and maybe think about how to extend it to signature help/code completion :)

Jul 5 2022, 7:21 AM · Restricted Project, Restricted Project

Jul 1 2022

upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

don't add reference hints to unresolved parameter packs

Jul 1 2022, 2:21 AM · Restricted Project, Restricted Project

Jun 30 2022

upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
Jun 30 2022, 2:23 PM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

detect whether forwarding functions preserve reference-ness and value categories of their arguments

Jun 30 2022, 2:18 PM · Restricted Project, Restricted Project

Jun 29 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

yes, I have commit access

Jun 29 2022, 5:08 AM · Restricted Project, Restricted Project
upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
Jun 29 2022, 3:13 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
  • simplify parameter pack detection
  • improve function naming
  • make handling of unexpanded packs and varargs more visible
  • add tests involving template specializations
  • make documentation more descriptive
Jun 29 2022, 3:13 AM · Restricted Project, Restricted Project

Jun 28 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

can you give this another look, if you have some time @sammccall?

Jun 28 2022, 1:18 AM · Restricted Project, Restricted Project

Jun 16 2022

upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
Jun 16 2022, 5:09 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
  • remove inlay hints from std::forward in tests
  • identify recursive variadic calls from template, not post-processing
  • allow template parameter packs to appear at any place
  • improve documentation
Jun 16 2022, 5:09 AM · Restricted Project, Restricted Project
upsj committed rGe984e1cd6137: [clangd] Don't add inlay hints on std::move/forward (authored by upsj).
[clangd] Don't add inlay hints on std::move/forward
Jun 16 2022, 3:43 AM · Restricted Project, Restricted Project
upsj closed D127859: [clangd] Don't add inlay hints on std::move/forward.
Jun 16 2022, 3:43 AM · Restricted Project, Restricted Project

Jun 15 2022

upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
Jun 15 2022, 8:44 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
  • improve documentation
  • add more edge case tests
  • fix reference hints for parameter packs
  • remove unnecessary headers
  • fix bug in handling of tail parameters
Jun 15 2022, 8:42 AM · Restricted Project, Restricted Project
upsj requested review of D127859: [clangd] Don't add inlay hints on std::move/forward.
Jun 15 2022, 7:29 AM · Restricted Project, Restricted Project

Jun 10 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

@nridge @sammccall can you give this another look?

Jun 10 2022, 5:45 AM · Restricted Project, Restricted Project

Jun 4 2022

upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
Jun 4 2022, 5:24 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

add test for varargs function called from forwarding function

Jun 4 2022, 5:23 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

This is now ready to review, only needed to fix a formatting issue

Jun 4 2022, 3:51 AM · Restricted Project, Restricted Project

Jun 2 2022

upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
  • fix varargs, again :)
  • remove parameter names entirely if they occur multiple times
Jun 2 2022, 7:06 AM · Restricted Project, Restricted Project

May 30 2022

upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

Thanks Nathan, that was exactly it. I thought I looked at getTypePtr() directly, but I must have been mistaken.
After a small fix (only adding inlay hints until the first unexpanded pack expression, it seems to work now).

May 30 2022, 6:00 AM · Restricted Project, Restricted Project

May 27 2022

upsj planned changes to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
May 27 2022, 4:08 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

Of course, I forgot to create a new diff. There is some debug output and logic errors for some of the tests, but the simple ones already show the issue.
The function in question is getPackTemplateParameter, which provides similar functionality to isExpandedParameter before

May 27 2022, 4:07 AM · Restricted Project, Restricted Project

May 26 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

I've hit a roadblock I'm not sure how to proceed with. It seems that in some cases, a ParmVarDecl of an instantiated function template indeed doesn't preserve the SubstTemplateTypeParmType type sugar allowing me to check which template parameter it was instantiated from. This might be related to reference collapsing on type deduction, since Args... preserves the sugar, but Args&&... doesn't. Without this ability to distinguish between expanded packs and normal parameters, I risk recursing into other functions and pulling up unrelated type names. Any ideas how to proceed here? Essentially, it's the same issue that @nridge already provided a partial solution for by not using getNonReferenceType(), but more complex. I would really like to avoid having to reconstruct parameter indices from arbitrarily many levels of template parameters packs from surrounding scopes.

May 26 2022, 11:20 AM · Restricted Project, Restricted Project
upsj requested review of D126450: [cmake] make FindLibEdit.cmake more robust.
May 26 2022, 1:16 AM · Restricted Project, Restricted Project

May 23 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

Yes, I think that's a good summary. Only a small clarification:

May 23 2022, 3:16 AM · Restricted Project, Restricted Project

May 22 2022

upsj planned changes to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

I will update this to split up the control flow into a visitor just collecting a single recursion level and the high-level mapping. A general question here would be whether we should do the resolution by parameter or by parameter pack. Doing it by parameter (like I did it right now) is much easier for inlay hints, especially if the pack gets split up into different parts, but that may not necessarily be the case for template functions and more fuzzy cases like signature help/autocomplete.

May 22 2022, 5:41 AM · Restricted Project, Restricted Project

May 16 2022

upsj added a comment to D124688: [clangd] parse all make_unique-like functions in preamble.

@sammccall Feel free to merge with Author: Tobias Ribizel <ribizel@kit.edu>
Thanks for the vote of confidence, I'll apply once the forwarding stuff is done :)

May 16 2022, 2:10 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

review updates

May 16 2022, 2:08 AM · Restricted Project, Restricted Project
upsj added inline comments to D124688: [clangd] parse all make_unique-like functions in preamble.
May 16 2022, 12:45 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

remove std::forward bodies from diagnostic tests

May 16 2022, 12:44 AM · Restricted Project, Restricted Project

May 15 2022

upsj added a comment to D124688: [clangd] parse all make_unique-like functions in preamble.

@sammccall @nridge can you give this another look? :)

May 15 2022, 10:16 AM · Restricted Project, Restricted Project

May 8 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

It seems like except for the caveats I listed before, all the obvious cases seem to work: make_unique, make_shared, emplace_back with exact type matches. One point that still needs some work is if the parameter needs to be converted inside one of the forwarding functions (probably just needs another unpack inside ForwardingParameterVisitor), as well as a way to remove duplicate parameters that come from recursive templates like std::tuple. One obvious way would be removing inlay hints for duplicate parameters altogether, but that may not be enough/too heuristic? Alternatively, we could inspect the template instantiation pattern.

May 8 2022, 7:43 AM · Restricted Project, Restricted Project
upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
May 8 2022, 6:24 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

attempt to fix the patch issue

May 8 2022, 6:18 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
  • add test for emplace-like functions
  • fix RecursiveASTVisitor early exit
  • fix handling of skipped parameters
May 8 2022, 6:07 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

update test docs

May 8 2022, 1:09 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

review updates:

May 8 2022, 1:07 AM · Restricted Project, Restricted Project

May 7 2022

upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

fix iterator invalidation issue, handle UnresolvedLookupExpr and test recursive and split variadic lookup

May 7 2022, 7:24 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

updated patch baseline

May 7 2022, 6:21 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

accidentally pushed to the wrong revision, this is the previous version

May 7 2022, 6:15 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

Work around the currently broken isExpandedParameter, also fix the broken diff

May 7 2022, 6:13 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

Work around the currently broken isExpandedParameter, also fix the broken diff

May 7 2022, 6:12 AM · Restricted Project, Restricted Project
upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

This almost works now, the only thing that needs to be fixed is isExpandedParameter, which for some reason picks up the first call, but not the second: (Compare ParameterHints.Forwarded and ParameterHints.VariadicPlain)

cpp
void foo(int a);
    template <typename... Args>
    void bar(Args&&... args) { return foo(args...); }
    void baz() {
      int b;
      bar(42); // This parameter is recognized as expanded
      bar(b); // This one doesn't, so its inlay hint is @args: instead of a:
    }
May 7 2022, 6:03 AM · Restricted Project, Restricted Project
upsj updated the diff for D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

use an RecursiveASTVisitor instead of ASTMatcher

May 7 2022, 5:56 AM · Restricted Project, Restricted Project

May 5 2022

upsj added a comment to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

! In D124690#3493246, @sammccall wrote:

This makes sense to me.
This sounds more complicated, but if I'm reading correctly this multi-level forwarding isn't handled in the current version of the patch either?
At some point we'll want to extract this logic out so it can be used by hover etc, but not yet.

May 5 2022, 1:59 AM · Restricted Project, Restricted Project

May 4 2022

upsj planned changes to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.

I will take a different approach to the matchers: For each CallExpr involving parameter packs, record the arguments (if they are a ParmVarDecl or stdForward(ParmVarDecl)) and the matching ParmVarDecl of the FunctionDecl in a map. Then I will compact that map to skip intermediate forwarding functions like emplace_back -> allocator::construct -> constructor and in a second pass resolve all previously unresolved forwarded parameters.

May 4 2022, 11:23 PM · Restricted Project, Restricted Project
upsj added a comment to D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

I don't have commit access to LLVM, so feel free to merge it

May 4 2022, 11:20 PM · Restricted Project, Restricted Project, Restricted Project
upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

move standalone-specific code to LLDBStandalone.cmake

May 4 2022, 6:19 AM · Restricted Project, Restricted Project, Restricted Project

May 3 2022

upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

fix standalone builds

May 3 2022, 3:18 AM · Restricted Project, Restricted Project, Restricted Project

May 2 2022

upsj added inline comments to D124690: [clangd] add inlay hints for std::forward-ed parameter packs.
May 2 2022, 7:32 AM · Restricted Project, Restricted Project
upsj added inline comments to D124688: [clangd] parse all make_unique-like functions in preamble.
May 2 2022, 6:04 AM · Restricted Project, Restricted Project
upsj updated the diff for D124688: [clangd] parse all make_unique-like functions in preamble.

Rewrote detection of forwarding functions in preamble, added --preamble-parse-forwarding flag

May 2 2022, 5:57 AM · Restricted Project, Restricted Project
upsj updated the diff for D124359: [clangd] Add inlay hints for mutable reference parameters.

remove unnecessary annotation

May 2 2022, 3:54 AM · Restricted Project, Restricted Project
upsj updated the summary of D124359: [clangd] Add inlay hints for mutable reference parameters.
May 2 2022, 2:44 AM · Restricted Project, Restricted Project
upsj updated the diff for D124359: [clangd] Add inlay hints for mutable reference parameters.

add test for const ref inlay hint via type alias

May 2 2022, 12:53 AM · Restricted Project, Restricted Project
upsj updated the diff for D124359: [clangd] Add inlay hints for mutable reference parameters.

right, arcanist doesn't entirely match my git mental model. Here's the (hopefully) complete patch

May 2 2022, 12:45 AM · Restricted Project, Restricted Project
upsj added a comment to D124359: [clangd] Add inlay hints for mutable reference parameters.

Thanks, on second thought moving the hint to the prefix also makes more sense to me.

May 2 2022, 12:31 AM · Restricted Project, Restricted Project
upsj updated the diff for D124359: [clangd] Add inlay hints for mutable reference parameters.

address review comments: Move reference hint to the prefix, test type aliases

May 2 2022, 12:30 AM · Restricted Project, Restricted Project

May 1 2022

upsj abandoned D124373: [clang] add parameter pack/pack expansion matchers.

I think we should be able to do this without adding new matchers globally.

May 1 2022, 12:42 AM · Restricted Project, Restricted Project

Apr 30 2022

upsj published D124690: [clangd] add inlay hints for std::forward-ed parameter packs for review.
Apr 30 2022, 6:40 AM · Restricted Project, Restricted Project
upsj updated the diff for D124359: [clangd] Add inlay hints for mutable reference parameters.

don't add reference inlay hints for r-value refs

Apr 30 2022, 4:19 AM · Restricted Project, Restricted Project
upsj added a reviewer for D124359: [clangd] Add inlay hints for mutable reference parameters: sammccall.
Apr 30 2022, 3:58 AM · Restricted Project, Restricted Project
upsj added a comment to D124688: [clangd] parse all make_unique-like functions in preamble.

Thanks for checking! Putting it behind a flag was my intention from the start anyways, since ideally I would like to traverse the AST through something like emplace_back ->construct/realloc_insert -> allocator::construct until I reach a non-forwarding function.
Do you have some pointers on what needs to be done to add a new flag? I am still kind of new to LLVM development :)

Apr 30 2022, 3:56 AM · Restricted Project, Restricted Project
upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

restore some of the previous behavior

Apr 30 2022, 3:40 AM · Restricted Project, Restricted Project, Restricted Project

Apr 29 2022

upsj added inline comments to D124359: [clangd] Add inlay hints for mutable reference parameters.
Apr 29 2022, 1:38 PM · Restricted Project, Restricted Project
upsj requested review of D124688: [clangd] parse all make_unique-like functions in preamble.
Apr 29 2022, 11:00 AM · Restricted Project, Restricted Project
upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

improve handling of disabled libedit

Apr 29 2022, 9:02 AM · Restricted Project, Restricted Project, Restricted Project
upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

revert remaining unnecessary change from initial diff

Apr 29 2022, 8:45 AM · Restricted Project, Restricted Project, Restricted Project
upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

fix broken build without libedit, improve find module

Apr 29 2022, 8:44 AM · Restricted Project, Restricted Project, Restricted Project
upsj updated the diff for D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.

The previous setup didn't work for clang-query, so I added a CMake IMPORTED target for LibEdit and used it everywhere

Apr 29 2022, 8:38 AM · Restricted Project, Restricted Project, Restricted Project
upsj requested review of D124673: [llvm][lldb] use FindLibEdit.cmake everywhere.
Apr 29 2022, 7:55 AM · Restricted Project, Restricted Project, Restricted Project

Apr 27 2022

upsj planned changes to D124373: [clang] add parameter pack/pack expansion matchers.

I wasn't aware of that, sounds perfect, thanks! Then I'll put this on hold until I figure out if it's really necessary.

Apr 27 2022, 12:50 PM · Restricted Project, Restricted Project
upsj added a comment to D124373: [clang] add parameter pack/pack expansion matchers.

This is part of my long-term goal to add support for forwarding parameters and documentation for make_unique-like functions to clangd. To be fair, the details are not entirely fleshed out - for inlay hints (displaying parameter names inline), the entire function template is already available in an instantiated form, so I can work with existing matchers. For signature help (displaying which parameters are available, which one is active while typing), IIRC you only have the template instantiation pattern available, so I need to find the necessary parts of the AST myself.

Apr 27 2022, 12:28 PM · Restricted Project, Restricted Project
upsj added a reviewer for D124373: [clang] add parameter pack/pack expansion matchers: aaron.ballman.
Apr 27 2022, 5:21 AM · Restricted Project, Restricted Project
upsj updated the diff for D124373: [clang] add parameter pack/pack expansion matchers.

formatting

Apr 27 2022, 5:20 AM · Restricted Project, Restricted Project
upsj updated the diff for D124359: [clangd] Add inlay hints for mutable reference parameters.

add tests for reference inlay hints

Apr 27 2022, 12:42 AM · Restricted Project, Restricted Project

Apr 26 2022

upsj added a comment to D124344: [clangd] Output inlay hints with `clangd --check`.

@nridge Please do, I don't have commit permissions :)

Apr 26 2022, 11:33 PM · Restricted Project, Restricted Project

Apr 25 2022

upsj requested review of D124373: [clang] add parameter pack/pack expansion matchers.
Apr 25 2022, 3:37 AM · Restricted Project, Restricted Project
upsj updated the diff for D124344: [clangd] Output inlay hints with `clangd --check`.
  • use string literal for toString result
Apr 25 2022, 1:51 AM · Restricted Project, Restricted Project
upsj updated the diff for D124344: [clangd] Output inlay hints with `clangd --check`.

push full patch

Apr 25 2022, 1:18 AM · Restricted Project, Restricted Project
upsj updated the diff for D124344: [clangd] Output inlay hints with `clangd --check`.

Review updates

Apr 25 2022, 1:15 AM · Restricted Project, Restricted Project
upsj updated the diff for D124344: [clangd] Output inlay hints with `clangd --check`.
  • format
Apr 25 2022, 12:51 AM · Restricted Project, Restricted Project
upsj requested review of D124359: [clangd] Add inlay hints for mutable reference parameters.
Apr 25 2022, 12:17 AM · Restricted Project, Restricted Project

Apr 24 2022

upsj added inline comments to D124344: [clangd] Output inlay hints with `clangd --check`.
Apr 24 2022, 10:59 PM · Restricted Project, Restricted Project
upsj updated the diff for D124344: [clangd] Output inlay hints with `clangd --check`.

forgot to include the old changes in the diff

Apr 24 2022, 10:58 PM · Restricted Project, Restricted Project