This is an archive of the discontinued LLVM Phabricator instance.

[Attr] Allow ParsedAttr to be constructor for any Attribute
AbandonedPublic

Authored by jdoerfert on Feb 26 2020, 12:58 PM.

Details

Summary

ParsedAttr is used for clang attribute push/pop a utility that is
reusable in other contexts as well. This allows us to create "fake"
parsed attributes from other attributes, e.g., implicit ones.

Diff Detail

Event Timeline

jdoerfert created this revision.Feb 26 2020, 12:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2020, 12:58 PM
Herald added a subscriber: bollu. · View Herald Transcript

I don't see anything glaring here, but I would love some better explanation as to the goal here. I don't see this used anywhere, the commit message is a bit underwhelming in its reasoning, and there is no test/etc showing why I would want this.

clang/include/clang/Sema/ParsedAttr.h
116

Can you update this comment?

jdoerfert marked an inline comment as done.Feb 26 2020, 1:55 PM

I don't see anything glaring here, but I would love some better explanation as to the goal here. I don't see this used anywhere, the commit message is a bit underwhelming in its reasoning, and there is no test/etc showing why I would want this.

Agreed. The followup "user" patch is going to be put on phab very soon. I did rush this one out because I saw D31337 land today. Wanted to make sure people see what I hope to achieve here.

The reason for this is omp begin/end declare variant which I implement via attribute push/pop. The idea of both are basically the same, attach some information (=Attribute) on all function (definitions) in the scope. I have a new function definition matcher and the rest of the logic basically done, some overloading work is still missing.

clang/include/clang/Sema/ParsedAttr.h
116

Will do.

I think this direction is reasonable to go with, but would prefer to land this with the code actually using this functionality (as there's not really a good way to test it, otherwise).

I think this direction is reasonable to go with, but would prefer to land this with the code actually using this functionality (as there's not really a good way to test it, otherwise).

Agreed. I'll put the other patch as a dependence up soon and this only goes in if the other one does.

jdoerfert updated this revision to Diff 248845.Mar 6 2020, 3:07 PM

Pass parsed attribute kind explicitly

aaron.ballman accepted this revision.Mar 7 2020, 12:35 PM

LGTM aside from the issue with keeping the comment up to date from Erich (but please only land this once D75779 is approved, as that's what carries the testing load for this.

This revision is now accepted and ready to land.Mar 7 2020, 12:35 PM
jdoerfert planned changes to this revision.Mar 12 2020, 12:58 PM

The reason for this patch is not there anymore. I'm fine with postponing this patch until there is a user again, thoughts?

The reason for this patch is not there anymore. I'm fine with postponing this patch until there is a user again, thoughts?

If we don't have a use for it currently, I think we should postpone it until there is a need.

jdoerfert abandoned this revision.Mar 14 2020, 11:52 AM

Code is good and usable but no users anymore. If anyone wants to pick this up, feel free!