LLVMIRStringToLLVMIRFileStep

class selene_core.build_utils.builtins.LLVMIRStringToLLVMIRFileStep(input_kind: type[ArtifactKind], output_kind: type[ArtifactKind])

Convert a LLVM IR string to a file (by writing the text)

classmethod apply(build_ctx: BuildCtx, input_artifact: Artifact) Artifact

Convert the input artifact to the output artifact.

classmethod get_cost(build_ctx: BuildCtx) float

When planning a build sequence, the path of minimal (cumulative) cost is chosen. This class method returns the ‘cost’ of this step, given the current build context and artifact. Use the context provided to decide whether a step should be prioritised by giving it a low cost, penalised by giving it a high cost, or ruled out entirely by giving it float(‘inf’).

For example, say you have two similar steps that offer a choice, such as compiling an IR to LLVM bitcode or to LLVM IR (text). You can use the build_ctx to accept user input to select between the two, providing a default (unequal) cost to prioritise a default route.

Negative costs are not permitted.

input_kind

alias of HeliosLLVMIRStringKind

output_kind

alias of HeliosLLVMIRFileKind