[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-07-02 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Good catch, sorry for that! Let's move it under `Non-comprehensive list of changes in this release`, WDYT? https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-07-02 Thread Balazs Benics via cfe-commits
steakhal wrote: > Release note added in > [e33dc6b](https://github.com/llvm/llvm-project/commit/e33dc6b0282fb28d5289490981ad57d97d83db42), > thank you for the improvements! @AaronBallman It appears that that commit added an entry to the Static Analyzer section, and I'm not sure if that's the

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-01-31 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Release note added in e33dc6b0282fb28d5289490981ad57d97d83db42, thank you for the improvements! https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-01-31 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-01-31 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Ping Since we've not heard from @sam-mccall in a while and this was already approved and ready to go aside from a release note, I think it's fine to land this as-is and push a release note on Sam's behalf. I don't think we need to cherry-pick this to 18.x though.

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-01-31 Thread via cfe-commits
cor3ntin wrote: Ping https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2024-01-18 Thread via cfe-commits
cor3ntin wrote: @sam-mccall Do you think you could add a release note? I think it would be useful to try to land this in Clang 18. Thanks! https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-12-20 Thread via cfe-commits
cor3ntin wrote: @sam-mccall are you still working on this? https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-10-13 Thread Aaron Ballman via cfe-commits
@@ -415,9 +443,55 @@ class ASTNodeTraverser if (!T->isSugared()) Visit(T->getPattern()); } + void VisitAutoType(const AutoType *T) { +for (const auto : T->getTypeConstraintArguments()) + Visit(Arg); + } // FIXME: ElaboratedType, DependentNameType,

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-10-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, but please add a release note so users know about the improvement. https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-10-13 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-29 Thread Sam McCall via cfe-commits
sam-mccall wrote: (gentle ping) https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes The ability to dump AST nodes is important to ad-hoc debugging, and the fact this doesn't work with TypeLoc nodes is an obvious missing feature in e.g. clang-query (`set output dump` simply does nothing). Having TypeLoc::dump(), and enabling

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread via cfe-commits
https://github.com/llvmbot labeled https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall updated https://github.com/llvm/llvm-project/pull/65484: >From f2269d93e313378581085bca418914229316bfc6 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Mon, 4 Sep 2023 15:48:47 +0200 Subject: [PATCH 1/3] [AST] Add dump() method to TypeLoc The ability to dump AST

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
@@ -458,6 +532,9 @@ class ASTNodeTraverser if (Traversal == TK_IgnoreUnlessSpelledInSource && D->isCXXForRangeDecl()) return; +if (VisitLocs) sam-mccall wrote: Yes, there may be others but for now this is the only place I found where a Loc

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall resolved https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
@@ -415,9 +443,55 @@ class ASTNodeTraverser if (!T->isSugared()) Visit(T->getPattern()); } + void VisitAutoType(const AutoType *T) { +for (const auto : T->getTypeConstraintArguments()) + Visit(Arg); + } // FIXME: ElaboratedType, DependentNameType,

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall resolved https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
@@ -96,6 +96,21 @@ void JSONNodeDumper::Visit(QualType T) { JOS.attribute("qualifiers", T.split().Quals.getAsString()); } +void JSONNodeDumper::Visit(TypeLoc TL) { + if (TL.isNull()) +return; + JOS.attribute("kind", +(llvm::Twine(TL.getTypeLocClass()

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall resolved https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall resolved https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
@@ -458,6 +532,9 @@ class ASTNodeTraverser if (Traversal == TK_IgnoreUnlessSpelledInSource && D->isCXXForRangeDecl()) return; +if (VisitLocs) + if (const auto *TSI = D->getTypeSourceInfo()) +Visit(TSI->getTypeLoc()); sam-mccall

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
@@ -415,9 +443,55 @@ class ASTNodeTraverser if (!T->isSugared()) Visit(T->getPattern()); } + void VisitAutoType(const AutoType *T) { +for (const auto : T->getTypeConstraintArguments()) + Visit(Arg); + } // FIXME: ElaboratedType, DependentNameType,

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall resolved https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
@@ -223,6 +238,22 @@ void JSONNodeDumper::Visit(const APValue , QualType Ty) { JOS.attribute("value", OS.str()); } +void JSONNodeDumper::Visit(const ConceptReference *CR) { + JOS.attribute("kind", "ConceptReference"); + JOS.attribute("id",

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-11 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall edited https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-08 Thread Aaron Ballman via cfe-commits
@@ -415,9 +443,55 @@ class ASTNodeTraverser if (!T->isSugared()) Visit(T->getPattern()); } + void VisitAutoType(const AutoType *T) { +for (const auto : T->getTypeConstraintArguments()) + Visit(Arg); + } // FIXME: ElaboratedType, DependentNameType,

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-08 Thread Aaron Ballman via cfe-commits
@@ -458,6 +532,9 @@ class ASTNodeTraverser if (Traversal == TK_IgnoreUnlessSpelledInSource && D->isCXXForRangeDecl()) return; +if (VisitLocs) + if (const auto *TSI = D->getTypeSourceInfo()) +Visit(TSI->getTypeLoc()); AaronBallman

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-08 Thread Aaron Ballman via cfe-commits
@@ -415,9 +443,55 @@ class ASTNodeTraverser if (!T->isSugared()) Visit(T->getPattern()); } + void VisitAutoType(const AutoType *T) { +for (const auto : T->getTypeConstraintArguments()) + Visit(Arg); + } // FIXME: ElaboratedType, DependentNameType,

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-07 Thread Shafik Yaghmour via cfe-commits
@@ -96,6 +96,21 @@ void JSONNodeDumper::Visit(QualType T) { JOS.attribute("qualifiers", T.split().Quals.getAsString()); } +void JSONNodeDumper::Visit(TypeLoc TL) { + if (TL.isNull()) +return; + JOS.attribute("kind", +(llvm::Twine(TL.getTypeLocClass()

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread via cfe-commits
@@ -223,6 +238,22 @@ void JSONNodeDumper::Visit(const APValue , QualType Ty) { JOS.attribute("value", OS.str()); } +void JSONNodeDumper::Visit(const ConceptReference *CR) { + JOS.attribute("kind", "ConceptReference"); + JOS.attribute("id",

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread via cfe-commits
@@ -458,6 +532,9 @@ class ASTNodeTraverser if (Traversal == TK_IgnoreUnlessSpelledInSource && D->isCXXForRangeDecl()) return; +if (VisitLocs) cor3ntin wrote: Is that the only place where `VisitLocs` is used?

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread via cfe-commits
@@ -0,0 +1,86 @@ +//===- unittests/AST/ASTDumperTest.cpp --- Test of AST node dump() methods ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall updated https://github.com/llvm/llvm-project/pull/65484: >From f2269d93e313378581085bca418914229316bfc6 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Mon, 4 Sep 2023 15:48:47 +0200 Subject: [PATCH 1/2] [AST] Add dump() method to TypeLoc The ability to dump AST

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread via cfe-commits
https://github.com/github-actions[bot] labeled https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall review_requested https://github.com/llvm/llvm-project/pull/65484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Add dump() method to TypeLoc (PR #65484)

2023-09-06 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall created https://github.com/llvm/llvm-project/pull/65484: The ability to dump AST nodes is important to ad-hoc debugging, and the fact this doesn't work with TypeLoc nodes is an obvious missing feature in e.g. clang-query (`set output dump` simply does nothing).