[][src]Module rustc_codegen_llvm::back::bytecode

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Management of the encoding of LLVM bytecode into rlibs

This module contains the management of encoding LLVM bytecode into rlibs, primarily for the usage in LTO situations. Currently the compiler will unconditionally encode LLVM-IR into rlibs regardless of what's happening elsewhere, so we currently compress the bytecode via deflate to avoid taking up too much space on disk.

After compressing the bytecode we then have the rest of the format to basically deal with various bugs in various archive implementations. The format currently is:

RLIB LLVM-BYTECODE OBJECT LAYOUT
Version 2
Bytes    Data
0..10    "RUST_OBJECT" encoded in ASCII
11..14   format version as little-endian u32
15..19   the length of the module identifier string
20..n    the module identifier string
n..n+8   size in bytes of deflate compressed LLVM bitcode as
         little-endian u64
n+9..    compressed LLVM bitcode
?        maybe a byte to make this whole thing even length

Structs

DecodedBytecode [
Experimental
]

Constants

RLIB_BYTECODE_EXTENSION [
Experimental
]
RLIB_BYTECODE_OBJECT_MAGIC [
Experimental
]
RLIB_BYTECODE_OBJECT_VERSION [
Experimental
]

Functions

encode [
Experimental
]