Skip to content

[ThinLTO] Extract optionality out of ModuleCacheEntry #8083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

jansvoboda11
Copy link

All existing kinds of ModuleCacheEntry contain the same kind of optionality: their getEntryPath(), tryLoadingBuffer() and write() functions are no-op if the ThinLTO key could not be computed in their constructors.

This patch extracts the concept of no-op cache entry into NullModuleCacheEntry, simplifying the logic.

All existing kinds of `ModuleCacheEntry` contain the same kind of optionality: their `getEntryPath()`, `tryLoadingBuffer()` and `write()` functions are no-op if the ThinLTO key could not be computed in their constructors.

This patch extracts the concept of no-op cache entry into `NullModuleCacheEntry`, simplifying the logic.
Copy link

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I prefer just do this in one commit rather than 4.

@jansvoboda11
Copy link
Author

Thanks! I'll squash when merging.

@jansvoboda11 jansvoboda11 merged commit b168a63 into next Jan 30, 2024
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/thinlto-optionality branch January 30, 2024 22:17
jansvoboda11 added a commit that referenced this pull request Apr 19, 2024
All existing kinds of `ModuleCacheEntry` contain the same kind of optionality: their `getEntryPath()`, `tryLoadingBuffer()` and `write()` functions are no-op if the ThinLTO key could not be computed in their constructors.

This patch extracts the concept of no-op cache entry into `NullModuleCacheEntry`, simplifying the logic.

(cherry picked from commit b168a63)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants