[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-18 Thread Nathan Ridge via cfe-commits
@@ -444,7 +444,7 @@ const RawComment *ASTContext::getRawCommentForAnyRedecl( return CommentlessRedeclChains.lookup(CanonicalD); }(); - for (const auto Redecl : D->redecls()) { + for (const auto Redecl : CanonicalD->redecls()) { HighCommander4 wrote: (

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-18 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/108475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-18 Thread Nathan Ridge via cfe-commits
@@ -444,7 +444,7 @@ const RawComment *ASTContext::getRawCommentForAnyRedecl( return CommentlessRedeclChains.lookup(CanonicalD); }(); - for (const auto Redecl : D->redecls()) { + for (const auto Redecl : CanonicalD->redecls()) { HighCommander4 wrote: >

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-11-28 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/117841 >From 367a0cc6b3e1e1f67d023c96e06ae438f8f37f37 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 26 Nov 2024 22:41:43 -0500 Subject: [PATCH] [clang] Compute accurate begin location for CallExpr with

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-11-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Updated to add a clangd test that fails with the previous fix approach. > A more general implementation of `CallExpr::getBeginLoc` that occurs to me > is: return the earlier of the callee's begin loc and the first argument's (if > present) begin loc. I did not do this be

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-11-28 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/117841 >From 3e5e55fa72c04996dfde1304662e9def6a1ef726 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Fri, 29 Nov 2024 00:08:40 -0500 Subject: [PATCH] [clang] Compute accurate begin location for CallExpr with

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-11-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: (Removed extraneous formatting changes) https://github.com/llvm/llvm-project/pull/117841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Check getFunctionTypeLoc() for validity in InlayHintVisitor (PR #117296)

2024-11-22 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/117296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support symbolTags for document symbol (PR #113669)

2024-11-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I tried to build clangd from [my github > action](https://github.com/chouzz/clangd/actions/workflows/autobuild.yaml), > but I failed, maybe @HighCommander4 could help point out how to build clangd > via github actions with specify branch? What is it that you're trying

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-11-27 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/117673 >From 65f93cd05d9d792bba9a07bda738503f43221221 Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Mon, 18 Sep 2023 03:01:03 -0400 Subject: [PATCH 1/8] [clangd] Support outgoing calls in call hierarchy

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-11-28 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @kadircet Thanks for having a look. I made a few updates to the PR: * Implemented remote index support (https://github.com/llvm/llvm-project/pull/117673/commits/d380984cecf18b53b6e2fdd4266702dcb8ea513a) * Implemented a config option (https://github.com/llvm/llvm-project

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-11-28 Thread Nathan Ridge via cfe-commits
@@ -88,9 +90,12 @@ struct UpdateIndexCallbacks : public ParsingCallbacks { indexStdlib(CI, std::move(*Loc)); // FIndex outlives the UpdateIndexCallbacks. -auto Task = [FIndex(FIndex), Path(Path.str()), Version(Version.str()), +auto Task = [this, FIndex(FIndex

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-18 Thread Nathan Ridge via cfe-commits
@@ -443,13 +461,26 @@ class DefineOutline : public Tweak { SameFile = true; // Bail out if the template parameter is unnamed. +// FIXME: Is this really needed? It inhibits application on HighCommander4 wrote: Reviewing the discussion

[clang-tools-extra] [clangd] Check for other clangd extension capabilities under 'experimental' (PR #116531)

2024-11-18 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/116531 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Harden incomingCalls() against possible misinterpretation of a range as pertaining to the wrong file (PR #111616)

2024-11-16 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/111616 >From 3d0c93948072cd2412a656a38f48de3d6e23e996 Mon Sep 17 00:00:00 2001 From: timon-ul Date: Sun, 3 Nov 2024 07:38:25 +0100 Subject: [PATCH 1/3] Support call hierarchy for fields and non-local variables

[clang-tools-extra] [clangd] Harden incomingCalls() against possible misinterpretation of a range as pertaining to the wrong file (PR #111616)

2024-11-16 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/111616 >From c72cc8dedc165091654eb5d922927319327f34c4 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 8 Oct 2024 21:43:55 -0400 Subject: [PATCH] [clangd] Harden incomingCalls() against possible misinterp

[clang-tools-extra] [clangd] Harden incomingCalls() against possible misinterpretation of a range as pertaining to the wrong file (PR #111616)

2024-11-16 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Updated patch with the following changes: * Resolve the potential UAF by storing `clangd::Location` rather than `SymbolLocation` in the `CallsIn` map * Add a testcase for the scenario from [this thread](https://github.com/llvm/llvm-project/pull/111616#discussion_r181041

[clang-tools-extra] [clangd] Harden incomingCalls() against possible misinterpretation of a range as pertaining to the wrong file (PR #111616)

2024-11-16 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/111616 >From d8f59628643bc6eb4d572949d7f9df6df42f0146 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 8 Oct 2024 21:43:55 -0400 Subject: [PATCH] [clangd] Harden incomingCalls() against possible misinterp

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-19 Thread Nathan Ridge via cfe-commits
@@ -130,23 +129,40 @@ getFunctionSourceAfterReplacements(const FunctionDecl *FD, return QualifiedFunc.takeError(); std::string TemplatePrefix; + auto AddToTemplatePrefixIfApplicable = [&](const Decl *D, bool append) { +const TemplateParameterList *Params = D->getDes

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-20 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @ckandeler, perhaps you would be willing to review this patch? I don't seem to have gotten any traction from my usual reviewers over the course of the past year. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commits ma

[clang-tools-extra] [clangd] Fix erroneous qualification of template type parameters (PR #116821)

2024-11-19 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/116821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-14 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/81640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-14 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. Thanks. +1 to taking this targeted fix without waiting for a larger refactor. https://github.com/llvm/llvm-project/pull/81640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-14 Thread Nathan Ridge via cfe-commits
@@ -104,9 +104,12 @@ bool isRootStmt(const Node *N) { // Root statement cannot be partially selected. if (N->Selected == SelectionTree::Partial) return false; - // Only DeclStmt can be an unselected RootStmt since VarDecls claim the entire - // selection range in sel

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-14 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/81640 >From 04687eb4fcc3cc424580c0a0df8044a8b17286f8 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 13 Feb 2024 18:59:16 +0100 Subject: [PATCH 1/6] [clangd] fix extract-to-function for overloaded opera

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-14 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/81640 >From 04687eb4fcc3cc424580c0a0df8044a8b17286f8 Mon Sep 17 00:00:00 2001 From: Julian Schmidt Date: Tue, 13 Feb 2024 18:59:16 +0100 Subject: [PATCH 1/5] [clangd] fix extract-to-function for overloaded opera

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-11-14 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/81640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Check for other clangd extension capabilities under 'experimental' (PR #116531)

2024-11-17 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/116531 This is a follow-up to PR114699, with the same motivation: to support clients which only support adding custom (language-specific or server-specific) capabilities under 'experimental'. >From bdc4d0a15a8

[clang-tools-extra] Rename CODE_OWNERS -> Maintainers (PR #114544)

2024-11-15 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. https://github.com/llvm/llvm-project/pull/114544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Fix the modification detection logic in `ClangdLSPServer::applyConfiguration`. (PR #115438)

2024-11-15 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. Thanks, this LGTM. It would be nice to have a test exercising `applyConfiguration` itself, but I realize we don't currently have such tests (and that the intended effect -- that an open file whose command did not change does **not**

[clang-tools-extra] [clangd] Fix the modification detection logic in `ClangdLSPServer::applyConfiguration`. (PR #115438)

2024-11-15 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/115438 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-17 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/112345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-17 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. LGTM with minor comments addressed https://github.com/llvm/llvm-project/pull/112345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-17 Thread Nathan Ridge via cfe-commits
@@ -202,7 +218,8 @@ deleteTokensWithKind(const syntax::TokenBuffer &TokBuf, tok::TokenKind Kind, llvm::Expected getFunctionSourceCode(const FunctionDecl *FD, const DeclContext *TargetContext, const syntax::TokenBuffer &TokBuf, - const

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-17 Thread Nathan Ridge via cfe-commits
@@ -130,23 +129,40 @@ getFunctionSourceAfterReplacements(const FunctionDecl *FD, return QualifiedFunc.takeError(); std::string TemplatePrefix; + auto AddToTemplatePrefixIfApplicable = [&](const Decl *D, bool append) { +const TemplateParameterList *Params = D->getDes

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-17 Thread Nathan Ridge via cfe-commits
@@ -130,23 +129,40 @@ getFunctionSourceAfterReplacements(const FunctionDecl *FD, return QualifiedFunc.takeError(); std::string TemplatePrefix; + auto AddToTemplatePrefixIfApplicable = [&](const Decl *D, bool append) { HighCommander4 wrote: nit: UpperCa

[clang-tools-extra] [clangd] Check for editsNearCursor client capability under experimental capabilities (PR #114699)

2024-11-17 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > > (No action required) – we have other extensions in clangd e.g. > > `references.container` `offsetEncoding`. Do we plan to do the same thing > > for them? > > Good question; I was initially thinking of doing it as needed / when someone > asks for it. But maybe it woul

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/108005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Thanks! Generally looks pretty good, a few minor comments / cleanups and this should be good to go. https://github.com/llvm/llvm-project/pull/108005 ___ cfe-commits mailing list

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -126,11 +126,29 @@ struct Config { std::vector FullyQualifiedNamespaces; } Style; + /// controls the completion options for argument lists. + enum class ArgumentListsOption { HighCommander4 wrote: naming suggestion: `ArgumentListsPolicy`, for consi

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -242,13 +242,16 @@ opt FallbackStyle{ init(clang::format::DefaultFallbackStyle), }; -opt EnableFunctionArgSnippets{ -"function-arg-placeholders", -cat(Features), -desc("When disabled, completions contain only parentheses for " - "function calls. When

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -561,14 +561,32 @@ struct CodeCompletionBuilder { } std::string summarizeSnippet() const { + +/// localize a ArgList depending on the config. If the config is unset we +/// will use our local (this) version, else use the one of the config +const Config::Argu

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -504,10 +504,10 @@ struct FragmentCompiler { auto Fast = isFastTidyCheck(Str); if (!Fast.has_value()) { diag(Warning, - llvm::formatv( - "Latency of clang-tidy check '{0}' is not known. " - "It will only run if

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -2595,10 +2596,10 @@ TEST(SignatureHelpTest, DynamicIndexDocumentation) { ElementsAre(AllOf(sig("foo() -> int"), sigDoc("Member doc"; } -TEST(CompletionTest, CompletionFunctionArgsDisabled) { +TEST(CompletionTest, ArgumentListsNotFullPlaceholders) { --

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -622,6 +622,31 @@ struct FragmentCompiler { C.Completion.AllScopes = AllScopes; }); } +if (F.ArgumentLists) { HighCommander4 wrote: We have a `compileEnum` helper to do this more easily, see [the handling of `BackgroundPolicy`

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -694,13 +698,20 @@ class FlagsConfigProvider : public config::Provider { BGPolicy = Config::BackgroundPolicy::Skip; } +if (PlaceholderOption == Config::ArgumentListsOption::Delimiters) { + ArgumentLists = PlaceholderOption; +} + Frag = [=](const

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -230,6 +230,10 @@ class Parser { if (auto AllScopes = boolValue(N, "AllScopes")) F.AllScopes = *AllScopes; }); +Dict.handle("ArgumentLists", [&](Node &N) { + if (auto ArgumentLists = scalarValue(N, "ArgumentLists")) HighCommander4

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -6,6 +6,7 @@ // //===--===// +#include "../Config.h" HighCommander4 wrote: This can be included without the `../`. (Please alphabetize it among the existing includes.) https://github.co

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -308,6 +309,13 @@ struct Fragment { /// Whether code completion should include suggestions from scopes that are /// not visible. The required scope prefix will be inserted. std::optional> AllScopes; +/// How to present the argument list between '()' and '<>':

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -126,11 +126,29 @@ struct Config { std::vector FullyQualifiedNamespaces; } Style; + /// controls the completion options for argument lists. + enum class ArgumentListsOption { +/// the default value. This will imply FullPlaceholders unless overridden by +///

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
@@ -126,11 +126,29 @@ struct Config { std::vector FullyQualifiedNamespaces; } Style; + /// controls the completion options for argument lists. + enum class ArgumentListsOption { +/// the default value. This will imply FullPlaceholders unless overridden by +///

[clang-tools-extra] issue-63565: community requested small QoL fix for more configurabili… (PR #108005)

2024-09-17 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > As mentions in [this > post](https://github.com/llvm/llvm-project/issues/63565#issuecomment-2337396222): > these to issues remain within vsocde/vscode-clangd: > >* None: after completion an error squiggly line will occur on the > identifier. Would be slightly nicer

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-17 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @zyn0217 I've debugged the `DefineInlineTest.AddInline` failure with your new suggested change, it concerns the following scenario: header.h ```c++ template void foo(); template <> void foo(); ``` source.cpp: ```c++ #include "header.h" template <> void foo() {} ``` It s

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-01 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/118236 >From 37eb30a2b99daa1f30da3bd53e2a92588cbde0f9 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 1 Dec 2024 19:58:03 -0500 Subject: [PATCH] [clang] [Sema] Preserve nested name specifier prefix in Me

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-01 Thread Nathan Ridge via cfe-commits
@@ -5347,15 +5347,18 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: - ClsType = QualType(NNS->getAsType(), 0); - // Note: if t

[clang-tools-extra] [NFC] Fix uninitialized scalar field in constructor. (PR #118324)

2024-12-02 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Seems like `MemIndex::IdxContents` has the same issue. It's a bit suspicious to me that the other `DexIndex` and `MemIndex` constructors are not passing in a `IndexContents` value. Either there's a bug lurking there, or the field is only relevant in certain situations (e.

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/77556 >From f3d2263730129760da56254d145bd69d66463775 Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Mon, 18 Sep 2023 03:01:03 -0400 Subject: [PATCH 1/5] [clangd] Support outgoing calls in call hierarchy T

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/77556 >From f3d2263730129760da56254d145bd69d66463775 Mon Sep 17 00:00:00 2001 From: Quentin Chateau Date: Mon, 18 Sep 2023 03:01:03 -0400 Subject: [PATCH 1/4] [clangd] Support outgoing calls in call hierarchy T

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Rebased. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
@@ -2346,11 +2346,11 @@ outgoingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) { // Filter references to only keep function calls HighCommander4 wrote: Reworded https://github.com/llvm/llvm-project/pull/77556 ___

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
@@ -88,56 +89,6 @@ # CHECK-NEXT: } # CHECK-NEXT: ] --- -{"jsonrpc":"2.0","id":2,"method":"typeHierarchy/subtypes","params":{"item":{"uri":"test:///main.cpp","data":{"parents":[{"parents":[{"parents":[],"symbolID":"FE546E7B648D69A7"}],"symbolID":"ECDC0C46D75120F4"}],"symbol

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
@@ -2346,11 +2346,11 @@ outgoingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) { // Filter references to only keep function calls using SK = index::SymbolKind; auto Kind = Callee.SymInfo.Kind; -if (Kind != SK::Function && Kind != SK::InstanceMet

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
@@ -1700,6 +1700,7 @@ declToHierarchyItem(const NamedDecl &ND, llvm::StringRef TUPath) { HierarchyItem HI; HI.name = printName(Ctx, ND); + // FIXME: Populate HI.detail the way we do in symbolToHierarchyItem? HighCommander4 wrote: The difference between

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
@@ -1751,6 +1752,7 @@ static std::optional symbolToHierarchyItem(const Symbol &S, } HierarchyItem HI; HI.name = std::string(S.Name); + HI.detail = (S.Scope + S.Name).str(); HighCommander4 wrote: I agree, showing the signature here would be quite useful

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Thanks @ckandeler for the review! I addressed the comments in https://github.com/llvm/llvm-project/pull/77556/commits/bad4f7264433417763ea35bc1104fb087c8725e5. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commits maili

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-11-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: I've fixed the build failure that was reported by the majority of the buildbots (which is just a new test case using a test utility function that the patch renames). However, there is an additional build failured reported by [this buildbot](https://github.com/llvm/llvm-p

[clang-tools-extra] [clangd] Drop requirement for named template parameters (PR #117565)

2024-11-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/117565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Resubmitted with the build failures fixed at https://github.com/llvm/llvm-project/pull/117673. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-11-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/117673 Previously reviewed at https://github.com/llvm/llvm-project/pull/77556 but was backed out due to build failures. >From 65f93cd05d9d792bba9a07bda738503f43221221 Mon Sep 17 00:00:00 2001 From: Quentin Chat

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
@@ -1700,6 +1700,7 @@ declToHierarchyItem(const NamedDecl &ND, llvm::StringRef TUPath) { HierarchyItem HI; HI.name = printName(Ctx, ND); + // FIXME: Populate HI.detail the way we do in symbolToHierarchyItem? HighCommander4 wrote: See also https://github

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > Appears to work fine. Regarding the slight memory increase: If anyone feels > strongly about it, they had plenty of time to chime in. Thanks! I'll go ahead and merge. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-com

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Revert "[clangd] Support outgoing calls in call hierarchy (#77556)" (PR #117668)

2024-11-25 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/117668 This reverts commit ca184cfc088a843e545e5f04b48813e6f9bfba77. >From 08003a8cc09ad8a6afab582be0d90078d84e617b Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Tue, 26 Nov 2024 00:07:31 -0500 Subject: [PA

[clang-tools-extra] Revert "[clangd] Support outgoing calls in call hierarchy (#77556)" (PR #117668)

2024-11-25 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Reverting https://github.com/llvm/llvm-project/pull/77556 due to build breakage. https://github.com/llvm/llvm-project/pull/117668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-01 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 converted_to_draft https://github.com/llvm/llvm-project/pull/118236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-01 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: (Marked as Draft since there are test failures I need to investigate.) https://github.com/llvm/llvm-project/pull/118236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-01 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/118236 Fixes https://github.com/llvm/llvm-project/issues/118198 >From 675aec86732ff4c46250fa0b17cd571387ca4ade Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 1 Dec 2024 19:58:03 -0500 Subject: [PATCH] [

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-01 Thread Nathan Ridge via cfe-commits
@@ -5347,13 +5347,16 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: - ClsType = QualType(NNS->getAsType(), 0); + const Type *N

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-12-03 Thread Nathan Ridge via cfe-commits
@@ -149,15 +150,18 @@ void Dex::buildIndex() { InvertedIndex = std::move(Builder).build(); // Build RevRefs - for (const auto &[ID, RefList] : Refs) -for (const auto &R : RefList) - if ((R.Kind & ContainedRefsRequest::SupportedRefKinds) != - RefKind::Unk

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-12-03 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I was trying to imply a knob like > https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clangd/ClangdServer.h#L111. > I don't think the knob needs to be exposed to end-users directly, only > having programmatic access is fine initially. Thanks, that is ind

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-12-03 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/117673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-12-03 Thread Nathan Ridge via cfe-commits
@@ -1639,11 +1639,19 @@ SourceLocation CallExpr::getBeginLoc() const { if (const auto *OCE = dyn_cast(this)) return OCE->getBeginLoc(); + if (const auto *Method = + dyn_cast_if_present(getCalleeDecl()); HighCommander4 wrote: Sorry, I'm not qui

[clang-tools-extra] [clangd] Handle DeducedTemplateSpecializationType in HeuristicResolver (PR #119107)

2024-12-07 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/119107 Fixes https://github.com/clangd/clangd/issues/2227 >From 85307a28e99c596afb47059ddea6f1e574ca55bf Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sat, 7 Dec 2024 22:03:02 -0500 Subject: [PATCH] [clangd

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-12-08 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I didn't check if any tests fail but here's a version where `CallExpr` saves > its `BeginLoc` explicitly: > http://llvm-compile-time-tracker.com/compare.php?from=416e4cd332c7421b187844ac9aaf6fe28b575a7d&to=0b6e36fe460409aa59958b79766b4f64a31c97e6&stat=instructions:u Yea

[clang-tools-extra] [clangd] Do not show `aParam` parameter hint for argument spelled `param` (PR #119162)

2024-12-08 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/119162 Fixes https://github.com/clangd/clangd/issues/2248 >From c207c5d0d651b564acec0a0b6ef257fb89752ba0 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Mon, 21 Oct 2024 02:34:15 -0400 Subject: [PATCH] [clang

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-08 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: @ckandeler Could you elaborate on the motivation for this change? In my mind, the value proposition of the "extract variable" refactoring is that it saves you the work of moving the expression from one location to another, and typing the name of the variable twice (once a

[clang] [clang] [Sema] Add assertion about expected type classes when building MemberPointerType (PR #119105)

2024-12-08 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: (This was meant as a follow-up to https://github.com/llvm/llvm-project/pull/118236 to add the assertion discussed in [this comment](https://github.com/llvm/llvm-project/pull/118236#discussion_r1865179512), but I'm not proceeding with it because the assertion is tripped i

[clang] [clang] [Sema] Add assertion about expected type classes when building MemberPointerType (PR #119105)

2024-12-08 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/119105 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-05 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/118236 >From 4594891422173161267c711ff133676fb9e8ebb1 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 1 Dec 2024 19:58:03 -0500 Subject: [PATCH] [clang] [Sema] Preserve nested name specifier prefix in Me

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-05 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: I updated the patch to do the wrapping into `ElaboratedType` even if a prefix isn't present, and updated the various failing tests accordingly. I haven't added an assert, as explained in the previous comment. https://github.com/llvm/llvm-project/pull/118236 __

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-05 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/118236 >From 9fe707f202719ea4c05934eafaa58c11efd01cbd Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sun, 1 Dec 2024 19:58:03 -0500 Subject: [PATCH] [clang] [Sema] Preserve nested name specifier prefix in Me

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-05 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: Fixed one additional test failure. https://github.com/llvm/llvm-project/pull/118236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add clarifying comment about when Dex::IdxContents is populated (PR #118906)

2024-12-08 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/118906 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add clarifying comment about when Dex::IdxContents is populated (PR #118906)

2024-12-08 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/118906 >From 45311dbceed8d438f2ac0db5019719a7fa32c0bf Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Thu, 5 Dec 2024 19:45:25 -0500 Subject: [PATCH] [clangd] Add clarifying comment about when Dex::IdxContents

[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

2024-12-07 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > I would appreciate confirmation that this will indeed be possible with the > upcoming **clangd** changes. Yes, the returned data is sufficient for clients to implement either of the above presentations. https://github.com/llvm/llvm-project/pull/117673 _

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-12-07 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > The branch is **not** taken most of the time (it's only taken for calls to > functions with an explicit object argument, which is a C++23 feature), so > perhaps annotating the branch as "unlikely" is sufficient to avoid the > performance regression? Ah, no, that's not

[clang] [clang-tools-extra] [clang] Compute accurate begin location for CallExpr with explicit object parameter (PR #117841)

2024-12-07 Thread Nathan Ridge via cfe-commits
HighCommander4 wrote: > It looks like this causes a significant compile-time regression: > https://llvm-compile-time-tracker.com/compare.php?from=2b855dd97092e2178ac5c470a804a17ec440d7e5&to=9ccde12f5eeb91152900082a2ae839e2a9702b31&stat=instructions:u > (Maybe most clearly seen during clang boot

[clang] [clang] [Sema] Add assertion about expected type classes when building MemberPointerType (PR #119105)

2024-12-07 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 created https://github.com/llvm/llvm-project/pull/119105 None >From 6c900d6cc82aab791504a0b96e1e72310d2ec24d Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Sat, 7 Dec 2024 20:20:52 -0500 Subject: [PATCH] [clang] [Sema] Add assertion about expected type clas

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-07 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/118236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-07 Thread Nathan Ridge via cfe-commits
@@ -5347,13 +5347,16 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: - ClsType = QualType(NNS->getAsType(), 0); + const Type *N

<    2   3   4   5   6   7   8   9   10   >