implements PR-09.1: remove moduleKey from FE/BE contracts

This commit is contained in:
2026-03-24 13:42:33 +00:00
parent 98adb67bc0
commit 32ab6d7a76
17 changed files with 53 additions and 166 deletions
@@ -299,8 +299,8 @@ public class LowerToIRVMService {
final var entryPointModuleId = backend.getEntryPointModuleId();
final var sorted = new ArrayList<>(backend.getExecutableFunctions().asList());
sorted.sort((left, right) -> {
final var leftModuleKey = moduleSortKey(backend, left.moduleId(), left.moduleKey());
final var rightModuleKey = moduleSortKey(backend, right.moduleId(), right.moduleKey());
final var leftModuleKey = moduleSortKey(backend, left.moduleId());
final var rightModuleKey = moduleSortKey(backend, right.moduleId());
final var moduleCmp = leftModuleKey.compareTo(rightModuleKey);
if (moduleCmp != 0) {
return moduleCmp;
@@ -367,15 +367,14 @@ public class LowerToIRVMService {
private String moduleSortKey(
final IRBackend backend,
final ModuleId moduleId,
final String fallbackModuleKey) {
final ModuleId moduleId) {
if (moduleId != null && !moduleId.isNone()) {
final var index = moduleId.getIndex();
if (index >= 0 && index < backend.getModulePool().size()) {
return canonicalModuleSortKey(backend.getModulePool().get(index));
}
}
return fallbackModuleKey == null ? "" : fallbackModuleKey;
return "";
}
private String canonicalModuleSortKey(final ModuleReference reference) {