authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-03-27 21:05:42+03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-03-27 22:38:37+03:00
log7217148edf28a0d3ab69b8c36b13d29c023e12fd
tree082c659c0fd97bfa274baa507399d066f83c56a5
parentbda7993bebf6c13d1c4f98269c80a2463f99e659

Value: hash lazy_align


2 files changed, 11 insertions(+), 3 deletions(-)

build.zig+2-1
...@@ -613,7 +613,8 @@ fn addCxxKnownPath(...@@ -613,7 +613,8 @@ fn addCxxKnownPath(
613 ctx.cxx_compiler,613 ctx.cxx_compiler,
614 b.fmt("-print-file-name={s}", .{objname}),614 b.fmt("-print-file-name={s}", .{objname}),
615 });615 });
616 const path_unpadded = mem.tokenize(u8, path_padded, "\r\n").next().?;616 var tokenizer = mem.tokenize(u8, path_padded, "\r\n");
617 const path_unpadded = tokenizer.next().?;
617 if (mem.eql(u8, path_unpadded, objname)) {618 if (mem.eql(u8, path_unpadded, objname)) {
618 if (errtxt) |msg| {619 if (errtxt) |msg| {
619 std.debug.print("{s}", .{msg});620 std.debug.print("{s}", .{msg});
src/value.zig+9-2
...@@ -461,7 +461,7 @@ pub const Value = extern union {...@@ -461,7 +461,7 @@ pub const Value = extern union {
461 => unreachable,461 => unreachable,
462462
463 .ty, .lazy_align => {463 .ty, .lazy_align => {
464 const payload = self.castTag(.ty).?;464 const payload = self.cast(Payload.Ty).?;
465 const new_payload = try arena.create(Payload.Ty);465 const new_payload = try arena.create(Payload.Ty);
466 new_payload.* = .{466 new_payload.* = .{
467 .base = payload.base,467 .base = payload.base,
...@@ -718,7 +718,7 @@ pub const Value = extern union {...@@ -718,7 +718,7 @@ pub const Value = extern union {
718 .lazy_align => {718 .lazy_align => {
719 try out_stream.writeAll("@alignOf(");719 try out_stream.writeAll("@alignOf(");
720 try val.castTag(.lazy_align).?.data.dump("", options, out_stream);720 try val.castTag(.lazy_align).?.data.dump("", options, out_stream);
721 try out_stream.writeAll(")");721 return try out_stream.writeAll(")");
722 },722 },
723 .int_type => {723 .int_type => {
724 const int_type = val.castTag(.int_type).?.data;724 const int_type = val.castTag(.int_type).?.data;
...@@ -2478,6 +2478,13 @@ pub const Value = extern union {...@@ -2478,6 +2478,13 @@ pub const Value = extern union {
2478 .the_only_possible_value,2478 .the_only_possible_value,
2479 => return hashInt(ptr_val, hasher, target),2479 => return hashInt(ptr_val, hasher, target),
24802480
2481 .lazy_align => {
2482 // Bit weird to have this here but this function is also called
2483 // on integers.
2484 const ty = ptr_val.castTag(.lazy_align).?.data;
2485 ty.hashWithHasher(hasher, target);
2486 },
2487
2481 else => unreachable,2488 else => unreachable,
2482 }2489 }
2483 }2490 }