rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

Thanks, looks great!

I think the handling of the expansion location in the `MacroQualifiedTypeLoc` 
isn't quite right yet (it looks like it will never actually be set at all, 
because the code to set it is not reachable) but it's also unused at the 
moment, so I'm happy with that being fixed as a follow-up change after you land 
this.



================
Comment at: clang/lib/Sema/SemaType.cpp:5647
+    void VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc TL) {
+      TL.setExpansionLoc(Chunk.Loc);
+    }
----------------
This should use `getMacroExpansionLoc` on the relevant attribute (you can store 
the location information in `TypeProcessingState` and retrieve it from here; 
see what we do for `AttributedType` for example).

I think we'll also need a `VisitMacroQualifiedTypeLoc` override on 
`TypeSpecLocFiller` for attributes in the decl-specifiers rather than 
attributes on declarator chunks. (See below.)


================
Comment at: clang/lib/Sema/SemaType.cpp:5727-5728
 
+    while (MacroQualifiedTypeLoc TL = CurrTL.getAs<MacroQualifiedTypeLoc>())
+      CurrTL = TL.getNextTypeLoc().getUnqualifiedLoc();
+
----------------
Skipping `MacroQualifiedTypeLoc`s here means you're never reaching the above 
`DeclaratorLocFiller::VisitMacroQualifiedTypeLoc`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D51329



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to