[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-27 Thread Kim Gräsman via cfe-commits
kimgr wrote: @sdkrystian Thank you! I think there's some more subtleties to it, but I don't really have my head around it yet. I'll first try to understand what we're trying to achieve and then ping back of I need help with something concrete. https://github.com/llvm/llvm-project/pull/81642

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @kimgr The linked code seems to only be concerned with the `SourceLocation` of the `Decl` (which should be the same `SourceLocation` returned by `Decl::getLocation`), and the template arguments as written (which can be accessed via `getTemplateArgsAsWritten` per this patch).

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-26 Thread Kim Gräsman via cfe-commits
kimgr wrote: @sdkrystian It looks like this PR broke IWYU with respect to this assumption: > Moreover, we don't ever need the type as written -- in almost all cases, we > only want the template arguments (e.g. in tooling use-cases). As I understand it, IWYU did use the type as written to do

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Adrian Prantl via cfe-commits
adrian-prantl wrote: This broke several tests in the LLDB testsuite, I'm going to have to revert this. https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/3480/ https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: This seems to cause a crash in lldb in `ClassTemplateSpecializationDecl::getSourceRange()`... investigating https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Krystian Stasiowski via cfe-commits
@@ -111,6 +111,13 @@ Clang Frontend Potentially Breaking Changes $ clang --target= -print-target-triple +- The ``getTypeAsWritten`` member function has been removed from ``ClassTemplateSpecializationDecl`` and + ``VarTemplateSpecializationDecl``, and a new member

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Aaron Ballman via cfe-commits
@@ -111,6 +111,13 @@ Clang Frontend Potentially Breaking Changes $ clang --target= -print-target-triple +- The ``getTypeAsWritten`` member function has been removed from ``ClassTemplateSpecializationDecl`` and + ``VarTemplateSpecializationDecl``, and a new member

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Krystian Stasiowski via cfe-commits
@@ -111,6 +111,13 @@ Clang Frontend Potentially Breaking Changes $ clang --target= -print-target-triple +- The ``getTypeAsWritten`` member function has been removed from ``ClassTemplateSpecializationDecl`` and + ``VarTemplateSpecializationDecl``, and a new member

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Aaron Ballman via cfe-commits
@@ -111,6 +111,13 @@ Clang Frontend Potentially Breaking Changes $ clang --target= -print-target-triple +- The ``getTypeAsWritten`` member function has been removed from ``ClassTemplateSpecializationDecl`` and + ``VarTemplateSpecializationDecl``, and a new member

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a possible nit with the release note (I don't need to re-review). https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @AaronBallman release note added (feel free to suggest any changes to it :)) https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-06 Thread Krystian Stasiowski via cfe-commits
@@ -764,9 +764,9 @@ AST_POLYMORPHIC_MATCHER(isImplicit, return Node.isImplicit(); } -/// Matches classTemplateSpecializations, templateSpecializationType and -/// functionDecl that have at least one TemplateArgument matching the given -/// InnerMatcher. +/// Matches

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-06 Thread Aaron Ballman via cfe-commits
@@ -764,9 +764,9 @@ AST_POLYMORPHIC_MATCHER(isImplicit, return Node.isImplicit(); } -/// Matches classTemplateSpecializations, templateSpecializationType and -/// functionDecl that have at least one TemplateArgument matching the given -/// InnerMatcher. +/// Matches

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-06 Thread Aaron Ballman via cfe-commits
@@ -4075,9 +4076,8 @@ AST_POLYMORPHIC_MATCHER_P( AST_POLYMORPHIC_SUPPORTED_TYPES( BlockDecl, CXXBaseSpecifier, CXXCtorInitializer, CXXFunctionalCastExpr, CXXNewExpr, CXXTemporaryObjectExpr, CXXUnresolvedConstructExpr, -

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @AaronBallman https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > I'd like someone to review the AST matcher changes (the code owner listed in > `CodeOwners.rst` appears to be inactive). Ah, yes! Unfortunately I think he's the best person to review, I don't know of anyone familiar enough with the matchers. But he'll be back next week.

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I'd like someone to review the AST matcher changes (the code owner listed in `CodeOwners.rst` appears to be inactive). https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-30 Thread Erich Keane via cfe-commits
erichkeane wrote: > Ping @AaronBallman Aaron is on vacation this week, is there feedback from him that you're looking for? https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @AaronBallman https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I added a commit which adds support for matching the `TemplateArgumentLoc`s of explicit specializations directly. https://github.com/llvm/llvm-project/pull/81642 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Krystian Stasiowski via cfe-commits
@@ -6390,6 +6394,7 @@ TEST(HasTemplateArgumentLoc, BindsToSpecializationWithDoubleArgument) { 0, hasTypeLoc(loc(asString("double"))); } +#if 0 sdkrystian wrote: @erichkeane I just pushed a commit which converts all the

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -2596,27 +2588,14 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-04-17 Thread Erich Keane via cfe-commits
@@ -6390,6 +6394,7 @@ TEST(HasTemplateArgumentLoc, BindsToSpecializationWithDoubleArgument) { 0, hasTypeLoc(loc(asString("double"))); } +#if 0 erichkeane wrote: Ping on this.