Loom C API
Public Loom compiler C API
Loading...
Searching...
No Matches
loomc_module_serialize_options_t Struct Reference

Module serialization and current-IR text presentation options. More...

#include <module.h>

Data Fields

loomc_structure_type_t type
 Structure type.
loomc_host_size_t structure_size
 Size of this structure in bytes.
const void * next
 Extension chain for future serialization options.
loomc_source_format_t format
 Output source format. Unknown selects textual .loom.
loomc_string_view_t identifier
 Identifier to attach to a returned source.
loomc_module_text_presentation_t text_presentation
 Presentation policy for textual .loom output.
uint32_t reserved
 Reserved padding separating appended fields from the original ABI prefix.
bool print_locations
 Include operation source locations in textual output.
loomc_string_view_t top_level_dialect
 Optional top-level operation dialect to select during current-IR text printing.

Detailed Description

Module serialization and current-IR text presentation options.

Callers zero-initialize this descriptor, set type to LOOMC_STRUCTURE_TYPE_MODULE_SERIALIZE_OPTIONS, set structure_size to sizeof(loomc_module_serialize_options_t), and fill the requested fields.

Field Documentation

◆ identifier

loomc_string_view_t loomc_module_serialize_options_t::identifier

Identifier to attach to a returned source.

Empty uses a format-specific default. Path and FILE* serialization do not interpret this field.

◆ print_locations

bool loomc_module_serialize_options_t::print_locations

Include operation source locations in textual output.

Requires structure_size to include this field; absent fields default to false. Bytecode preserves location information independently of this option.

◆ top_level_dialect

loomc_string_view_t loomc_module_serialize_options_t::top_level_dialect

Optional top-level operation dialect to select during current-IR text printing.

Empty prints the complete module. A nonempty dialect name prints each top-level operation whose full name begins with that dotted component, unchanged and in module order, without file headers or operations from other dialects. Referenced encodings are printed inline because their module-level aliases are not part of the selected dialect.

Filtered text is an inspection view and may reference symbols declared by omitted operations. Serialization APIs reject this option because they promise a self-contained module export. Requires structure_size to include this field; absent fields default to the complete module.

◆ type

loomc_structure_type_t loomc_module_serialize_options_t::type

Structure type.

Must be LOOMC_STRUCTURE_TYPE_MODULE_SERIALIZE_OPTIONS when nonzero.


The documentation for this struct was generated from the following file: