[PATCH] D121201: [clang] Merge the SourceRange into ParsedAttributes
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 11 08:18:35 PST 2022
aaron.ballman added inline comments.
================
Comment at: clang/include/clang/Sema/ParsedAttr.h:1105
void clearListOnly() {
ParsedAttributesView::clearListOnly();
Range = SourceRange();
----------------
erichkeane wrote:
> This is... oh boy. I'm hopeful you can remove this type as well.
+1, it'd be fantastic if we could, otherwise we're storing the range twice for this type (and it's named `Range` both times).
================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:3207
+ if (Tok.is(tok::kw___attribute)) {
+ ParsedAttributes Attrs(AttrFactory);
MaybeParseGNUAttributes(Attrs);
----------------
erichkeane wrote:
> This seems like a particularly strange change, What is the reasoning for this? Is it just that the Attrs are unused?
The comment above is that we parse and discard any trailing attributes, so this change is scoping the `ParsedAttributes` object more tightly to the only scope it's needed, but otherwise not changing behavior.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121201/new/
https://reviews.llvm.org/D121201
More information about the cfe-commits
mailing list