lang: rename signed integer types sN -> iN
Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.
Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).
Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.
zig build test: 426/426; examples suite: 595/595.
This commit is contained in:
@@ -47,7 +47,7 @@ pub const AbiLowering = struct {
|
||||
}
|
||||
|
||||
// WASM32: usize/isize are pointer-sized (i32 on wasm32).
|
||||
// Other integer types (s64, u64) keep their declared size — they represent
|
||||
// Other integer types (i64, u64) keep their declared size — they represent
|
||||
// genuinely 64-bit values (SDL_WindowFlags, timestamps, etc.).
|
||||
if (self.e.target_config.isWasm32()) {
|
||||
if (ir_ty == .usize or ir_ty == .isize) return self.e.cached_i32;
|
||||
|
||||
@@ -338,7 +338,7 @@ pub const Ops = struct {
|
||||
const result = c.LLVMBuildLoad2(self.e.builder, llvm_ty, ptr, "load");
|
||||
self.e.mapRef(result);
|
||||
} else {
|
||||
self.e.mapRef(c.LLVMGetUndef(self.e.toLLVMType(if (instruction.ty == .void) .s64 else instruction.ty)));
|
||||
self.e.mapRef(c.LLVMGetUndef(self.e.toLLVMType(if (instruction.ty == .void) .i64 else instruction.ty)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -574,8 +574,8 @@ pub const Ops = struct {
|
||||
if (is_pointer_ret) break :blk emit.Jni.CallStaticObjectMethod;
|
||||
break :blk switch (ret_ty_id) {
|
||||
.void => emit.Jni.CallStaticVoidMethod,
|
||||
.s32 => emit.Jni.CallStaticIntMethod,
|
||||
.s64 => emit.Jni.CallStaticLongMethod,
|
||||
.i32 => emit.Jni.CallStaticIntMethod,
|
||||
.i64 => emit.Jni.CallStaticLongMethod,
|
||||
.f32 => emit.Jni.CallStaticFloatMethod,
|
||||
.f64 => emit.Jni.CallStaticDoubleMethod,
|
||||
.bool => emit.Jni.CallStaticBooleanMethod,
|
||||
@@ -588,8 +588,8 @@ pub const Ops = struct {
|
||||
if (is_pointer_ret) break :blk emit.Jni.CallNonvirtualObjectMethod;
|
||||
break :blk switch (ret_ty_id) {
|
||||
.void => emit.Jni.CallNonvirtualVoidMethod,
|
||||
.s32 => emit.Jni.CallNonvirtualIntMethod,
|
||||
.s64 => emit.Jni.CallNonvirtualLongMethod,
|
||||
.i32 => emit.Jni.CallNonvirtualIntMethod,
|
||||
.i64 => emit.Jni.CallNonvirtualLongMethod,
|
||||
.f32 => emit.Jni.CallNonvirtualFloatMethod,
|
||||
.f64 => emit.Jni.CallNonvirtualDoubleMethod,
|
||||
.bool => emit.Jni.CallNonvirtualBooleanMethod,
|
||||
@@ -602,8 +602,8 @@ pub const Ops = struct {
|
||||
if (is_pointer_ret) break :blk emit.Jni.CallObjectMethod;
|
||||
break :blk switch (ret_ty_id) {
|
||||
.void => emit.Jni.CallVoidMethod,
|
||||
.s32 => emit.Jni.CallIntMethod,
|
||||
.s64 => emit.Jni.CallLongMethod,
|
||||
.i32 => emit.Jni.CallIntMethod,
|
||||
.i64 => emit.Jni.CallLongMethod,
|
||||
.f32 => emit.Jni.CallFloatMethod,
|
||||
.f64 => emit.Jni.CallDoubleMethod,
|
||||
.bool => emit.Jni.CallBooleanMethod,
|
||||
@@ -983,7 +983,7 @@ pub const Ops = struct {
|
||||
/// `const_type` / `type_of` produce) → the TypeId is the payload.
|
||||
/// Otherwise the box carries a *runtime value* whose type IS the tag
|
||||
/// → use the tag as the TypeId. This is what makes `type_name(av)`
|
||||
/// for `av : Any = 6` report `s64` (the held value's type), while
|
||||
/// for `av : Any = 6` report `i64` (the held value's type), while
|
||||
/// `type_name(type_of(x))` still names the held type.
|
||||
/// `.unresolved` is a hard tripwire: a type-resolution failure reached
|
||||
/// emission without a diagnostic.
|
||||
@@ -1059,7 +1059,7 @@ pub const Ops = struct {
|
||||
.type_eq => {
|
||||
// Dynamic `type_eq(a, b)` — both args are
|
||||
// Type values. Extract TypeId from each Any
|
||||
// box (or use directly if `.s64`-typed),
|
||||
// box (or use directly if `.i64`-typed),
|
||||
// icmp eq.
|
||||
const a = blk: {
|
||||
const v = self.e.resolveRef(bi.args[0]);
|
||||
|
||||
@@ -21,10 +21,10 @@ pub const TypeLowering = struct {
|
||||
return switch (ty) {
|
||||
.void => self.e.cached_void,
|
||||
.bool => self.e.cached_i1,
|
||||
.s8 => self.e.cached_i8,
|
||||
.s16 => self.e.cached_i16,
|
||||
.s32 => self.e.cached_i32,
|
||||
.s64 => self.e.cached_i64,
|
||||
.i8 => self.e.cached_i8,
|
||||
.i16 => self.e.cached_i16,
|
||||
.i32 => self.e.cached_i32,
|
||||
.i64 => self.e.cached_i64,
|
||||
.u8 => self.e.cached_i8,
|
||||
.u16 => self.e.cached_i16,
|
||||
.u32 => self.e.cached_i32,
|
||||
|
||||
Reference in New Issue
Block a user