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(
613613 ctx.cxx_compiler,
614614 b.fmt("-print-file-name={s}", .{objname}),
615615 });
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().?;
617618 if (mem.eql(u8, path_unpadded, objname)) {
618619 if (errtxt) |msg| {
619620 std.debug.print("{s}", .{msg});
src/value.zig+9-2
......@@ -461,7 +461,7 @@ pub const Value = extern union {
461461 => unreachable,
462462
463463 .ty, .lazy_align => {
464 const payload = self.castTag(.ty).?;
464 const payload = self.cast(Payload.Ty).?;
465465 const new_payload = try arena.create(Payload.Ty);
466466 new_payload.* = .{
467467 .base = payload.base,
......@@ -718,7 +718,7 @@ pub const Value = extern union {
718718 .lazy_align => {
719719 try out_stream.writeAll("@alignOf(");
720720 try val.castTag(.lazy_align).?.data.dump("", options, out_stream);
721 try out_stream.writeAll(")");
721 return try out_stream.writeAll(")");
722722 },
723723 .int_type => {
724724 const int_type = val.castTag(.int_type).?.data;
......@@ -2478,6 +2478,13 @@ pub const Value = extern union {
24782478 .the_only_possible_value,
24792479 => 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
24812488 else => unreachable,
24822489 }
24832490 }