diff options
| author | David Rubin <daviru007@icloud.com> | 2024-08-11 22:03:50 -0700 |
|---|---|---|
| committer | David Rubin <daviru007@icloud.com> | 2024-08-25 15:17:40 -0700 |
| commit | 1c1feba08edf1ded85af0ec003939a7756f4ab0b (patch) | |
| tree | 5bf36c67a1271f74e5e2bbec44ae9f737a91217a /src/Type.zig | |
| parent | 9868ed44b31483b21236623e16e5a73b8c026a47 (diff) | |
| download | zig-1c1feba08edf1ded85af0ec003939a7756f4ab0b.tar.gz zig-1c1feba08edf1ded85af0ec003939a7756f4ab0b.zip | |
remove `mod` aliases for Zcus
Diffstat (limited to 'src/Type.zig')
| -rw-r--r-- | src/Type.zig | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/Type.zig b/src/Type.zig index 16806af49d..f2f8f89594 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -3028,9 +3028,9 @@ pub fn getParentNamespace(ty: Type, zcu: *Zcu) InternPool.OptionalNamespaceIndex // Works for vectors and vectors of integers. pub fn minInt(ty: Type, pt: Zcu.PerThread, dest_ty: Type) !Value { - const mod = pt.zcu; - const scalar = try minIntScalar(ty.scalarType(mod), pt, dest_ty.scalarType(mod)); - return if (ty.zigTypeTag(mod) == .Vector) Value.fromInterned(try pt.intern(.{ .aggregate = .{ + const zcu = pt.zcu; + const scalar = try minIntScalar(ty.scalarType(zcu), pt, dest_ty.scalarType(zcu)); + return if (ty.zigTypeTag(zcu) == .Vector) Value.fromInterned(try pt.intern(.{ .aggregate = .{ .ty = dest_ty.toIntern(), .storage = .{ .repeated_elem = scalar.toIntern() }, } })) else scalar; @@ -3038,8 +3038,8 @@ pub fn minInt(ty: Type, pt: Zcu.PerThread, dest_ty: Type) !Value { /// Asserts that the type is an integer. pub fn minIntScalar(ty: Type, pt: Zcu.PerThread, dest_ty: Type) !Value { - const mod = pt.zcu; - const info = ty.intInfo(mod); + const zcu = pt.zcu; + const info = ty.intInfo(zcu); if (info.signedness == .unsigned) return pt.intValue(dest_ty, 0); if (info.bits == 0) return pt.intValue(dest_ty, -1); @@ -3048,7 +3048,7 @@ pub fn minIntScalar(ty: Type, pt: Zcu.PerThread, dest_ty: Type) !Value { return pt.intValue(dest_ty, n); } - var res = try std.math.big.int.Managed.init(mod.gpa); + var res = try std.math.big.int.Managed.init(zcu.gpa); defer res.deinit(); try res.setTwosCompIntLimit(.min, info.signedness, info.bits); @@ -3059,9 +3059,9 @@ pub fn minIntScalar(ty: Type, pt: Zcu.PerThread, dest_ty: Type) !Value { // Works for vectors and vectors of integers. /// The returned Value will have type dest_ty. pub fn maxInt(ty: Type, pt: Zcu.PerThread, dest_ty: Type) !Value { - const mod = pt.zcu; - const scalar = try maxIntScalar(ty.scalarType(mod), pt, dest_ty.scalarType(mod)); - return if (ty.zigTypeTag(mod) == .Vector) Value.fromInterned(try pt.intern(.{ .aggregate = .{ + const zcu = pt.zcu; + const scalar = try maxIntScalar(ty.scalarType(zcu), pt, dest_ty.scalarType(zcu)); + return if (ty.zigTypeTag(zcu) == .Vector) Value.fromInterned(try pt.intern(.{ .aggregate = .{ .ty = dest_ty.toIntern(), .storage = .{ .repeated_elem = scalar.toIntern() }, } })) else scalar; @@ -3546,12 +3546,12 @@ pub fn optEuBaseType(ty: Type, zcu: *const Zcu) Type { } pub fn toUnsigned(ty: Type, pt: Zcu.PerThread) !Type { - const mod = pt.zcu; - return switch (ty.zigTypeTag(mod)) { - .Int => pt.intType(.unsigned, ty.intInfo(mod).bits), + const zcu = pt.zcu; + return switch (ty.zigTypeTag(zcu)) { + .Int => pt.intType(.unsigned, ty.intInfo(zcu).bits), .Vector => try pt.vectorType(.{ - .len = ty.vectorLen(mod), - .child = (try ty.childType(mod).toUnsigned(pt)).toIntern(), + .len = ty.vectorLen(zcu), + .child = (try ty.childType(zcu).toUnsigned(pt)).toIntern(), }), else => unreachable, }; |
