floats iter 4.1: codegen primitive registration + Float literal hex-double lowering

This commit is contained in:
2026-05-10 15:54:20 +02:00
parent 0c514e034b
commit ac5e17e541
2 changed files with 45 additions and 2 deletions
+2
View File
@@ -18,6 +18,7 @@ pub(crate) fn llvm_type(t: &Type) -> Result<String> {
"Bool" => Ok("i1".into()),
"Unit" => Ok("i8".into()),
"Str" => Ok("ptr".into()),
"Float" => Ok("double".into()),
// All other type names are treated as ADT (boxed).
// If the typechecker didn't reject this earlier, it's
// intentional — otherwise `ptr` would mask a wrong value.
@@ -207,6 +208,7 @@ pub(crate) fn type_descriptor(t: &Type) -> String {
"Bool" => "B".into(),
"Unit" => "U".into(),
"Str" => "S".into(),
"Float" => "Fl".into(),
other => format!("F{other}"),
};
if args.is_empty() {