IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

CompiledFunctionInfo

struct CompiledFunctionInfo[func_type: TrivialRegisterPassable, func: func_type, target: __mlir_type.`!kgen.target`]

Contains compilation information and results for a function.

Stores assembly/IR code, function metadata, and error information from compiling a function.

Attributes: populate: Function to populate captures

Parameters

  • func_type (TrivialRegisterPassable): Type of the function being compiled.
  • func (func_type): The function being compiled.
  • target (__mlir_type.`!kgen.target`): The target architecture to compile for.

Fields

  • asm (StaticString): Generated assembly/IR code from the compilation process.
  • function_name (StaticString): Mangled name of the compiled function, used for symbol resolution.
  • module_name (StaticString): Name of the module containing the compiled function.
  • num_captures (Int): Number of variables captured by the function closure.
  • capture_sizes (Pointer[UInt64, ImmUntrackedOrigin]): Pointer to the sizes of the variables captured by the function closure.
  • emission_kind (StaticString): The emission kind the object was emitted to.

Implemented traits

AnyType, Copyable, Deinitable, ImplicitlyCopyable, Movable, RegisterPassable, TrivialRegisterPassable, Writable

comptime members

populate

comptime populate = rebind[def(Pointer[NoneType, MutAnyOrigin]) capturing thin -> None](#kgen.compile_offload_closure<target, #kgen.param.decl.ref<"func"> : !kgen.param<:trait<@std::@builtin::@value::@RegisterPassable, @std::@builtin::@value::@TrivialRegisterPassable, @std::@traits::@anytype::@AnyType, @std::@traits::@copyable::@Copyable, @std::@traits::@copyable::@ImplicitlyCopyable, @std::@traits::@deinitable::@Deinitable, @std::@traits::@movable::@Movable> func_type>>.populate)

Function pointer to populate captured variables in the function closure.

Methods

__contains__

def __contains__(self, content: String) -> Bool

Checks if content exists in the assembly/IR.

Args:

  • content (String): String to search for.

Returns:

Bool: True if content is found, False otherwise.

write_to

def write_to(self, mut writer: T)

Writes the assembly/IR to a writer.

Args:

  • writer (T): Writer object to write the assembly to.

write_text

def write_text[path_like: PathLike](self, path: path_like)

Writes the assembly/IR to a file.

Parameters:

  • path_like (PathLike): Type that implements the PathLike interface for file path representation.

Args:

  • path (path_like): Path to write the file to.

Raises:

If file writing operations fail.