This is an archive of the discontinued LLVM Phabricator instance.

ASTContext: Provide a query for module initializer contents.
AbandonedPublic

Authored by iains on May 31 2022, 4:52 AM.

Details

Summary

When deciding if a global module fragement decl is unused, we have
to account for the case that it is emitted as part of the module
initializer. In order to make this more efficient, modify the container
used to cache the module intializer decls.

Diff Detail

Event Timeline

iains created this revision.May 31 2022, 4:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 4:52 AM
iains published this revision for review.May 31 2022, 5:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 5:43 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ChuanqiXu accepted this revision.May 31 2022, 7:06 PM

LGTM with a nits.

clang/include/clang/AST/ASTContext.h
1083

Nit: It looks better with containsModuleInitializer.

This revision is now accepted and ready to land.May 31 2022, 7:06 PM
iains abandoned this revision.Oct 3 2023, 1:27 AM

although this was approved, we did not need to use it to implement the dependent changes.