[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-12-21 Thread Dana Jansens via cfe-commits
danakj wrote: oh hey, just stumbled on this, thanks for improving it! https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-10-26 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg closed https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-10-24 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg updated https://github.com/llvm/llvm-project/pull/65481 >From d5054bcc53dad87232a4969e1a1f978b8d5a593d Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Wed, 6 Sep 2023 12:20:30 +0100 Subject: [PATCH] [clang] Prioritze decl comments from macro expansion sit

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-10-23 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg updated https://github.com/llvm/llvm-project/pull/65481 >From e9be513c357d7bb01a3acf69871e2e9889cb2079 Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Wed, 6 Sep 2023 12:20:30 +0100 Subject: [PATCH] [clang] Prioritze decl comments from macro expansion sit

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-10-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Daniel Grumberg (daniel-grumberg) Changes For declarations declared inside a macro, e.g.: ``` `#define MAKE_FUNC(suffix) \ /// Not selected doc comment \ void func_##suffix(void) { } /// Doc comment foo MAKE_FUNC(foo) /

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-10-23 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg updated https://github.com/llvm/llvm-project/pull/65481 >From 32155e8b5ac01242c3e16968f9a7c821d16b7007 Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Wed, 6 Sep 2023 12:20:30 +0100 Subject: [PATCH 1/2] [clang] Prioritze decl comments from macro expansion

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-20 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg edited https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-20 Thread Daniel Grumberg via cfe-commits
@@ -374,11 +374,10 @@ TEST(SourceCodeTest, getAssociatedRangeWithComments) { // Does not include comments when only the decl or the comment come from a // macro. daniel-grumberg wrote: Good spot, can't believe I removed the FIXME and not the comment expla

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-11 Thread Ben Barham via cfe-commits
@@ -56,7 +56,6 @@ void functionFromMacro(void) { \ typedef struct Struct_notdoxy Struct_notdoxy; \ } -/// IS_DOXYGEN_NOT_ATTACHED bnbarham wrote: I think it would be worth adding another test case where we have this one and check that it uses this

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-11 Thread Ben Barham via cfe-commits
@@ -374,11 +374,10 @@ TEST(SourceCodeTest, getAssociatedRangeWithComments) { // Does not include comments when only the decl or the comment come from a // macro. bnbarham wrote: Comment isn't true any more. The comment on line 370 is also confusing to me,

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-11 Thread Ben Barham via cfe-commits
@@ -167,115 +167,41 @@ static SourceLocation getDeclLocForCommentSearch(const Decl *D, isa(D)) return {}; + SmallVector Locations; // Find declaration location. // For Objective-C declarations we generally don't expect to have multiple // declarators, thus

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-11 Thread Ben Barham via cfe-commits
@@ -592,19 +524,22 @@ void ASTContext::attachCommentsToJustParsedDecls(ArrayRef Decls, D = &adjustDeclToTemplate(*D); -const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr); +const auto DeclLocs = getDeclLocsForCommentSearch(D, SourceMgr); -

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-11 Thread Ben Barham via cfe-commits
https://github.com/bnbarham edited https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-11 Thread Ben Barham via cfe-commits
https://github.com/bnbarham approved this pull request. Thanks for looking into this @daniel-grumberg! LGTM except for the few small comments. https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-08 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg review_requested https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg review_requested https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread Daniel Grumberg via cfe-commits
@@ -179,103 +179,38 @@ static SourceLocation getDeclLocForCommentSearch(const Decl *D, isa(D) || // Allow association with Y across {} in `typedef struct X {} Y`. isa(D)) -return D->getBeginLoc(); +return {D->getBeginLoc()}; daniel-gr

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg updated https://github.com/llvm/llvm-project/pull/65481: >From 32155e8b5ac01242c3e16968f9a7c821d16b7007 Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Wed, 6 Sep 2023 12:20:30 +0100 Subject: [PATCH] [clang] Prioritze decl comments from macro expansion si

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread Daniel Grumberg via cfe-commits
@@ -357,30 +292,37 @@ RawComment *ASTContext::getRawCommentForDeclNoCacheImpl( } RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const { - const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr); + const auto DeclLocs = getDeclLocsForCommen

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread via cfe-commits
@@ -179,103 +179,38 @@ static SourceLocation getDeclLocForCommentSearch(const Decl *D, isa(D) || // Allow association with Y across {} in `typedef struct X {} Y`. isa(D)) -return D->getBeginLoc(); +return {D->getBeginLoc()}; const SourceLocation

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread via cfe-commits
https://github.com/cor3ntin commented: Just a few nitpicks. Hope it helps! This is subtle enough that I do not have a good opinion on the changes https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread via cfe-commits
@@ -592,19 +534,22 @@ void ASTContext::attachCommentsToJustParsedDecls(ArrayRef Decls, D = &adjustDeclToTemplate(*D); -const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr); +const auto DeclLocs = getDeclLocsForCommentSearch(D, SourceMgr); -

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread via cfe-commits
@@ -357,30 +292,37 @@ RawComment *ASTContext::getRawCommentForDeclNoCacheImpl( } RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const { - const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr); + const auto DeclLocs = getDeclLocsForCommen

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-07 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Ben Barham via cfe-commits
bnbarham wrote: FWIW @gribozavr the issue here is the hardcoding of the `NS_ENUM`/`NS_OPTIONS` logic, so the idea here is to make that more generic and still handle the comment inside macro case. https://github.com/llvm/llvm-project/pull/65481 ___ cf

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Ben Barham via cfe-commits
bnbarham wrote: Thanks for looking into this @daniel-grumberg! https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Ben Barham via cfe-commits
@@ -179,103 +179,38 @@ static SourceLocation getDeclLocForCommentSearch(const Decl *D, isa(D) || // Allow association with Y across {} in `typedef struct X {} Y`. isa(D)) -return D->getBeginLoc(); +return {D->getBeginLoc()}; bnbarham

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Daniel Grumberg via cfe-commits
daniel-grumberg wrote: This is a follow up on https://reviews.llvm.org/D142560 I couldn't find Dana on here to but in the the reviewer list. Maybe @gribozavr can help locate them? https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

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

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg review_requested https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg review_requested https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg review_requested https://github.com/llvm/llvm-project/pull/65481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Prioritze decl comments from macro expansion site (PR #65481)

2023-09-06 Thread Daniel Grumberg via cfe-commits
https://github.com/daniel-grumberg created https://github.com/llvm/llvm-project/pull/65481: For declarations declared inside a macro, e.g.: ``` `#define MAKE_FUNC(suffix) \ /// Not selected doc comment \ void func_##suffix(void) { } /// Doc comment foo MAKE_FUNC(foo) /// Doc