package p.studio.compiler.backend.irvm;

import p.studio.utilities.structures.ReadOnlyList;

public record IRVMModule(
        String vmProfile,
        ReadOnlyList<IRVMFunction> functions) {
    public IRVMModule {
        vmProfile = vmProfile == null || vmProfile.isBlank() ? "core-v1" : vmProfile;
        functions = functions == null ? ReadOnlyList.empty() : functions;
    }

    public static IRVMModule empty() {
        return new IRVMModule("core-v1", ReadOnlyList.empty());
    }
}

