From 4f8d244e7ea47a8cdb41496d51961ef4ba3ec2af Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 25 Sep 2024 11:11:48 -0700 Subject: remove formatted panics implements #17969 --- src/Zcu/PerThread.zig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Zcu/PerThread.zig') diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index a11910302d..a0e90e60bd 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -2697,11 +2697,16 @@ pub fn reportRetryableFileError( gop.value_ptr.* = err_msg; } -///Shortcut for calling `intern_pool.get`. +/// Shortcut for calling `intern_pool.get`. pub fn intern(pt: Zcu.PerThread, key: InternPool.Key) Allocator.Error!InternPool.Index { return pt.zcu.intern_pool.get(pt.zcu.gpa, pt.tid, key); } +/// Shortcut for calling `intern_pool.getUnion`. +pub fn internUnion(pt: Zcu.PerThread, un: InternPool.Key.Union) Allocator.Error!InternPool.Index { + return pt.zcu.intern_pool.getUnion(pt.zcu.gpa, pt.tid, un); +} + /// Essentially a shortcut for calling `intern_pool.getCoerced`. /// However, this function also allows coercing `extern`s. The `InternPool` function can't do /// this because it requires potentially pushing to the job queue. @@ -2949,11 +2954,12 @@ pub fn intValue_i64(pt: Zcu.PerThread, ty: Type, x: i64) Allocator.Error!Value { } pub fn unionValue(pt: Zcu.PerThread, union_ty: Type, tag: Value, val: Value) Allocator.Error!Value { - return Value.fromInterned(try pt.intern(.{ .un = .{ + const zcu = pt.zcu; + return Value.fromInterned(try zcu.intern_pool.getUnion(zcu.gpa, pt.tid, .{ .ty = union_ty.toIntern(), .tag = tag.toIntern(), .val = val.toIntern(), - } })); + })); } /// This function casts the float representation down to the representation of the type, potentially -- cgit v1.2.3