Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify primary exports in comment
  • Loading branch information
aheejin committed Mar 16, 2026
commit 98b20648bd88362dc54746b44bef01020d53c384
4 changes: 3 additions & 1 deletion src/ir/module-splitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,9 @@ void ModuleSplitter::shareImportableItems() {
used.tables.insert(segment->table);
}
}
// If primary module has exports, they are "used" in it

// If primary module has exports, they are "used" in it. Secondary modules
// don't have exports, so this only applies to the primary module.
for (auto& ex : module.exports) {
if (ex->kind == ExternalKind::Global) {

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.

Let's use a switch (ex->kind) so the compiler will force us to handle new kinds of exports in the future.

@aheejin aheejin Mar 16, 2026 •

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: 25b072d

used.globals.insert(*ex->getInternalName());
Expand Down