implements PR-O4.2
This commit is contained in:
+12
-4
@@ -18,6 +18,7 @@ import p.studio.compiler.source.diagnostics.DiagnosticPhase;
|
||||
import p.studio.compiler.source.identifiers.FileId;
|
||||
import p.studio.compiler.source.tables.CallableSignatureRef;
|
||||
import p.studio.compiler.source.tables.CallableTable;
|
||||
import p.studio.compiler.source.tables.IntrinsicReference;
|
||||
import p.studio.compiler.source.tables.IntrinsicTable;
|
||||
import p.studio.utilities.structures.ReadOnlyList;
|
||||
|
||||
@@ -124,7 +125,7 @@ public final class PbsFrontendCompiler {
|
||||
: lowerFunctions(fileId, ast);
|
||||
final var loweringErrorBaseline = diagnostics.errorCount();
|
||||
final var executableLowering = sourceKind == SourceKind.SDK_INTERFACE
|
||||
? new ExecutableLoweringResult(ReadOnlyList.empty(), ReadOnlyList.empty())
|
||||
? new ExecutableLoweringResult(ReadOnlyList.empty(), ReadOnlyList.empty(), ReadOnlyList.empty())
|
||||
: lowerExecutableFunctions(fileId, ast, moduleKey, reservedMetadata, diagnostics);
|
||||
if (diagnostics.errorCount() > loweringErrorBaseline) {
|
||||
return IRBackendFile.empty(fileId);
|
||||
@@ -134,7 +135,8 @@ public final class PbsFrontendCompiler {
|
||||
functions,
|
||||
executableLowering.executableFunctions(),
|
||||
reservedMetadata,
|
||||
executableLowering.callableSignatures());
|
||||
executableLowering.callableSignatures(),
|
||||
executableLowering.intrinsicPool());
|
||||
}
|
||||
|
||||
private ReadOnlyList<IRFunction> lowerFunctions(final FileId fileId, final PbsAst.File ast) {
|
||||
@@ -312,9 +314,14 @@ public final class PbsFrontendCompiler {
|
||||
for (final var callableId : callableIdTable.identifiers()) {
|
||||
callableSignatures.add(callableIdTable.get(callableId));
|
||||
}
|
||||
final var intrinsicPool = new ArrayList<IntrinsicReference>(intrinsicIdTable.size());
|
||||
for (final var intrinsicId : intrinsicIdTable.identifiers()) {
|
||||
intrinsicPool.add(intrinsicIdTable.get(intrinsicId));
|
||||
}
|
||||
return new ExecutableLoweringResult(
|
||||
ReadOnlyList.wrap(executableFunctions),
|
||||
ReadOnlyList.wrap(callableSignatures));
|
||||
ReadOnlyList.wrap(callableSignatures),
|
||||
ReadOnlyList.wrap(intrinsicPool));
|
||||
}
|
||||
|
||||
private int returnSlotsFor(final PbsAst.FunctionDecl functionDecl) {
|
||||
@@ -550,6 +557,7 @@ public final class PbsFrontendCompiler {
|
||||
|
||||
private record ExecutableLoweringResult(
|
||||
ReadOnlyList<IRBackendExecutableFunction> executableFunctions,
|
||||
ReadOnlyList<CallableSignatureRef> callableSignatures) {
|
||||
ReadOnlyList<CallableSignatureRef> callableSignatures,
|
||||
ReadOnlyList<IntrinsicReference> intrinsicPool) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user