[PATCH] D135518: [clangAST] support TypeLoc in TextNodeDumper

2022-10-14 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. 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 CHANGES SINCE LAST ACTION

[PATCH] D135518: [clangAST] support TypeLoc in TextNodeDumper

2022-10-14 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang/include/clang/AST/TextNodeDumper.h:337 + void VisitConstantArrayTypeLoc(ConstantArrayTypeLoc TL); + void VisitVariableArrayTypeLoc(VariableArrayTypeLoc TL); + void VisitDependentSizedArrayTypeLoc(DependentSizedArrayTypeLoc TL);

[PATCH] D135518: [clangAST] support TypeLoc in TextNodeDumper

2022-10-14 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 467698. upsj marked 6 inline comments as done. upsj added a comment. 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

[PATCH] D135518: [clangAST] support TypeLoc in TextNodeDumper

2022-10-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: aaron.ballman. Herald added a project: All. upsj requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. TextNodeDumper currently doesn't support printing the `TypeLoc` hierarchy, which makes

[PATCH] D130260: [clangd] Make forwarding parameter detection logic resilient

2022-07-22 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:832 continue; +// Check that this expands all the way until the last parameter. +auto ParamEnd = It + Parameters.size() - 1; sammccall wrote: > The essence of

[PATCH] D130260: [clangd] Make forwarding parameter detection logic resilient

2022-07-22 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj accepted this revision. upsj added a comment. This revision is now accepted and ready to land. Not sure I qualify as a suitable reviewer, but this looks really good to me, save for maybe a small safety measure :) Comment at: clang-tools-extra/clangd/AST.cpp:833-837 +

[PATCH] D130260: [clangd] Make forwarding parameter detection logic resilient

2022-07-22 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. 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,

[PATCH] D130259: [clangd] fix crash and handle implicit conversions in inlay hints for forwarding functions

2022-07-22 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj abandoned this revision. upsj added a comment. Superseded by https://reviews.llvm.org/D130260 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130259/new/ https://reviews.llvm.org/D130259 ___

[PATCH] D130265: [clangd] resolve forwarded parameters in Hover

2022-07-21 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added reviewers: sammccall, kadircet. upsj added a project: clang-tools-extra. Herald added subscribers: usaxena95, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. This

[PATCH] D130259: [clangd] fix crash and handle implicit conversions in inlay hints for forwarding functions

2022-07-21 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/unittests/InlayHintTests.cpp:721 +} + )cpp" /*, ExpectedHint{"s: ", "param1"}, ExpectedHint{"x: ", "param2"}*/); +} I'm not sure whether we should detect this case, since it would be nice to

[PATCH] D130259: [clangd] fix crash and handle implicit conversions in inlay hints for forwarding functions

2022-07-21 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added reviewers: nridge, sammccall, kadircet. upsj added a project: clang-tools-extra. Herald added subscribers: usaxena95, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-07-06 Thread Tobias Ribizel via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa638648fef76: [clangd] add inlay hints for std::forward-ed parameter packs (authored by upsj). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-07-05 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. @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 :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-07-01 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 441646. upsj added a comment. don't add reference hints to unresolved parameter packs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 Files:

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-30 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/InlayHints.cpp:483 + !Type.getNonReferenceType().isConstQualified() && + !isExpandedParameterPack(Param); } sammccall wrote: > upsj wrote: > > sammccall wrote: > > > upsj

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-30 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 441520. upsj marked 3 inline comments as done. upsj added a comment. detect whether forwarding functions preserve reference-ness and value categories of their arguments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-29 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj marked an inline comment as done. upsj added a comment. yes, I have commit access Comment at: clang-tools-extra/clangd/InlayHints.cpp:483 + !Type.getNonReferenceType().isConstQualified() && + !isExpandedParameterPack(Param); }

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-29 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:690 +getPackTemplateParameter(const FunctionDecl *Callee) { + if (const auto *TemplateDecl = Callee->getPrimaryTemplate()) { +auto TemplateParams = TemplateDecl->getTemplateParameters()->asArray();

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-29 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 440921. upsj marked 14 inline comments as done. upsj added a comment. - simplify parameter pack detection - improve function naming - make handling of unexpanded packs and varargs more visible - add tests involving template specializations - make documentation

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-28 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. can you give this another look, if you have some time @sammccall? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 ___ cfe-commits mailing

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-16 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:682 + if (const auto *TTPD = + dyn_cast(TemplateParams.back())) { +const auto *TTPT = nridge wrote: > upsj wrote: > > nridge wrote: > > > I don't think there is

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-16 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 437508. upsj marked 4 inline comments as done. upsj added a comment. - 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

[PATCH] D127859: [clangd] Don't add inlay hints on std::move/forward

2022-06-16 Thread Tobias Ribizel via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe984e1cd6137: [clangd] Dont add inlay hints on std::move/forward (authored by upsj). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127859/new/

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-15 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:682 + if (const auto *TTPD = + dyn_cast(TemplateParams.back())) { +const auto *TTPT = nridge wrote: > I don't think there is any requirement that a pack be a

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-15 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 437194. upsj marked 9 inline comments as done. upsj added a comment. - improve documentation - add more edge case tests - fix reference hints for parameter packs - remove unnecessary headers - fix bug in handling of tail parameters Repository: rG LLVM Github

[PATCH] D127859: [clangd] Don't add inlay hints on std::move/forward

2022-06-15 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: nridge. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. This

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-10 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. @nridge @sammccall can you give this another look? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 ___ cfe-commits mailing list

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-04 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:772 + size_t PackLocation = OptPackLocation.getValue(); + ArrayRef MatchingParams = + Callee->parameters().slice(PackLocation, Parameters.size()); Similar to processCall

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-04 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 434262. upsj added a comment. add test for varargs function called from forwarding function Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 Files:

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-04 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 434257. upsj added a comment. This is now ready to review, only needed to fix a formatting issue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 Files:

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-06-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 433732. upsj added a comment. - fix varargs, again :) - remove parameter names entirely if they occur multiple times Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-30 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 432900. upsj marked an inline comment as done. upsj added a comment. 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

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-27 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 432518. upsj added a comment. 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

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-26 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. 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

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-23 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. Yes, I think that's a good summary. Only a small clarification: > we could query separately where each arg is forwarded to. For multiple > forwards, the recursive step is "what param is arg N of this callee > ultimately bound to" I was thinking of implementing this as

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-22 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj planned changes to this revision. upsj marked 15 inline comments as done. upsj added a comment. 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

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-16 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. @sammccall Feel free to merge with Author: Tobias Ribizel Thanks for the vote of confidence, I'll apply once the forwarding stuff is done :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-16 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 429653. upsj marked 4 inline comments as done. upsj added a comment. review updates Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/ https://reviews.llvm.org/D124688 Files:

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-16 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:416 +// These mocks aren't quite right - we omit shared_ptr for simplicity. +// forward is included to show its body is not needed to get the diagnostic. +template T&&

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-16 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 429630. upsj marked an inline comment as done. upsj added a comment. remove std::forward bodies from diagnostic tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/ https://reviews.llvm.org/D124688

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-15 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. @sammccall @nridge can you give this another look? :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/ https://reviews.llvm.org/D124688 ___ cfe-commits mailing list

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. 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

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/InlayHints.cpp:208 +// If the parameter is part of an expanded pack and not yet resolved +if (/*isExpandedParameter(Param) && */ +ForwardedParams.find(Param) == ForwardedParams.end()) {

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427930. upsj added a comment. attempt to fix the patch issue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 Files: clang-tools-extra/clangd/InlayHints.cpp

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427928. upsj added a comment. - add test for emplace-like functions - fix RecursiveASTVisitor early exit - fix handling of skipped parameters Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427911. upsj added a comment. update test docs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/ https://reviews.llvm.org/D124688 Files: clang-tools-extra/clangd/ClangdServer.cpp

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-08 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427910. upsj marked 13 inline comments as done. upsj added a comment. review updates: - Pass ParseForwardingFunctions via ParseOptions - Simplify check for forwarding function - Add test checking diagnostics for make_shared Repository: rG LLVM Github

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427861. upsj added a comment. fix iterator invalidation issue, handle UnresolvedLookupExpr and test recursive and split variadic lookup Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427855. upsj added a comment. updated patch baseline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690 Files: clang-tools-extra/clangd/InlayHints.cpp

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427854. upsj added a comment. accidentally pushed to the wrong revision, this is the previous version Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/ https://reviews.llvm.org/D124688 Files:

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427853. upsj marked an inline comment as done. upsj added a comment. Work around the currently broken isExpandedParameter, also fix the broken diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427852. upsj added a comment. Work around the currently broken isExpandedParameter, also fix the broken diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124688/new/ https://reviews.llvm.org/D124688 Files:

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj marked 10 inline comments as done. upsj added a comment. 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

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-07 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 427851. upsj added a comment. Herald added a subscriber: javed.absar. use an RecursiveASTVisitor instead of ASTMatcher Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124690/new/ https://reviews.llvm.org/D124690

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-05 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. > ! 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

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-05 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj planned changes to this revision. upsj added a comment. 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.

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/InlayHints.cpp:474 +// the parameter names from the wrapped function +if (Args.size() > FixedParamCount && Args.size() == Params.size()) { + auto ForwardedParams = matchForwardedParams(

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/Preamble.cpp:167 +// ... whose template parameter comes from the function directly +if (FT->getTemplateParameters()->getDepth() == +PackTypePtr->getDepth()) {

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 426387. upsj marked 2 inline comments as done. upsj added a comment. Herald added a subscriber: javed.absar. Rewrote detection of forwarding functions in preamble, added `--preamble-parse-forwarding` flag I ran clangd over `bits/stdc++.h`, and it seems like

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 426372. upsj marked an inline comment as done. upsj added a comment. remove unnecessary annotation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/ https://reviews.llvm.org/D124359 Files:

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 426346. upsj marked an inline comment as done. upsj added a comment. add test for const ref inlay hint via type alias Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/ https://reviews.llvm.org/D124359

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 426344. upsj added a comment. right, arcanist doesn't entirely match my git mental model. Here's the (hopefully) complete patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. Thanks, on second thought moving the hint to the prefix also makes more sense to me. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/ https://reviews.llvm.org/D124359 ___

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-05-02 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 426343. upsj marked 4 inline comments as done. upsj added a comment. address review comments: Move reference hint to the prefix, test type aliases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/

[PATCH] D124373: [clang] add parameter pack/pack expansion matchers

2022-05-01 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj abandoned this revision. upsj added a comment. I think we should be able to do this without adding new matchers globally. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124373/new/ https://reviews.llvm.org/D124373

[PATCH] D124690: [clangd] add inlay hints for std::forward-ed parameter packs

2022-04-30 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: nridge. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. upsj updated this revision to Diff 426127. upsj added a comment. upsj added a reviewer: sammccall. upsj updated this revision to Diff 426224. upsj

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-04-30 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 426217. upsj added a comment. don't add reference inlay hints for r-value refs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/ https://reviews.llvm.org/D124359 Files:

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-04-30 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. 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

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-04-29 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added inline comments. Comment at: clang-tools-extra/clangd/InlayHints.cpp:448-450 +return Type->isReferenceType() && + !Type.getNonReferenceType().isConstQualified() + ? (Type->isLValueReferenceType() ? "&" : "&&") It

[PATCH] D124688: [clangd] parse all make_unique-like functions in preamble

2022-04-29 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: nridge. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. I am

[PATCH] D124373: [clang] add parameter pack/pack expansion matchers

2022-04-27 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj planned changes to this revision. upsj added a comment. 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. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124373/new/

[PATCH] D124373: [clang] add parameter pack/pack expansion matchers

2022-04-27 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. 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

[PATCH] D124373: [clang] add parameter pack/pack expansion matchers

2022-04-27 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 425487. upsj added a comment. formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124373/new/ https://reviews.llvm.org/D124373 Files: clang/include/clang/ASTMatchers/ASTMatchers.h

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-04-27 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 425432. upsj added a comment. add tests for reference inlay hints Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124359/new/ https://reviews.llvm.org/D124359 Files: clang-tools-extra/clangd/InlayHints.cpp

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-27 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj added a comment. @nridge Please do, I don't have commit permissions :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/ https://reviews.llvm.org/D124344 ___ cfe-commits mailing list

[PATCH] D124373: [clang] add parameter pack/pack expansion matchers

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: klimek. Herald added a project: All. upsj requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. There is no (obvious to me) way to match pack expansions and parameter packs, so I added two

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 424846. upsj added a comment. - use string literal for toString result Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/ https://reviews.llvm.org/D124344 Files: clang-tools-extra/clangd/Protocol.cpp

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 424839. upsj added a comment. push full patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/ https://reviews.llvm.org/D124344 Files: clang-tools-extra/clangd/Protocol.cpp

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 424838. upsj added a comment. Review updates - Fix inverted check-lines condition - Output InlayHintKind via ostream operators Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/

[PATCH] D124365: review updates

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. - Fix inverted check-lines condition - Output InlayHintKind

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 424836. upsj marked 2 inline comments as done. upsj added a comment. - format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/ https://reviews.llvm.org/D124344 Files:

[PATCH] D124359: [clangd] Add inlay hints for mutable reference parameters

2022-04-25 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: nridge. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. Add a

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-24 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj marked 2 inline comments as done. upsj added inline comments. Comment at: clang-tools-extra/clangd/tool/Check.cpp:195 + // Build Inlay Hints for the entire AST + bool buildInlayHints(llvm::Optional LineRange) { nridge wrote: > The comment should

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-24 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 424817. upsj added a comment. forgot to include the old changes in the diff CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/ https://reviews.llvm.org/D124344 Files: clang-tools-extra/clangd/Protocol.cpp

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-24 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj updated this revision to Diff 424816. upsj added a comment. Output InlayHintKind and improve comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124344/new/ https://reviews.llvm.org/D124344 Files: clang-tools-extra/clangd/Protocol.cpp clang-tools-extra/clangd/Protocol.h

[PATCH] D124344: [clangd] Output inlay hints with `clangd --check`

2022-04-24 Thread Tobias Ribizel via Phabricator via cfe-commits
upsj created this revision. upsj added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. Herald added a project: All. upsj requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra.