rsmith added a comment.

In https://reviews.llvm.org/D51329#1229061, @leonardchan wrote:

> @rsmith So I chose to go with the type sugar route since we would prefer to 
> have multiple attributes in one attribute list. This type just contains the 
> underlying type and the macro identifier originally held by the 
> `AttributedType`. Do you have any recommendations on where this type should 
> be created?


I think the most natural thing to do would be to create the sugar node in 
`processTypeAttrs` after parsing each "chunk" of attributes produced by the 
same macro. (You'll need to extend `ParsedAttributesView` so it can tell you 
which ranges came from which macros.)

> I'm thinking I could either make this type a subclass of `AttributedType` 
> since we will essentially be using this only for attributes declared in a 
> macro (I think this would allow me to not have to change some of the stuff 
> that happens under `GetTypeSourceInfoForDeclarator`), or somehow find a way 
> to make this in another part of `Sema`, although I would still need access to 
> the parsed attributes so I would know what the macro identifiers are.

Your new type sugar node should be a new subclass of `Type` unrelated to 
`AttributedType`, maybe `MacroQualifiedType`. You'll need to teach 
`TypeSpecLocFiller` to fill in location information from it, but you can save 
that into the `ParsedAttributesView` when you parse the attributes and identify 
the macro expansions therein.


Repository:
  rC Clang

https://reviews.llvm.org/D51329



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

Reply via email to