DmitryPolukhin added a comment.

In http://reviews.llvm.org/D18035#450258, @rsmith wrote:

> Yes, I definitely want us to implement this for GCC compatibility. And now 
> that we have a specification for this feature, we can evaluate whether this 
> is doing the right thing. On that basis:
>
> I still want this refactored so that the normally-mangled part of a function 
> name is only mangled once, rather than being mangled twice (once to find the 
> implicit tag set and once to actually produce the mangled name). As 
> suggested, you can achieve this by first computing the set of tags from the 
> return type, then mangling the encoding to a separate buffer (collecting tags 
> as you go) if the set is non-empty, and finally writing any remaining tags 
> and the buffer contents.
>
> Please factor out a function to mangle the source name and ABI tags for a 
> `NamedDecl` rather than duplicating that pair of calls throughout the patch.
>
> Current discussion on the ABI list suggests that it is not correct to mangle 
> the return type / variable type to get the implicit tag set. The set of 
> available attributes should be determined by a recursive walk of the original 
> type (prior to any substitution), not by mangling it and seeing what it 
> references. It's not yet clear whether that's the actual design intent or 
> just the emergent behavior of the GCC implementation, however.


I'm monitoring the discussion and will try to rewrite this patch according to 
the guidance and avoid double mangling.


http://reviews.llvm.org/D18035



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

Reply via email to