This is an archive of the discontinued LLVM Phabricator instance.

[clang] Use InMemoryModuleCache for readASTFileControlBlock NFC
ClosedPublic

Authored by benlangmuir on Nov 16 2022, 4:15 PM.

Details

Summary

When a pcm has already been loaded from disk, reuse it from the InMemoryModuleCache in readASTFileControlBlock. This avoids potentially reading it again.

As noted in the FIXME, ideally we would also add the module to the cache if it will be used again later, but that could modify its build state and we do not have enough context currenlty to know if it's correct.

Diff Detail

Event Timeline

benlangmuir created this revision.Nov 16 2022, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2022, 4:15 PM
benlangmuir requested review of this revision.Nov 16 2022, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2022, 4:15 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 accepted this revision.Nov 17 2022, 1:07 PM

LGTM. Does this give us measurable perf improvement?

This revision is now accepted and ready to land.Nov 17 2022, 1:07 PM
This revision was landed with ongoing or failed builds.Nov 17 2022, 1:52 PM
This revision was automatically updated to reflect the committed changes.