Skip to content

RemoveUnusedModuleElements: Handle table initial values#8838

Open
kripken wants to merge 6 commits into
WebAssembly:mainfrom
kripken:rume.table.init
Open

RemoveUnusedModuleElements: Handle table initial values#8838
kripken wants to merge 6 commits into
WebAssembly:mainfrom
kripken:rume.table.init

Conversation

@kripken

@kripken kripken commented Jun 15, 2026

Copy link
Copy Markdown
Member

The initial value is callable.

@kripken kripken requested a review from a team as a code owner June 15, 2026 18:07
@kripken kripken requested review from tlively and removed request for a team June 15, 2026 18:07
// Add this function and element to all relevant types: each function
// might be called by its type, or a supertype.
while (type) {
info.typeFuncs[*type].insert(func->name);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds like we could be taking exactness into account here to potentially rule out more call targets.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added a TODO.

void prepare() {
auto notePossibleFunc = [&](FlatTableInfo& info,
Expression* item,
std::optional<Name> elem = {}) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alternatively this could just be Name and use the default name as the default value meaning absence of elem.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

@kripken kripken enabled auto-merge (squash) June 15, 2026 23:06
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