de-rust phase-0: archive Rust LLVM backend to archive/rust-llvm-backend (RESTORE documented); defaults unaffected

This commit is contained in:
nyash-codex
2025-11-09 01:00:43 +09:00
parent 024a4fecb7
commit 5d2cd5bad0
37 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,19 @@
use inkwell::values::{IntValue, PointerValue};
/// Lightweight newtypes for string representations used in lowering.
/// StrHandle crosses basic blocks; StrPtr is created at call sites within the same block.
pub struct StrHandle<'ctx>(pub IntValue<'ctx>);
pub struct StrPtr<'ctx>(pub PointerValue<'ctx>);
impl<'ctx> StrHandle<'ctx> {
#[inline]
pub fn as_i64(&self) -> IntValue<'ctx> {
self.0
}
}
impl<'ctx> From<PointerValue<'ctx>> for StrPtr<'ctx> {
fn from(p: PointerValue<'ctx>) -> Self {
Self(p)
}
}