This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Modules] Merge availability attributes on imported decls
ClosedPublic

Authored by Bigcheese on Jun 6 2022, 11:05 PM.

Details

Summary

Currently we do not in general merge attributes when importing decls from modules. This patch handles availability, but long term we need to properly handle all attributes.

I tried to use Sema::mergeDeclAttributes, but it caused test crashes as I don't think it expects to be called in this context. We really shouldn't have duplicate code for merging attributes long term, but for now this fixes availability. There's already a TODO for this in the declaration of ASTDeclReader::mergeInheritableAttributes.

rdar://85820301

Diff Detail

Event Timeline

Bigcheese created this revision.Jun 6 2022, 11:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 11:05 PM
Bigcheese requested review of this revision.Jun 6 2022, 11:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 11:05 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bruno accepted this revision.Jun 14 2022, 10:53 AM

LGTM

This revision is now accepted and ready to land.Jun 14 2022, 10:53 AM

Should we add a FIXME saying we need to handle other kinds of attributes?

Should we add a FIXME saying we need to handle other kinds of attributes?

There already is one where we call mergeInheritableAttributes.

jansvoboda11 accepted this revision.Jun 15 2022, 1:13 PM

LGTM then.

This revision was landed with ongoing or failed builds.Jun 15 2022, 5:46 PM
This revision was automatically updated to reflect the committed changes.