This is an archive of the discontinued LLVM Phabricator instance.

Add support for attributes on @implementations in Objective-C
ClosedPublic

Authored by erik.pilkington on Apr 10 2019, 3:10 PM.

Details

Summary

We want to make objc_nonlazy_class apply to implementations, but ran into this. There doesn't seem to be any reason that this isn't supported.

Thanks for taking a look!
Erik

Diff Detail

Repository
rC Clang

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2019, 3:11 PM
rjmccall accepted this revision.Apr 11 2019, 8:58 AM

LGTM.

This revision is now accepted and ready to land.Apr 11 2019, 8:58 AM
aaron.ballman accepted this revision.Apr 11 2019, 9:06 AM

LGTM aside from a question.

clang/test/FixIt/fixit-pragma-attribute.cpp
19–20 ↗(On Diff #194594)

Any idea why this swapped?

erik.pilkington marked an inline comment as done.Apr 11 2019, 10:17 AM
erik.pilkington added inline comments.
clang/test/FixIt/fixit-pragma-attribute.cpp
19–20 ↗(On Diff #194594)

Its because I added a new subject match rule in Attr.td, and the match rules enumerators are being stored in a DenseMap in Sema::ActOnPragmaAttributeAttribute. I think we should make that a std::map or something so this test is less fragile.

aaron.ballman added inline comments.Apr 11 2019, 10:24 AM
clang/test/FixIt/fixit-pragma-attribute.cpp
19–20 ↗(On Diff #194594)

Ah, that makes sense, thank you. Yeah, using an ordered container may be a better approach to reduce fragility.

This revision was automatically updated to reflect the committed changes.