[PATCH] D121201: [clang] Merge the SourceRange into ParsedAttributes

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 22 03:42:02 PDT 2022


tbaeder added inline comments.


================
Comment at: clang/include/clang/Sema/DeclSpec.h:2516-2521
+  void takeAttributes(ParsedAttributes &attrs) {
     Attrs.takeAllFrom(attrs);
 
-    if (!lastLoc.isInvalid())
-      SetRangeEnd(lastLoc);
+    if (attrs.Range.getEnd().isValid())
+      SetRangeEnd(attrs.Range.getEnd());
   }
----------------
aaron.ballman wrote:
> 
I blindly changed this and it took me a while to figure out that's wrong from the test failures: 

`Attrs.takeAllFrom(Attrs)`...


================
Comment at: clang/include/clang/Sema/ParsedAttr.h:920
 
   void clearListOnly() { AttrList.clear(); }
 
----------------
erichkeane wrote:
> Also, this function is now strange/likely needs a rename, since it likely needs to reset the range as well.  I believe the point of this being a separate function is to not clear the 'pool'.
Clearing the source range in here causes a bunch of  test failures FWIW, I assume because the old `ParsedAttributesWithRange` did it in `clean()` as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121201/new/

https://reviews.llvm.org/D121201



More information about the cfe-commits mailing list