llvm_constants/constants.rs
1//! Numeric constants for `llvm-constants`.
2
3/// The 32-bit magic that indicates a raw LLVM IR bitcode stream.
4pub const LLVM_IR_MAGIC: u32 = 0xdec04342;
5
6/// The 32-bit magic that indicates a bitcode wrapper, which in
7/// turn points to the start of the actual bitcode stream.
8pub const BITCODE_WRAPPER_MAGIC: u32 = 0x0b17c0de;
9
10/// The initial abbreviation ID width in a bitstream.
11pub const INITIAL_ABBREV_ID_WIDTH: u64 = 2;
12
13/// All abbreviation IDs before this are defined by the bitstream format,
14/// rather than the stream itself.
15pub const FIRST_APPLICATION_ABBREV_ID: usize = 4;
16
17/// All block IDs before this have their semantics defined by the bitstream
18/// format, rather than the stream itself.
19pub const FIRST_APPLICATION_BLOCK_ID: u64 = 8;
20
21/// The lookup alphabet for the Char6 operand encoding.
22pub const CHAR6_ALPHABET: &[u8] =
23 b"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._";
24
25/// The current toolchain's target triple.
26pub const TARGET_TRIPLE: &str = env!("TARGET_TRIPLE");
27
28#[cfg(test)]
29mod tests {
30 use super::*;
31
32 #[test]
33 fn test_target_triple() {
34 assert!(!TARGET_TRIPLE.is_empty());
35 }
36}