[PATCH] D120888: [clang] Stop dragging a EndLoc around when parsing attributes

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 4 06:15:20 PST 2022


tbaeder marked an inline comment as done.
tbaeder added a comment.

In D120888#3359798 <https://reviews.llvm.org/D120888#3359798>, @aaron.ballman wrote:

> Thank you for working on this! We've (very) slowly been working towards all of the attribute parsing functions taking a `ParsedAttributesWithRange` so that we don't lose this information in the AST, and this is a good step in the right direction towards that.

Yes, that's what I'm working on. There is a very peculiar test failure in `clang/test/SemaOpenCL/address-spaces.cl` however, so I can't switch everything over to `ParsedAttributesWithRange` (and do a rename) at once.



================
Comment at: clang/lib/Parse/ParseDecl.cpp:820-821
     T.consumeClose();
-    if (End)
-      *End = T.getCloseLocation();
   }
----------------
aaron.ballman wrote:
> This is a case where we're regressing functionality -- we used to track the actual end location here, but because this doesn't take a `ParsedAttributesWithRange`, the end location is lost. Can we rework this to take a `ParsedAttributesWithRange` instead?
Pretty sure yes. I already have that change locally anyway, I'll add it to this patch and run the tests.


================
Comment at: clang/lib/Parse/ParseDeclCXX.cpp:4661-4662
   assert(Tok.is(tok::l_square) && "Not a Microsoft attribute list");
+  // FIXME: ParseMicrosoftAttributes() does not support
+  // ParsedAttributesWithRange.
 
----------------
aaron.ballman wrote:
> Heh, same concern here as above.
Also same as above :)


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

https://reviews.llvm.org/D120888



More information about the cfe-commits mailing list