implements PR-08.3
This commit is contained in:
+15
-1
@@ -38,6 +38,7 @@ import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -191,13 +192,26 @@ public class PBSFrontendPhaseService implements FrontendPhaseService {
|
||||
}
|
||||
|
||||
final var blockedModuleIds = blockedModulesByDependency(failedModuleIds, moduleDependencyGraph);
|
||||
final var entryPointCallableName = PBSDefinitions.PBS.getEntryPointCallableName();
|
||||
final var entryPointModuleCandidates = new LinkedHashSet<ModuleId>();
|
||||
for (final var compiledSource : compiledSourceFiles) {
|
||||
if (blockedModuleIds.contains(compiledSource.moduleId())) {
|
||||
continue;
|
||||
}
|
||||
irBackendAggregator.merge(compiledSource.irBackendFile());
|
||||
for (final var executable : compiledSource.irBackendFile().executableFunctions()) {
|
||||
if (!entryPointCallableName.equals(executable.callableName())) {
|
||||
continue;
|
||||
}
|
||||
if (executable.moduleId() != null && !executable.moduleId().isNone()) {
|
||||
entryPointModuleCandidates.add(executable.moduleId());
|
||||
}
|
||||
}
|
||||
}
|
||||
irBackendAggregator.entryPointCallableName(entryPointCallableName);
|
||||
if (entryPointModuleCandidates.size() == 1) {
|
||||
irBackendAggregator.entryPointModuleId(entryPointModuleCandidates.iterator().next());
|
||||
}
|
||||
irBackendAggregator.entryPointCallableName(PBSDefinitions.PBS.getEntryPointCallableName());
|
||||
|
||||
final var irBackend = irBackendAggregator.emit();
|
||||
logs.using(log).debug("PBS frontend lowered to IR BE:\n%s".formatted(irBackend));
|
||||
|
||||
Reference in New Issue
Block a user