This is an archive of the discontinued LLVM Phabricator instance.

CONSUMABLE class attribute
ClosedPublic

Authored by dblaikie on Aug 30 2013, 11:33 AM.

Details

Summary

Adds the 'consumable' attribute that can be attached to classes. This replaces the previous method of scanning a class's methods to see if any of them have consumed analysis attributes attached to them. If consumed analysis attributes are attached to methods of a class that isn't marked 'consumable' a warning is generated.

Diff Detail

Event Timeline

delesley added inline comments.Aug 30 2013, 12:03 PM
lib/Sema/SemaDeclAttr.cpp
981

This block of code seems to have been cut-and-pasted 4 times. Can you factor it into a separate function?

chriswailes updated this revision to Unknown Object (????).Aug 30 2013, 1:20 PM

Extracted common code out into a function.

delesley added inline comments.Aug 30 2013, 2:22 PM
lib/Sema/SemaDeclAttr.cpp
1002

Most of the check is still duplicated. I was thinking of:

if (!checkThisTypeIsConsumable(S, D))

return;
chriswailes updated this revision to Unknown Object (????).Aug 30 2013, 3:21 PM

Factored out even more code.

Why does this no longer apply to CXXConstructors when it used to previously?

Aside from not understanding that, LGTM!

~Aaron

Submitted as r189702.

dblaikie commandeered this revision.Apr 5 2014, 4:02 PM
dblaikie accepted this revision.
dblaikie closed this revision.
dblaikie edited reviewers, added: chriswailes; removed: dblaikie.

Already committed in r189702