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
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
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
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
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)
/
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
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
@@ -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
@@ -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
@@ -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,
@@ -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
@@ -592,19 +524,22 @@ void
ASTContext::attachCommentsToJustParsedDecls(ArrayRef Decls,
D = &adjustDeclToTemplate(*D);
-const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr);
+const auto DeclLocs = getDeclLocsForCommentSearch(D, SourceMgr);
-
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
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
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
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
@@ -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
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
@@ -357,30 +292,37 @@ RawComment *ASTContext::getRawCommentForDeclNoCacheImpl(
}
RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
- const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr);
+ const auto DeclLocs = getDeclLocsForCommen
@@ -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
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
@@ -592,19 +534,22 @@ void
ASTContext::attachCommentsToJustParsedDecls(ArrayRef Decls,
D = &adjustDeclToTemplate(*D);
-const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr);
+const auto DeclLocs = getDeclLocsForCommentSearch(D, SourceMgr);
-
@@ -357,30 +292,37 @@ RawComment *ASTContext::getRawCommentForDeclNoCacheImpl(
}
RawComment *ASTContext::getRawCommentForDeclNoCache(const Decl *D) const {
- const SourceLocation DeclLoc = getDeclLocForCommentSearch(D, SourceMgr);
+ const auto DeclLocs = getDeclLocsForCommen
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
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
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
@@ -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
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
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
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
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
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
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
33 matches
Mail list logo