Merge PR 9

This commit is contained in:
local committed 2026-11-24 15:30:10 -06:00
commit 2208ebdf5f
5 files changed
+658 -1

No files matched your search

@@ -30,6 +30,7 @@ enum TypeDef {
Void,
Int(u32),
Float,
Double,
/// Pointee and address space.
Ptr(Ty, u32),
Struct(Option<String>, Vec<Ty>),
@@ -247,6 +248,9 @@ impl Module {
pub fn float(&mut self) -> Ty {
self.ty(TypeDef::Float)
}
pub fn double(&mut self) -> Ty {
self.ty(TypeDef::Double)
}
pub fn ptr(&mut self, to: Ty) -> Ty {
self.ty(TypeDef::Ptr(to, 0))
}
@@ -578,6 +582,7 @@ impl Module {
match t {
TypeDef::Void => w.record(2, &[]),
TypeDef::Float => w.record(3, &[]),
TypeDef::Double => w.record(4, &[]),
TypeDef::Int(b) => w.record(7, &[u64::from(*b)]),
TypeDef::Ptr(p, space) => w.record(8, &[u64::from(p.0), u64::from(*space)]),
TypeDef::Array(n, e) => w.record(11, &[u64::from(*n), u64::from(e.0)]),