Skip to content

Make getters const in Module class#8579

Merged
stevenfontanella merged 3 commits intomainfrom
const2
Apr 8, 2026
Merged

Make getters const in Module class#8579
stevenfontanella merged 3 commits intomainfrom
const2

Conversation

@stevenfontanella
Copy link
Copy Markdown
Member

@stevenfontanella stevenfontanella commented Apr 7, 2026

Split off from my WIP for improving effects analysis for indirect calls. These methods don't mutate the Module so they can be const.

Also move getModuleElement into the anonymous namespace to prevent the name from leaking.

Since these getters are now const, I also change some usages of Module&/Module* to const e.g. EffectsAnalyzer, since these usages also only need read-only access to the Module.

@stevenfontanella stevenfontanella marked this pull request as ready for review April 7, 2026 21:51
@stevenfontanella stevenfontanella requested a review from a team as a code owner April 7, 2026 21:51
@stevenfontanella stevenfontanella requested review from aheejin and removed request for a team April 7, 2026 21:51
Copy link
Copy Markdown
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

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

LGTM from me, but want LGTM from @kripken as well.

Copy link
Copy Markdown
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Nice!

@stevenfontanella stevenfontanella merged commit 98ad697 into main Apr 8, 2026
16 checks passed
@stevenfontanella stevenfontanella deleted the const2 branch April 8, 2026 01:18
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.

3 participants