[PATCH] D113795: Comment Sema: Eliminate or factor out DeclInfo inspection (NFC)

2022-01-31 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert updated this revision to Diff 404693. aaronpuchert added a comment. Rename `checkDecl` to `hasDeclThat`, which should hopefully address most issues. We leave `isFunctionPointerVarDecl` inlined for now, since it's probably wrong anyway. (I think we should look for fields.)

[PATCH] D113795: Comment Sema: Eliminate or factor out DeclInfo inspection (NFC)

2021-11-26 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added inline comments. Comment at: clang/lib/AST/CommentSema.cpp:135-137 + if (const auto *VD = dyn_cast(ThisDeclInfo->CurrentDecl)) +if (VD->getType()->isFunctionPointerType()) + return; Something might be wrong here anyway:

[PATCH] D113795: Comment Sema: Eliminate or factor out DeclInfo inspection (NFC)

2021-11-18 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. In D113795#3137250 , @gribozavr2 wrote: > Sorry, here I also find the old code to be more readable. Admittedly this isn't mainly about readability but about reducing boilerplate. A large number of functions start like

[PATCH] D113795: Comment Sema: Eliminate or factor out DeclInfo inspection (NFC)

2021-11-17 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Sorry, here I also find the old code to be more readable. - I don't see a problem with checks that are only used once. They are encapsulated in functions with meaningful names, making the code more readable. Compare `Sema::checkFunctionDeclVerbatimLine` before and

[PATCH] D113795: Comment Sema: Eliminate or factor out DeclInfo inspection (NFC)

2021-11-13 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added inline comments. Comment at: clang/include/clang/AST/CommentSema.h:205 - /// \returns \c true if the declaration that this comment is attached to - /// is a pointer to function/method/block type or has such a type. - bool involvesFunctionType(); - - bool

[PATCH] D113795: Comment Sema: Eliminate or factor out DeclInfo inspection (NFC)

2021-11-12 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert created this revision. aaronpuchert added a reviewer: gribozavr2. aaronpuchert requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. We make all predicates expect an already inspected DeclInfo, and introduce a function to run such a