Skip to main content

parse_bitcode_module

Function parse_bitcode_module 

Source
pub fn parse_bitcode_module<'ctx>(
    ctx: &'ctx Context,
    bitcode: &[u8],
    name: &str,
) -> Result<Module<'ctx>, String>
Expand description

Parse public bitcode bytes into an inkwell module.

This helper uses create_memory_buffer_from_bytes so downstream Rust callers do not need to duplicate the LLVM memory-buffer compatibility path. It is a copied-buffer parser path, not a bitcode container classifier or malformed-input validator. Callers that need stable diagnostics for truncated headers, wrapped-bitcode payload ranges, or other pre-parse conditions should keep those checks before calling this helper.

ยงErrors

Returns an error if the memory buffer cannot be created or LLVM rejects the bitcode payload.