tiny.choir.ir.interfaces
Defined in ir.
API (191)
Actions
Public operations.
AbstractAttribute.getInterfaceAbstractAttribute.hasInterfaceAttributeRegistry.countAttributeRegistry.deinitAttributeRegistry.initAttributeRegistry.lookupAttributeRegistry.nextAttributeIdAttributeRegistry.registerAttributeAttributeRegistry.registerInterfaceAttributeRegistry.registerOrReplaceInterfaceAttributeRegistry.removeAttributeAttributeRegistry.restoreNextAttributeIdCountRange.allowsCountRange.atLeastCountRange.atMostCountRange.betweenCountRange.exactlyCountRange.hasConstraintFoldResults.appendFoldResults.initFoldResults.sliceInlineListOperationInfo.addInherentAttributeNameOperationInfo.addInherentAttributeNamesOperationInfo.addInterfaceOperationInfo.addOperandTypeConstraintOperationInfo.addOrReplaceInterfaceOperationInfo.addRequiredAttributeNameOperationInfo.addRequiredAttributeNamesOperationInfo.addResultTypeConstraintOperationInfo.addTraitOperationInfo.deinitOperationInfo.getDynamicTraitIdsOperationInfo.getInherentAttributeNamesOperationInfo.getInterfaceOperationInfo.getNumInterfacesOperationInfo.getOperandSegmentsOperationInfo.getOperandTypeConstraintsOperationInfo.getPropertiesModelOperationInfo.getRequiredAttributeNamesOperationInfo.getResultSegmentsOperationInfo.getResultTypeConstraintsOperationInfo.hasInherentAttributeNameOperationInfo.hasInterfaceOperationInfo.hasPropertiesModelOperationInfo.hasRequiredAttributeNameOperationInfo.hasTraitIdOperationInfo.initOperationInfo.initEntryStorageOperationInfo.setOperandSegmentsOperationInfo.setPropertiesModelOperationInfo.setResultSegmentsOperationInfo.setShapeOperationRegistry.countOperationRegistry.deinitOperationRegistry.getOrCreateOperationRegistry.getOrCreateOperationBatchOperationRegistry.getOrCreateTrackedOperationRegistry.getOrCreateTrackedWithAttributeNameCapacityOperationRegistry.initOperationRegistry.lookupOperationRegistry.registerInherentAttributeNameOperationRegistry.registerInherentAttributeNamesOperationRegistry.registerInterfaceOperationRegistry.registerOperandSegmentsOperationRegistry.registerOperandTypeConstraintOperationRegistry.registerOperationOperationRegistry.registerOrReplaceInterfaceOperationRegistry.registerPropertiesModelOperationRegistry.registerRequiredAttributeNameOperationRegistry.registerResultSegmentsOperationRegistry.registerResultTypeConstraintOperationRegistry.registerShapeOperationRegistry.registerTraitOperationRegistry.removeOperationOperationSegmentSpec.eqlOperationSegmentSpec.hasSegmentsOperationSegmentSpec.offsetOperationSegmentSpec.sizeOperationShape.eqlOperationShape.hasConstraintsOperationTraits.mergeOperationTypeConstraint.eqlTraitRegistry.countTraitRegistry.deinitTraitRegistry.initTraitRegistry.lookupTraitRegistry.registerTypeInfo.addInterfaceTypeInfo.addOrReplaceInterfaceTypeInfo.deinitTypeInfo.getInterfaceTypeInfo.getNumInterfacesTypeInfo.hasInterfaceTypeInfo.initTypeRegistry.countTypeRegistry.deinitTypeRegistry.getOrCreateTypeRegistry.getOrCreateNamedBatchTypeRegistry.getOrCreateTrackedTypeRegistry.initTypeRegistry.lookupTypeRegistry.registerInterfaceTypeRegistry.registerOrReplaceInterfaceTypeRegistry.registerTypeTypeRegistry.removeTypecastContextinterfaceIdinterfaceIdRuntimesingleAttributePropertiesModeltraitIdtraitIdRuntime
Types and contracts
Public types and contracts.
AbstractAttributeAttributeArrayInterfaceAttributeEqualInterfaceAttributePrintInterfaceAttributeRegistryAttributeRegistry.AttributeRegistryEntryAttributeRegistry.RegisterErrorAttributeRegistry.RegisterInterfaceErrorAttributeRegistry.RegisterOrReplaceInterfaceErrorCallOpInterfaceContextOpaqueControlFlowInterfaceCountRangeCseOpInterfaceDiagnosticKindEffectOpInterfaceEvalContextEvalErrorEvaluatableFoldOpInterfaceFoldResultFoldResultsFunctionOpInterfaceHandlerEntryOpInterfaceInferTypeOpInterfaceInterfaceEntryInterfaceIdOperationInfoOperationInfo.AddInherentAttributeNameErrorOperationInfo.AddInterfaceErrorOperationInfo.AddRequiredAttributeNameErrorOperationInfo.AddTraitErrorOperationInfo.AddTypeConstraintErrorOperationInfo.AttributeNameCapacityOperationInfo.SetPropertiesModelErrorOperationInfo.SetSegmentSpecErrorOperationInfo.SetShapeErrorOperationPropertiesModelOperationRegistryOperationRegistry.GetOrCreateErrorOperationRegistry.GetOrCreateResultOperationRegistry.RegisterInherentAttributeNameErrorOperationRegistry.RegisterInterfaceErrorOperationRegistry.RegisterPropertiesModelErrorOperationRegistry.RegisterRequiredAttributeNameErrorOperationRegistry.RegisterSegmentSpecErrorOperationRegistry.RegisterShapeErrorOperationRegistry.RegisterTraitErrorOperationRegistry.RegisterTypeConstraintErrorOperationSegmentSpecOperationShapeOperationTraitsOperationTypeConstraintRegionKindRegionKindInterfaceShapedTypeInterfaceSymbolOpInterfaceSymbolUserAttrInterfaceSymbolUserOpInterfaceTraitEntryTraitIdTraitRegistryTraitRegistry.RegisterErrorTraitVTableTranslationDialectInterfaceTypeInfoTypeInfo.AddInterfaceErrorTypeParamInterfaceTypeParamPayloadTypePrintInterfaceTypeRegistryTypeRegistry.GetOrCreateErrorTypeRegistry.GetOrCreateResultTypeRegistry.RegisterInterfaceErrorTypeVerifyInterfaceYieldOpInterface
Namespaces
Public namespaces.
Values and defaults
Public values and defaults.
Source
Source: lib/choir/src/core/interfaces/attrs.zig:10
pub const AbstractAttribute = struct { attr_id: u32, name: []const u8, interfaces: []const InterfaceEntry, pub fn getInterface(self: *const AbstractAttribute, id: InterfaceId) ?*const anyopaque { for (self.interfaces) |entry| { if (entry.id == id) return entry.vtable; } return null; } pub fn hasInterface(self: *const AbstractAttribute, id: InterfaceId) bool { return self.getInterface(id) != null; }};Source: lib/choir/src/core/interfaces/attrs.zig:139
pub const AttributeRegistry = struct { allocator: std.mem.Allocator, attrs: std.StringHashMapUnmanaged(AttributeRegistryEntry), next_attr_id: u32, pub const AttributeRegistryEntry = struct { abstract: *const AbstractAttribute, owns_interfaces: bool, }; pub const RegisterError = error{DuplicateAttribute} || std.mem.Allocator.Error; pub const RegisterInterfaceError = error{ UnknownAttribute, DuplicateInterface } || std.mem.Allocator.Error; pub const RegisterOrReplaceInterfaceError = error{UnknownAttribute} || std.mem.Allocator.Error; fn interfaceLessThan(_: void, a: InterfaceEntry, b: InterfaceEntry) bool { return a.id < b.id; } pub fn init(allocator: std.mem.Allocator, first_dynamic_id: u32) AttributeRegistry { return .{ .allocator = allocator, .attrs = .{}, .next_attr_id = first_dynamic_id, }; } pub fn deinit(self: *AttributeRegistry) void { var it = self.attrs.valueIterator(); while (it.next()) |entry| { const abstract = entry.abstract; if (entry.owns_interfaces and abstract.interfaces.len > 0) { self.allocator.free(@constCast(abstract.interfaces)); } self.allocator.destroy(@constCast(abstract)); } var key_iter = self.attrs.keyIterator(); while (key_iter.next()) |name_ptr| { self.allocator.free(name_ptr.*); } self.attrs.deinit(self.allocator); } pub fn lookup(self: *const AttributeRegistry, attr_name: []const u8) ?*const AbstractAttribute { if (self.attrs.get(attr_name)) |entry| { return entry.abstract; } return null; } pub fn nextAttributeId(self: *AttributeRegistry) u32 { return self.next_attr_id; } pub fn restoreNextAttributeId(self: *AttributeRegistry, id: u32) void { self.next_attr_id = id; } pub fn registerAttribute( self: *AttributeRegistry, attr_name: []const u8, interfaces: []const InterfaceEntry, ) RegisterError!*const AbstractAttribute { if (self.attrs.get(attr_name) != null) return error.DuplicateAttribute; const owned_name = try self.allocator.dupe(u8, attr_name); errdefer self.allocator.free(owned_name); var iface_slice: []InterfaceEntry = &.{}; var owns_interfaces = false; if (interfaces.len > 0) { iface_slice = try self.allocator.dupe(InterfaceEntry, interfaces); std.mem.sort(InterfaceEntry, iface_slice, {}, interfaceLessThan); owns_interfaces = true; } errdefer if (owns_interfaces and iface_slice.len > 0) self.allocator.free(iface_slice); const abstract = try self.allocator.create(AbstractAttribute); errdefer self.allocator.destroy(abstract); abstract.* = .{ .attr_id = self.next_attr_id, .name = owned_name, .interfaces = iface_slice, }; const gop = try self.attrs.getOrPut(self.allocator, owned_name); if (gop.found_existing) return error.DuplicateAttribute; gop.key_ptr.* = owned_name; gop.value_ptr.* = .{ .abstract = abstract, .owns_interfaces = owns_interfaces, }; self.next_attr_id += 1; return abstract; } pub fn registerInterface( self: *AttributeRegistry, attr_name: []const u8, entry: InterfaceEntry, ) RegisterInterfaceError!void { const reg_entry = self.attrs.getPtr(attr_name) orelse return error.UnknownAttribute; const abstract: *AbstractAttribute = @constCast(reg_entry.abstract); for (abstract.interfaces) |existing| { if (existing.id == entry.id) return error.DuplicateInterface; } const old_slice = abstract.interfaces; const new_slice = try self.allocator.alloc(InterfaceEntry, old_slice.len + 1); if (old_slice.len > 0) { @memcpy(new_slice[0..old_slice.len], old_slice); } new_slice[old_slice.len] = entry; std.mem.sort(InterfaceEntry, new_slice, {}, interfaceLessThan); if (reg_entry.owns_interfaces and old_slice.len > 0) { self.allocator.free(@constCast(old_slice)); } reg_entry.owns_interfaces = true; abstract.interfaces = new_slice; } pub fn registerOrReplaceInterface( self: *AttributeRegistry, attr_name: []const u8, entry: InterfaceEntry, ) RegisterOrReplaceInterfaceError!void { const reg_entry = self.attrs.getPtr(attr_name) orelse return error.UnknownAttribute; const abstract: *AbstractAttribute = @constCast(reg_entry.abstract); const old_slice = abstract.interfaces; var replace_index: ?usize = null; for (old_slice, 0..) |existing, i| { if (existing.id == entry.id) { replace_index = i; break; } } const new_len = if (replace_index == null) old_slice.len + 1 else old_slice.len; const new_slice = try self.allocator.alloc(InterfaceEntry, new_len); if (old_slice.len > 0) { @memcpy(new_slice[0..old_slice.len], old_slice); } if (replace_index) |idx| { new_slice[idx] = entry; } else { new_slice[old_slice.len] = entry; } std.mem.sort(InterfaceEntry, new_slice, {}, interfaceLessThan); if (reg_entry.owns_interfaces and old_slice.len > 0) { self.allocator.free(@constCast(old_slice)); } reg_entry.owns_interfaces = true; abstract.interfaces = new_slice; } pub fn count(self: *const AttributeRegistry) usize { return self.attrs.count(); } pub fn removeAttribute(self: *AttributeRegistry, attr_name: []const u8) bool { const removed = self.attrs.fetchRemove(attr_name) orelse return false; const abstract = removed.value.abstract; if (removed.value.owns_interfaces and abstract.interfaces.len > 0) { self.allocator.free(@constCast(abstract.interfaces)); } self.allocator.destroy(@constCast(abstract)); self.allocator.free(removed.key); return true; }};Source: lib/choir/src/core/interfaces/base.zig:4
pub const ContextOpaque = opaque {};Source: lib/choir/src/core/interfaces/base.zig:20
pub const InterfaceEntry = struct { id: InterfaceId, vtable: *const anyopaque,};Source: lib/choir/src/core/interfaces/base.zig:99
pub const TypeParamPayload = struct { ptr: *anyopaque, deinit: *const fn (allocator: std.mem.Allocator, ptr: *anyopaque) void,};Source: lib/choir/src/core/interfaces/ops.zig:32
pub const CountRange = struct { min: usize = 0, max: ?usize = null, pub fn exactly(count: usize) CountRange { return .{ .min = count, .max = count }; } pub fn atLeast(count: usize) CountRange { return .{ .min = count }; } pub fn atMost(count: usize) CountRange { return .{ .max = count }; } pub fn between(min: usize, max: usize) CountRange { return .{ .min = min, .max = max }; } pub fn allows(self: CountRange, count: usize) bool { if (count < self.min) return false; if (self.max) |max| { if (count > max) return false; } return true; } pub fn hasConstraint(self: CountRange) bool { return self.min != 0 or self.max != null; }};Source: lib/choir/src/core/interfaces/ops.zig:1303
pub const DiagnosticKind = enum { error_, warning,};Source: lib/choir/src/core/interfaces/ops.zig:1339
pub const EvalContext = struct { state: *anyopaque, allocator: std.mem.Allocator, emitDiagnostic: *const fn (state: *anyopaque, kind: DiagnosticKind, message: []const u8) EvalError!void, evaluateRegion: *const fn (state: *anyopaque, region: *const anyopaque) EvalError!IrAttribute, evaluateRegionWithArgs: *const fn ( state: *anyopaque, region: *const anyopaque, args: []const IrAttribute, ) EvalError!IrAttribute, evaluateSymbol: *const fn ( state: *anyopaque, symbol: []const u8, args: []const IrAttribute, ) EvalError!IrAttribute, consumeBranchFuel: *const fn (state: *anyopaque) EvalError!void, consumeIterationFuel: *const fn (state: *anyopaque) EvalError!void, allocHandle: *const fn (state: *anyopaque, size: i64) EvalError!i64, borrowHandle: *const fn (state: *anyopaque, handle: i64) EvalError!i64, borrowMutHandle: *const fn (state: *anyopaque, handle: i64) EvalError!i64, moveHandle: *const fn (state: *anyopaque, handle: i64) EvalError!i64, dropHandle: *const fn (state: *anyopaque, handle: i64) EvalError!void, createRewriteBuilder: *const fn (state: *anyopaque, root: *IrOperation) EvalError!*anyopaque,};Source: lib/choir/src/core/interfaces/ops.zig:1308
pub const EvalError = error{ UnsupportedOperation, UnknownEffect, EffectViolation, LocationViolation, DivisionByZero, InvalidOperand, InvalidConstant, RequiresDynamicInfo, InvalidShiftAmount, InvalidPredicate, EvaluationFailed, Overflow, RecursionDepthExceeded, InvalidCondition, InvalidSize, NegativeSize, InvalidHandle, HandleAlreadyDropped, BorrowOfInvalidHandle, MoveOfInvalidHandle, BranchQuotaExceeded, IterationQuotaExceeded, DeviceLocationForbidden, UnifiedLocationForbidden, YieldMissingOperand, NoYield, ValueNotFound, OutOfMemory,};Source: lib/choir/src/core/interfaces/ops.zig:1231
pub const FoldResult = union(enum) { value: *IrValue, attribute: IrAttribute,};Source: lib/choir/src/core/interfaces/ops.zig:1236
pub const FoldResults = struct { storage: []FoldResult, len: usize = 0, pub fn init(storage: []FoldResult) FoldResults { return .{ .storage = storage }; } pub fn append(self: *FoldResults, result: FoldResult) error{CapacityExceeded}!void { std.debug.assert(self.len <= self.storage.len); if (self.len == self.storage.len) return error.CapacityExceeded; self.storage[self.len] = result; self.len += 1; } pub fn slice(self: *const FoldResults) []const FoldResult { std.debug.assert(self.len <= self.storage.len); return self.storage[0..self.len]; }};Source: lib/choir/src/core/interfaces/ops.zig:258
pub const OperationInfo = struct { pub const dynamic_trait_inline_capacity = traits.TraitIds.inline_capacity; pub const interface_inline_capacity = InterfaceEntries.inline_capacity; pub const AttributeNameCapacity = struct { inherent: usize = 0, required: usize = 0, }; name: []const u8, traits: OperationTraits = .{}, shape: OperationShape = .{}, dynamic_trait_ids: traits.TraitIds = .{}, interfaces: InterfaceEntries = .{}, inherent_attribute_names: AttributeNameList = .{}, required_attribute_names: AttributeNameList = .{}, operand_type_constraints: std.ArrayListUnmanaged(OperationTypeConstraint) = .empty, result_type_constraints: std.ArrayListUnmanaged(OperationTypeConstraint) = .empty, operand_segments: ?OperationSegmentSpec = null, result_segments: ?OperationSegmentSpec = null, properties_model: ?OperationPropertiesModel = null, pub const AddTraitError = error{DuplicateTrait} || std.mem.Allocator.Error; pub const AddInterfaceError = error{DuplicateInterface} || std.mem.Allocator.Error; pub const AddInherentAttributeNameError = error{DuplicateInherentAttributeName} || std.mem.Allocator.Error; pub const AddRequiredAttributeNameError = error{DuplicateRequiredAttributeName} || AddInherentAttributeNameError; pub const SetPropertiesModelError = error{ DuplicateOperationProperties, IncompleteOperationPropertiesCodec, }; pub const SetShapeError = error{ConflictingOperationShape}; pub const SetSegmentSpecError = error{ EmptySegmentAttributeName, EmptyOperationSegments, ConflictingOperandSegments, ConflictingResultSegments, } || std.mem.Allocator.Error; pub const AddTypeConstraintError = error{ DuplicateOperandTypeConstraint, DuplicateResultTypeConstraint, ConflictingOperandTypeConstraint, ConflictingResultTypeConstraint, } || std.mem.Allocator.Error; pub fn init(name: []const u8) OperationInfo { return .{ .name = name }; } pub fn initEntryStorage( name: []const u8, trait_storage: *[dynamic_trait_inline_capacity]TraitId, interface_storage: *[interface_inline_capacity]InterfaceEntry, inherent_attribute_storage: [][]const u8, required_attribute_storage: [][]const u8, ) OperationInfo { return .{ .name = name, .dynamic_trait_ids = traits.TraitIds.initInline(trait_storage), .interfaces = InterfaceEntries.initInline(interface_storage), .inherent_attribute_names = initAttributeNameList(inherent_attribute_storage), .required_attribute_names = initAttributeNameList(required_attribute_storage), }; } fn initAttributeNameList(storage: [][]const u8) AttributeNameList { if (storage.len == 0) return .{}; return AttributeNameList.initBorrowed(storage); } pub fn deinit(self: *OperationInfo, allocator: std.mem.Allocator) void { self.dynamic_trait_ids.deinit(allocator); self.interfaces.deinit(allocator); for (self.inherent_attribute_names.values()) |name| { allocator.free(name); } self.inherent_attribute_names.deinit(allocator); for (self.required_attribute_names.values()) |name| { allocator.free(name); } self.required_attribute_names.deinit(allocator); for (self.operand_type_constraints.items) |constraint| { allocator.free(constraint.type_name); } self.operand_type_constraints.deinit(allocator); for (self.result_type_constraints.items) |constraint| { allocator.free(constraint.type_name); } self.result_type_constraints.deinit(allocator); if (self.operand_segments) |segment_spec| { freeSegmentSpec(allocator, segment_spec); } if (self.result_segments) |segment_spec| { freeSegmentSpec(allocator, segment_spec); } } pub fn addTrait( self: *OperationInfo, allocator: std.mem.Allocator, trait_id: TraitId, ) AddTraitError!void { try self.dynamic_trait_ids.insert(allocator, trait_id); } pub fn addInterface( self: *OperationInfo, allocator: std.mem.Allocator, entry: InterfaceEntry, ) AddInterfaceError!void { try self.interfaces.insert(allocator, entry); } pub fn addOrReplaceInterface( self: *OperationInfo, allocator: std.mem.Allocator, entry: InterfaceEntry, ) !void { try self.interfaces.insertOrReplace(allocator, entry); } pub fn addInherentAttributeName( self: *OperationInfo, allocator: std.mem.Allocator, name: []const u8, ) AddInherentAttributeNameError!void { if (self.hasInherentAttributeName(name)) return error.DuplicateInherentAttributeName; const owned_name = try allocator.dupe(u8, name); errdefer allocator.free(owned_name); try self.inherent_attribute_names.append(allocator, owned_name); std.mem.sort( []const u8, self.inherent_attribute_names.valuesMut(), {}, name_less_than, ); } pub fn addInherentAttributeNames( self: *OperationInfo, allocator: std.mem.Allocator, names: []const []const u8, ) AddInherentAttributeNameError!void { for (names) |name| { try self.addInherentAttributeName(allocator, name); } } pub fn getInherentAttributeNames(self: *const OperationInfo) []const []const u8 { return self.inherent_attribute_names.values(); } pub fn hasInherentAttributeName(self: *const OperationInfo, name: []const u8) bool { return sortedNameContains(self.inherent_attribute_names.values(), name); } pub fn addRequiredAttributeName( self: *OperationInfo, allocator: std.mem.Allocator, name: []const u8, ) AddRequiredAttributeNameError!void { if (!self.hasInherentAttributeName(name)) { try self.addInherentAttributeName(allocator, name); } if (self.hasRequiredAttributeName(name)) return error.DuplicateRequiredAttributeName; const owned_name = try allocator.dupe(u8, name); errdefer allocator.free(owned_name); try self.required_attribute_names.append(allocator, owned_name); std.mem.sort( []const u8, self.required_attribute_names.valuesMut(), {}, name_less_than, ); } pub fn addRequiredAttributeNames( self: *OperationInfo, allocator: std.mem.Allocator, names: []const []const u8, ) AddRequiredAttributeNameError!void { for (names) |name| { try self.addRequiredAttributeName(allocator, name); } } pub fn getRequiredAttributeNames(self: *const OperationInfo) []const []const u8 { return self.required_attribute_names.values(); } pub fn hasRequiredAttributeName(self: *const OperationInfo, name: []const u8) bool { return sortedNameContains(self.required_attribute_names.values(), name); } fn sortedNameContains(names: []const []const u8, name: []const u8) bool { var left: usize = 0; var right: usize = names.len; while (left < right) { const mid = left + (right - left) / 2; const cmp = std.mem.order(u8, names[mid], name); switch (cmp) { .eq => return true, .lt => left = mid + 1, .gt => right = mid, } } return false; } pub fn setPropertiesModel( self: *OperationInfo, model: OperationPropertiesModel, ) SetPropertiesModelError!void { if (self.properties_model != null) return error.DuplicateOperationProperties; if ((model.getPropertiesAsAttr == null) != (model.setPropertiesFromAttr == null)) { return error.IncompleteOperationPropertiesCodec; } self.properties_model = model; } pub fn getPropertiesModel(self: *const OperationInfo) ?*const OperationPropertiesModel { if (self.properties_model) |*model| return model; return null; } pub fn hasPropertiesModel(self: *const OperationInfo) bool { return self.properties_model != null; } pub fn setShape( self: *OperationInfo, shape: OperationShape, ) SetShapeError!void { if (self.shape.hasConstraints() and !self.shape.eql(shape)) { return error.ConflictingOperationShape; } self.shape = shape; } pub fn setOperandSegments( self: *OperationInfo, allocator: std.mem.Allocator, spec: OperationSegmentSpec, ) SetSegmentSpecError!void { try self.setSegmentSpec(allocator, &self.operand_segments, spec, error.ConflictingOperandSegments); } pub fn setResultSegments( self: *OperationInfo, allocator: std.mem.Allocator, spec: OperationSegmentSpec, ) SetSegmentSpecError!void { try self.setSegmentSpec(allocator, &self.result_segments, spec, error.ConflictingResultSegments); } fn setSegmentSpec( self: *OperationInfo, allocator: std.mem.Allocator, slot: *?OperationSegmentSpec, spec: OperationSegmentSpec, conflict: SetSegmentSpecError, ) SetSegmentSpecError!void { _ = self; if (spec.attribute_name.len == 0) return error.EmptySegmentAttributeName; if (spec.segments.len == 0) return error.EmptyOperationSegments; if (slot.*) |existing| { if (existing.eql(spec)) return; return conflict; } const owned_name = try allocator.dupe(u8, spec.attribute_name); errdefer allocator.free(owned_name); const owned_segments = try allocator.dupe(CountRange, spec.segments); errdefer allocator.free(owned_segments); slot.* = .{ .attribute_name = owned_name, .segments = owned_segments, }; } pub fn addOperandTypeConstraint( self: *OperationInfo, allocator: std.mem.Allocator, constraint: OperationTypeConstraint, ) AddTypeConstraintError!void { try self.addTypeConstraint( allocator, &self.operand_type_constraints, constraint, error.DuplicateOperandTypeConstraint, error.ConflictingOperandTypeConstraint, ); } pub fn addResultTypeConstraint( self: *OperationInfo, allocator: std.mem.Allocator, constraint: OperationTypeConstraint, ) AddTypeConstraintError!void { try self.addTypeConstraint( allocator, &self.result_type_constraints, constraint, error.DuplicateResultTypeConstraint, error.ConflictingResultTypeConstraint, ); } fn addTypeConstraint( self: *OperationInfo, allocator: std.mem.Allocator, list: *std.ArrayListUnmanaged(OperationTypeConstraint), constraint: OperationTypeConstraint, duplicate: AddTypeConstraintError, conflict: AddTypeConstraintError, ) AddTypeConstraintError!void { _ = self; for (list.items) |existing| { if (existing.index == constraint.index) { if (existing.eql(constraint)) return duplicate; return conflict; } } const owned_name = try allocator.dupe(u8, constraint.type_name); errdefer allocator.free(owned_name); try list.append(allocator, .{ .index = constraint.index, .type_name = owned_name, .allow_parameterized = constraint.allow_parameterized, }); std.mem.sort(OperationTypeConstraint, list.items, {}, type_constraint_less_than); } pub fn getOperandTypeConstraints(self: *const OperationInfo) []const OperationTypeConstraint { return self.operand_type_constraints.items; } pub fn getResultTypeConstraints(self: *const OperationInfo) []const OperationTypeConstraint { return self.result_type_constraints.items; } pub fn getOperandSegments(self: *const OperationInfo) ?OperationSegmentSpec { return self.operand_segments; } pub fn getResultSegments(self: *const OperationInfo) ?OperationSegmentSpec { return self.result_segments; } pub fn getInterface(self: *const OperationInfo, id: InterfaceId) ?*const anyopaque { return self.interfaces.get(id); } pub fn hasTraitId(self: *const OperationInfo, trait_id: TraitId) bool { return self.dynamic_trait_ids.contains(trait_id); } pub fn getDynamicTraitIds(self: *const OperationInfo) []const TraitId { return self.dynamic_trait_ids.values(); } pub fn hasInterface(self: *const OperationInfo, id: InterfaceId) bool { return self.getInterface(id) != null; } pub fn getNumInterfaces(self: *const OperationInfo) usize { return self.interfaces.count(); }};Source: lib/choir/src/core/interfaces/ops.zig:649
pub const OperationRegistry = struct { allocator: std.mem.Allocator, ops: std.StringHashMapUnmanaged(*OperationInfo), batch_regions: ?*BatchEntryStorage.RegionOwner, allow_unregistered_operations: bool, pub const RegisterPropertiesModelError = OperationInfo.SetPropertiesModelError || GetOrCreateError; pub const RegisterShapeError = OperationInfo.SetShapeError || GetOrCreateError; pub const RegisterSegmentSpecError = OperationInfo.SetSegmentSpecError || GetOrCreateError; pub const RegisterTypeConstraintError = OperationInfo.AddTypeConstraintError || GetOrCreateError; pub const GetOrCreateError: type = std.mem.Allocator.Error; pub const GetOrCreateResult = struct { info: *OperationInfo, created: bool, }; pub const RegisterTraitError: type = OperationInfo.AddTraitError; pub const RegisterInterfaceError: type = OperationInfo.AddInterfaceError; pub const RegisterInherentAttributeNameError: type = OperationInfo.AddInherentAttributeNameError; pub const RegisterRequiredAttributeNameError: type = OperationInfo.AddRequiredAttributeNameError; const EntryStorage: type = registry_entry.InlineStorage( OperationInfo, TraitId, OperationInfo.dynamic_trait_inline_capacity, InterfaceEntry, OperationInfo.interface_inline_capacity, []const u8, []const u8, ); const BatchEntryStorage: type = EntryStorage.BatchStorage; pub fn init(allocator: std.mem.Allocator) OperationRegistry { return .{ .allocator = allocator, .ops = .{}, .batch_regions = null, .allow_unregistered_operations = false, }; } pub fn deinit(self: *OperationRegistry) void { var it = self.ops.valueIterator(); while (it.next()) |info_ptr| { const info = info_ptr.*; if (self.findBatchRegionLink(info) != null) { info.deinit(self.allocator); info.* = undefined; } else { EntryStorage.destroy(self.allocator, info); } } self.ops.deinit(self.allocator); while (self.batch_regions) |region| { self.batch_regions = region.next; BatchEntryStorage.destroy(self.allocator, region); } } pub fn lookup(self: *const OperationRegistry, op_name: []const u8) ?*OperationInfo { return self.ops.get(op_name); } pub fn getOrCreate(self: *OperationRegistry, op_name: []const u8) GetOrCreateError!*OperationInfo { return (try self.getOrCreateTracked(op_name)).info; } pub fn getOrCreateTracked(self: *OperationRegistry, op_name: []const u8) GetOrCreateError!GetOrCreateResult { return self.getOrCreateTrackedWithAttributeNameCapacity(op_name, .{}); } pub fn getOrCreateTrackedWithAttributeNameCapacity( self: *OperationRegistry, op_name: []const u8, capacity: OperationInfo.AttributeNameCapacity, ) GetOrCreateError!GetOrCreateResult { if (self.ops.get(op_name)) |existing| { return .{ .info = existing, .created = false }; } const info = try EntryStorage.create( self.allocator, op_name, capacity.inherent, capacity.required, ); errdefer EntryStorage.destroy(self.allocator, info); const gop = try self.ops.getOrPut(self.allocator, info.name); if (gop.found_existing) { EntryStorage.destroy(self.allocator, info); return .{ .info = gop.value_ptr.*, .created = false }; } gop.value_ptr.* = info; return .{ .info = info, .created = true }; } pub fn getOrCreateOperationBatch( self: *OperationRegistry, operation_specs: anytype, ) GetOrCreateError!void { var capacity_value: BatchEntryStorage.Capacity = .{}; for (operation_specs) |op| { if (self.ops.get(op.name) != null) continue; capacity_value.add( op.name.len, op.inherent_attribute_names.len, op.required_attribute_names.len, ) catch return error.OutOfMemory; } if (capacity_value.entry_count == 0) return; const unused_capacity = std.math.cast( u32, capacity_value.entry_count, ) orelse return error.OutOfMemory; const allocation = try BatchEntryStorage.create( self.allocator, capacity_value, ); errdefer BatchEntryStorage.destroy(self.allocator, allocation.region); try self.ops.ensureUnusedCapacity(self.allocator, unused_capacity); var cursor = BatchEntryStorage.Cursor.init(allocation.entries); for (operation_specs) |op| { if (self.ops.get(op.name) != null) continue; const info = cursor.create( op.name, op.inherent_attribute_names.len, op.required_attribute_names.len, ); self.ops.putAssumeCapacityNoClobber(info.name, info); } std.debug.assert(cursor.offset <= allocation.entries.len); allocation.region.next = self.batch_regions; self.batch_regions = allocation.region; } pub fn registerOperation( self: *OperationRegistry, op_name: []const u8, traits_val: OperationTraits, ) GetOrCreateError!*OperationInfo { const info = try self.getOrCreate(op_name); info.traits = info.traits.merge(traits_val); return info; } pub fn registerTrait( self: *OperationRegistry, op_name: []const u8, trait_id: TraitId, ) RegisterTraitError!void { const info = try self.getOrCreate(op_name); try info.addTrait(self.allocator, trait_id); } pub fn registerInterface( self: *OperationRegistry, op_name: []const u8, entry: InterfaceEntry, ) RegisterInterfaceError!void { const info = try self.getOrCreate(op_name); try info.addInterface(self.allocator, entry); } pub fn registerOrReplaceInterface( self: *OperationRegistry, op_name: []const u8, entry: InterfaceEntry, ) GetOrCreateError!void { const info = try self.getOrCreate(op_name); try info.addOrReplaceInterface(self.allocator, entry); } pub fn registerInherentAttributeName( self: *OperationRegistry, op_name: []const u8, attr_name: []const u8, ) RegisterInherentAttributeNameError!void { const info = try self.getOrCreate(op_name); try info.addInherentAttributeName(self.allocator, attr_name); } pub fn registerRequiredAttributeName( self: *OperationRegistry, op_name: []const u8, attr_name: []const u8, ) RegisterRequiredAttributeNameError!void { const info = try self.getOrCreate(op_name); try info.addRequiredAttributeName(self.allocator, attr_name); } pub fn registerInherentAttributeNames( self: *OperationRegistry, op_name: []const u8, attr_names: []const []const u8, ) RegisterInherentAttributeNameError!void { const info = try self.getOrCreate(op_name); try info.addInherentAttributeNames(self.allocator, attr_names); } pub fn registerPropertiesModel( self: *OperationRegistry, op_name: []const u8, model: OperationPropertiesModel, ) RegisterPropertiesModelError!void { const info = try self.getOrCreate(op_name); try info.setPropertiesModel(model); } pub fn registerShape( self: *OperationRegistry, op_name: []const u8, shape: OperationShape, ) RegisterShapeError!void { const info = try self.getOrCreate(op_name); try info.setShape(shape); } pub fn registerOperandSegments( self: *OperationRegistry, op_name: []const u8, spec: OperationSegmentSpec, ) RegisterSegmentSpecError!void { const info = try self.getOrCreate(op_name); try info.setOperandSegments(self.allocator, spec); } pub fn registerResultSegments( self: *OperationRegistry, op_name: []const u8, spec: OperationSegmentSpec, ) RegisterSegmentSpecError!void { const info = try self.getOrCreate(op_name); try info.setResultSegments(self.allocator, spec); } pub fn registerOperandTypeConstraint( self: *OperationRegistry, op_name: []const u8, constraint: OperationTypeConstraint, ) RegisterTypeConstraintError!void { const info = try self.getOrCreate(op_name); try info.addOperandTypeConstraint(self.allocator, constraint); } pub fn registerResultTypeConstraint( self: *OperationRegistry, op_name: []const u8, constraint: OperationTypeConstraint, ) RegisterTypeConstraintError!void { const info = try self.getOrCreate(op_name); try info.addResultTypeConstraint(self.allocator, constraint); } pub fn count(self: *const OperationRegistry) usize { return self.ops.count(); } pub fn removeOperation(self: *OperationRegistry, op_name: []const u8) bool { const removed = self.ops.fetchRemove(op_name) orelse return false; const info = removed.value; std.debug.assert(removed.key.ptr == info.name.ptr); if (self.findBatchRegionLink(info)) |region_link| { const region = region_link.*.?; info.deinit(self.allocator); info.* = undefined; if (!self.batchRegionHasLiveInfo(region)) { region_link.* = region.next; BatchEntryStorage.destroy(self.allocator, region); } } else { EntryStorage.destroy(self.allocator, info); } return true; } fn findBatchRegionLink( self: *OperationRegistry, info: *const OperationInfo, ) ?*?*BatchEntryStorage.RegionOwner { var region_link = &self.batch_regions; while (region_link.*) |region| { if (BatchEntryStorage.contains(region, info)) return region_link; region_link = ®ion.next; } return null; } fn batchRegionHasLiveInfo( self: *const OperationRegistry, region: *const BatchEntryStorage.RegionOwner, ) bool { var it = self.ops.valueIterator(); while (it.next()) |info_ptr| { if (BatchEntryStorage.contains(region, info_ptr.*)) return true; } return false; }};Source: lib/choir/src/core/interfaces/ops.zig:83
pub const OperationSegmentSpec = struct { attribute_name: []const u8, segments: []const CountRange, pub fn hasSegments(self: OperationSegmentSpec) bool { return self.segments.len > 0; } pub fn eql(self: OperationSegmentSpec, other: OperationSegmentSpec) bool { if (!std.mem.eql(u8, self.attribute_name, other.attribute_name)) return false; if (self.segments.len != other.segments.len) return false; for (self.segments, other.segments) |a, b| { if (!std.meta.eql(a, b)) return false; } return true; } pub fn size(self: OperationSegmentSpec, op: *const IrOperation, index: usize) ?usize { if (index >= self.segments.len) return null; const attr = op.getAttrAs(IrAttribute.ArrayAttr, self.attribute_name) orelse return null; const values = attr.getValues(); if (index >= values.len) return null; const int_attr = values[index].cast(IrAttribute.IntegerAttr) orelse return null; return std.math.cast(usize, int_attr.getValue()); } pub fn offset(self: OperationSegmentSpec, op: *const IrOperation, index: usize) ?usize { if (index > self.segments.len) return null; const attr = op.getAttrAs(IrAttribute.ArrayAttr, self.attribute_name) orelse return null; const values = attr.getValues(); if (index > values.len) return null; var result: usize = 0; for (values[0..index]) |value| { const int_attr = value.cast(IrAttribute.IntegerAttr) orelse return null; const size_value = std.math.cast(usize, int_attr.getValue()) orelse return null; result = std.math.add(usize, result, size_value) catch return null; } return result; }};Source: lib/choir/src/core/interfaces/ops.zig:65
pub const OperationShape = struct { operands: CountRange = .{}, results: CountRange = .{}, regions: CountRange = .{}, successors: CountRange = .{}, pub fn hasConstraints(self: OperationShape) bool { return self.operands.hasConstraint() or self.results.hasConstraint() or self.regions.hasConstraint() or self.successors.hasConstraint(); } pub fn eql(self: OperationShape, other: OperationShape) bool { return std.meta.eql(self, other); }};Source: lib/choir/src/core/interfaces/ops.zig:124
pub const OperationTypeConstraint = struct { index: usize, type_name: []const u8, allow_parameterized: bool = false, pub fn eql(self: OperationTypeConstraint, other: OperationTypeConstraint) bool { return self.index == other.index and self.allow_parameterized == other.allow_parameterized and std.mem.eql(u8, self.type_name, other.type_name); }};Source: lib/choir/src/core/interfaces/ops.zig:1115
pub const RegionKind = enum { ssacfg, graph,};Source: lib/choir/src/core/interfaces/traits.zig:108
pub const OperationTraits = packed struct(u64) { is_terminator: bool = false, is_commutative: bool = false, is_idempotent: bool = false, is_involution: bool = false, is_symbol_table: bool = false, has_no_terminator: bool = false, has_only_graph_regions: bool = false, _padding: u57 = 0, pub fn merge(a: OperationTraits, b: OperationTraits) OperationTraits { return .{ .is_terminator = a.is_terminator or b.is_terminator, .is_commutative = a.is_commutative or b.is_commutative, .is_idempotent = a.is_idempotent or b.is_idempotent, .is_involution = a.is_involution or b.is_involution, .is_symbol_table = a.is_symbol_table or b.is_symbol_table, .has_no_terminator = a.has_no_terminator or b.has_no_terminator, .has_only_graph_regions = a.has_only_graph_regions or b.has_only_graph_regions, }; }};Source: lib/choir/src/core/interfaces/traits.zig:19
pub const TraitEntry = struct { id: TraitId, vtable: *const TraitVTable,};Source: lib/choir/src/core/interfaces/traits.zig:76
pub const TraitRegistry = struct { traits: std.AutoHashMapUnmanaged(TraitId, *const TraitVTable), pub const RegisterError = error{DuplicateTrait} || std.mem.Allocator.Error; pub fn init() TraitRegistry { return .{ .traits = .{} }; } pub fn deinit(self: *TraitRegistry, allocator: std.mem.Allocator) void { self.traits.deinit(allocator); } pub fn register( self: *TraitRegistry, allocator: std.mem.Allocator, entry: TraitEntry, ) RegisterError!void { const gop = try self.traits.getOrPut(allocator, entry.id); if (gop.found_existing) return error.DuplicateTrait; gop.value_ptr.* = entry.vtable; } pub fn lookup(self: *const TraitRegistry, id: TraitId) ?*const TraitVTable { return self.traits.get(id); } pub fn count(self: *const TraitRegistry) usize { return self.traits.count(); }};Source: lib/choir/src/core/interfaces/traits.zig:14
pub const TraitVTable = struct { verify: ?*const fn (op_ptr: *const anyopaque) anyerror!void = null, verify_regions: ?*const fn (op_ptr: *const anyopaque) anyerror!void = null,};Source: lib/choir/src/core/interfaces/types.zig:13
pub const TypeInfo = struct { name: []const u8, interfaces: InterfaceEntries = .{}, pub const AddInterfaceError = error{DuplicateInterface} || std.mem.Allocator.Error; pub fn init(name: []const u8) TypeInfo { return .{ .name = name }; } pub fn deinit(self: *TypeInfo, allocator: std.mem.Allocator) void { self.interfaces.deinit(allocator); } pub fn addInterface( self: *TypeInfo, allocator: std.mem.Allocator, entry: InterfaceEntry, ) AddInterfaceError!void { try self.interfaces.insert(allocator, entry); } pub fn addOrReplaceInterface( self: *TypeInfo, allocator: std.mem.Allocator, entry: InterfaceEntry, ) !void { try self.interfaces.insertOrReplace(allocator, entry); } pub fn getInterface(self: *const TypeInfo, id: InterfaceId) ?*const anyopaque { return self.interfaces.get(id); } pub fn hasInterface(self: *const TypeInfo, id: InterfaceId) bool { return self.getInterface(id) != null; } pub fn getNumInterfaces(self: *const TypeInfo) usize { return self.interfaces.count(); }};Source: lib/choir/src/core/interfaces/types.zig:57
pub const TypeRegistry = struct { allocator: std.mem.Allocator, types: std.StringHashMapUnmanaged(*TypeInfo), batch_regions: ?*BatchEntryStorage.RegionOwner, allow_unregistered_types: bool, pub const GetOrCreateError: type = std.mem.Allocator.Error; pub const GetOrCreateResult = struct { info: *TypeInfo, created: bool, }; pub const RegisterInterfaceError: type = TypeInfo.AddInterfaceError; const EntryStorage: type = registry_entry.Storage(TypeInfo); const BatchEntryStorage: type = registry_entry.BatchStorage(TypeInfo); pub fn init(allocator: std.mem.Allocator) TypeRegistry { return .{ .allocator = allocator, .types = .{}, .batch_regions = null, .allow_unregistered_types = false, }; } pub fn deinit(self: *TypeRegistry) void { var it = self.types.valueIterator(); while (it.next()) |info_ptr| { const info = info_ptr.*; if (self.findBatchRegionLink(info) != null) { info.deinit(self.allocator); info.* = undefined; } else { EntryStorage.destroy(self.allocator, info); } } self.types.deinit(self.allocator); while (self.batch_regions) |region| { self.batch_regions = region.next; BatchEntryStorage.destroy(self.allocator, region); } } pub fn lookup(self: *const TypeRegistry, type_name: []const u8) ?*TypeInfo { return self.types.get(type_name); } pub fn getOrCreate(self: *TypeRegistry, type_name: []const u8) GetOrCreateError!*TypeInfo { return (try self.getOrCreateTracked(type_name)).info; } pub fn getOrCreateTracked(self: *TypeRegistry, type_name: []const u8) GetOrCreateError!GetOrCreateResult { if (self.types.get(type_name)) |existing| { return .{ .info = existing, .created = false }; } const info = try EntryStorage.create(self.allocator, type_name); errdefer EntryStorage.destroy(self.allocator, info); const gop = try self.types.getOrPut(self.allocator, info.name); if (gop.found_existing) { EntryStorage.destroy(self.allocator, info); return .{ .info = gop.value_ptr.*, .created = false }; } gop.value_ptr.* = info; return .{ .info = info, .created = true }; } pub fn getOrCreateNamedBatch(self: *TypeRegistry, named_items: anytype) GetOrCreateError!void { try self.getOrCreateBatch(named_items); } fn getOrCreateBatch( self: *TypeRegistry, items: anytype, ) GetOrCreateError!void { var info_count: usize = 0; var name_bytes: usize = 0; for (items) |item| { const name = batchItemName(item); if (self.types.get(name) != null) continue; info_count = std.math.add(usize, info_count, 1) catch return error.OutOfMemory; name_bytes = std.math.add(usize, name_bytes, name.len) catch return error.OutOfMemory; } if (info_count == 0) return; const unused_capacity = std.math.cast(u32, info_count) orelse return error.OutOfMemory; const allocation = try BatchEntryStorage.create(self.allocator, info_count, name_bytes); errdefer BatchEntryStorage.destroy(self.allocator, allocation.region); var info_index: usize = 0; var name_offset: usize = 0; for (items) |item| { const name = batchItemName(item); if (self.types.get(name) != null) continue; const name_end = std.math.add(usize, name_offset, name.len) catch unreachable; const owned_name = allocation.names[name_offset..name_end]; @memcpy(owned_name, name); allocation.infos[info_index] = TypeInfo.init(owned_name); info_index += 1; name_offset = name_end; } std.debug.assert(info_index == allocation.infos.len); std.debug.assert(name_offset == allocation.names.len); try self.types.ensureUnusedCapacity(self.allocator, unused_capacity); for (allocation.infos) |*info| { if (self.types.get(info.name) != null) continue; self.types.putAssumeCapacityNoClobber(info.name, info); } allocation.region.next = self.batch_regions; self.batch_regions = allocation.region; } fn batchItemName(item: anytype) []const u8 { if (@TypeOf(item) == []const u8) return item; return item.name; } pub fn registerType(self: *TypeRegistry, type_name: []const u8) GetOrCreateError!*TypeInfo { return self.getOrCreate(type_name); } pub fn registerInterface( self: *TypeRegistry, type_name: []const u8, entry: InterfaceEntry, ) RegisterInterfaceError!void { const info = try self.getOrCreate(type_name); try info.addInterface(self.allocator, entry); } pub fn registerOrReplaceInterface( self: *TypeRegistry, type_name: []const u8, entry: InterfaceEntry, ) !void { const info = try self.getOrCreate(type_name); try info.addOrReplaceInterface(self.allocator, entry); } pub fn count(self: *const TypeRegistry) usize { return self.types.count(); } pub fn removeType(self: *TypeRegistry, type_name: []const u8) bool { const removed = self.types.fetchRemove(type_name) orelse return false; const info = removed.value; std.debug.assert(removed.key.ptr == info.name.ptr); if (self.findBatchRegionLink(info)) |region_link| { const region = region_link.*.?; info.deinit(self.allocator); info.* = undefined; if (!self.batchRegionHasLiveInfo(region)) { region_link.* = region.next; BatchEntryStorage.destroy(self.allocator, region); } } else { EntryStorage.destroy(self.allocator, info); } return true; } fn findBatchRegionLink( self: *TypeRegistry, info: *const TypeInfo, ) ?*?*BatchEntryStorage.RegionOwner { var region_link = &self.batch_regions; while (region_link.*) |region| { if (BatchEntryStorage.contains(region, info)) return region_link; region_link = ®ion.next; } return null; } fn batchRegionHasLiveInfo( self: *const TypeRegistry, region: *const BatchEntryStorage.RegionOwner, ) bool { var it = self.types.valueIterator(); while (it.next()) |info_ptr| { if (BatchEntryStorage.contains(region, info_ptr.*)) return true; } return false; }};Source: lib/choir/src/core/interfaces/base.zig:10
pub const InterfaceId = u64;Source: lib/choir/src/core/interfaces/base.zig:6
pub fn castContext(comptime CtxT: type, ctx_ptr: *const ContextOpaque) *CtxT { return @ptrCast(@alignCast(@constCast(ctx_ptr)));}Source: lib/choir/src/core/interfaces/base.zig:12
pub fn interfaceId(comptime name: []const u8) InterfaceId { return std.hash.Wyhash.hash(0, name);}Source: lib/choir/src/core/interfaces/base.zig:16
pub fn interfaceIdRuntime(name: []const u8) InterfaceId { return std.hash.Wyhash.hash(0, name);}Source: lib/choir/src/core/interfaces/entry.zig:41
pub fn InlineList(comptime Item: type, comptime inline_capacity: usize) type { const inline_mask = @as(usize, 1) << (@bitSizeOf(usize) - 1); return struct { const Self = @This(); slice: []Item = &.{}, capacity_and_inline: usize = 0, pub fn initInline(storage: *[inline_capacity]Item) Self { return initBorrowed(storage); } pub fn initBorrowed(storage: []Item) Self { std.debug.assert(storage.len & inline_mask == 0); return .{ .slice = storage[0..0], .capacity_and_inline = inline_mask | storage.len, }; } pub fn initBorrowedValues(storage: []Item, values_to_copy: []const Item) Self { std.debug.assert(storage.len & inline_mask == 0); std.debug.assert(values_to_copy.len <= storage.len); @memcpy(storage[0..values_to_copy.len], values_to_copy); return .{ .slice = storage[0..values_to_copy.len], .capacity_and_inline = inline_mask | storage.len, }; } pub fn deinit(self: *Self, allocator: Allocator) void { if (!self.isInline() and self.capacity() > 0) { allocator.free(self.slice.ptr[0..self.capacity()]); } self.* = .{}; } pub fn append(self: *Self, allocator: Allocator, item: Item) Allocator.Error!void { const capacity_value = self.capacity(); if (self.slice.len < capacity_value) { self.slice.ptr[self.slice.len] = item; self.slice.len += 1; return; } if (self.isInline()) { std.debug.assert(self.slice.len == capacity_value); const heap_capacity = std.math.add(usize, capacity_value, 1) catch { return error.OutOfMemory; }; const heap_items = try allocator.alloc(Item, heap_capacity); errdefer allocator.free(heap_items); @memcpy(heap_items[0..capacity_value], self.slice); heap_items[capacity_value] = item; self.slice = heap_items; self.capacity_and_inline = heap_items.len; return; } var heap: std.ArrayListUnmanaged(Item) = .{ .items = self.slice, .capacity = capacity_value, }; try heap.append(allocator, item); std.debug.assert(heap.capacity & inline_mask == 0); self.slice = heap.items; self.capacity_and_inline = heap.capacity; } pub fn values(self: *const Self) []const Item { return self.slice; } pub fn valuesMut(self: *Self) []Item { return self.slice; } fn capacity(self: *const Self) usize { return self.capacity_and_inline & ~inline_mask; } fn isInline(self: *const Self) bool { return self.capacity_and_inline & inline_mask != 0; } };}Source: lib/choir/src/core/interfaces/traits.zig:4
pub const TraitId = u64;Source: lib/choir/src/core/interfaces/traits.zig:6
pub fn traitId(comptime name: []const u8) TraitId { return std.hash.Wyhash.hash(0, name);}Source: lib/choir/src/core/interfaces/traits.zig:10
pub fn traitIdRuntime(name: []const u8) TraitId { return std.hash.Wyhash.hash(0, name);}Source: lib/choir/src/core/interfaces/root.zig
const base = @import("base.zig");const traits = @import("traits.zig");const attrs = @import("attrs.zig");const ops = @import("ops.zig");const types = @import("types.zig");const entry = @import("entry.zig");pub const InlineList = entry.InlineList;pub const ContextOpaque = base.ContextOpaque;pub const castContext = base.castContext;pub const InterfaceId = base.InterfaceId;pub const interfaceId = base.interfaceId;pub const interfaceIdRuntime = base.interfaceIdRuntime;pub const InterfaceEntry = base.InterfaceEntry;pub const TypeParamPayload = base.TypeParamPayload;pub const TraitId = traits.TraitId;pub const traitId = traits.traitId;pub const traitIdRuntime = traits.traitIdRuntime;pub const OperationTraits = traits.OperationTraits;pub const TraitVTable = traits.TraitVTable;pub const TraitEntry = traits.TraitEntry;pub const TraitRegistry = traits.TraitRegistry;pub const AbstractAttribute = attrs.AbstractAttribute;pub const AttributeEqualInterface = attrs.AttributeEqualInterface;pub const AttributePrintInterface = attrs.AttributePrintInterface;pub const AttributeArrayInterface = attrs.AttributeArrayInterface;pub const SymbolUserAttrInterface = attrs.SymbolUserAttrInterface;pub const AttributeRegistry = attrs.AttributeRegistry;pub const OperationInfo = ops.OperationInfo;pub const CountRange = ops.CountRange;pub const OperationShape = ops.OperationShape;pub const OperationSegmentSpec = ops.OperationSegmentSpec;pub const OperationTypeConstraint = ops.OperationTypeConstraint;pub const OperationPropertiesModel = ops.OperationPropertiesModel;pub const singleAttributePropertiesModel = ops.singleAttributePropertiesModel;pub const OperationRegistry = ops.OperationRegistry;pub const CseOpInterface = ops.CseOpInterface;pub const SymbolOpInterface = ops.SymbolOpInterface;pub const SymbolUserOpInterface = ops.SymbolUserOpInterface;pub const CallOpInterface = ops.CallOpInterface;pub const FunctionOpInterface = ops.FunctionOpInterface;pub const RegionKind = ops.RegionKind;pub const RegionKindInterface = ops.RegionKindInterface;pub const ControlFlowInterface = ops.ControlFlowInterface;pub const InferTypeOpInterface = ops.InferTypeOpInterface;pub const FoldResult = ops.FoldResult;pub const FoldResults = ops.FoldResults;pub const FoldOpInterface = ops.FoldOpInterface;pub const DiagnosticKind = ops.DiagnosticKind;pub const EvalError = ops.EvalError;pub const EvalContext = ops.EvalContext;pub const Evaluatable = ops.Evaluatable;pub const YieldOpInterface = ops.YieldOpInterface;pub const HandlerEntryOpInterface = ops.HandlerEntryOpInterface;pub const TranslationDialectInterface = ops.TranslationDialectInterface;pub const TypeInfo = types.TypeInfo;pub const TypeRegistry = types.TypeRegistry;pub const TypePrintInterface = types.TypePrintInterface;pub const TypeVerifyInterface = types.TypeVerifyInterface;pub const TypeParamInterface = types.TypeParamInterface;pub const ShapedTypeInterface = types.ShapedTypeInterface;pub const effects = @import("effects.zig");pub const EffectOpInterface = effects.EffectOpInterface;Source: lib/choir/src/core/root.zig:63
pub const interfaces = @import("interfaces/root.zig");Also reachable as
backends.wasm.emission.module_encoding.common.ir.interfaces.
Complete caller list for ir.interfaceId
20 direct callers.
lib.choir.src.core.interfaces.attrs.test_SymbolUserAttrInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/attrs.zig:323in nearest public ownerlib.choir.src.core.interfaces.attrslib.choir.src.core.interfaces.base.test_interfaceId_produces_stable_hashes[function] — test source atlib/choir/src/core/interfaces/base.zig:104in nearest public ownerlib.choir.src.core.interfaces.baselib.choir.src.core.interfaces.ops.test_CallOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2121in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_ControlFlowInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2173in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_Evaluatable_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2193in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_FunctionOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2131in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_HandlerEntryOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2219in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_InferTypeOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2183in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2004in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerOrReplaceInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2042in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_RegionKindInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2141in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_SymbolOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2111in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_SymbolUserOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2162in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_TranslationDialectInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2201in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_YieldOpInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/ops.zig:2209in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.types.test_ShapedTypeInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/types.zig:609in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeParamInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/types.zig:599in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypePrintInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/types.zig:579in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_basic_usage[function] — test source atlib/choir/src/core/interfaces/types.zig:360in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeVerifyInterface_stable_ID[function] — test source atlib/choir/src/core/interfaces/types.zig:589in nearest public ownerlib.choir.src.core.interfaces.types
Complete caller list for ir.OperationRegistry.count
7 direct callers.
lib.choir.src.core.interfaces.ops.test_OperationRegistry_basic_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:1721in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_cleans_region_and_retries_every_outer_allocation_failure[function] — test source atlib/choir/src/core/interfaces/ops.zig:1953in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_preserves_duplicate_and_existing_entry_semantics[function] — test source atlib/choir/src/core/interfaces/ops.zig:1924in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batches_exact_variable_entries_with_stable_mixed_ownership[function] — test source atlib/choir/src/core/interfaces/ops.zig:1840in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/ops.zig:1822in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_co-owns_each_header_metadata_storage_and_name_in_one_allocation[function] — test source atlib/choir/src/core/interfaces/ops.zig:1743in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_multiple_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:2061in nearest public ownerlib.choir.src.core.interfaces.ops
Complete caller list for ir.OperationRegistry.deinit
12 direct callers.
lib.choir.src.core.interfaces.ops.test_OperationRegistry_basic_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:1721in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_cleans_region_and_retries_every_outer_allocation_failure[function] — test source atlib/choir/src/core/interfaces/ops.zig:1953in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_preserves_duplicate_and_existing_entry_semantics[function] — test source atlib/choir/src/core/interfaces/ops.zig:1924in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batches_exact_variable_entries_with_stable_mixed_ownership[function] — test source atlib/choir/src/core/interfaces/ops.zig:1840in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/ops.zig:1822in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_co-owns_each_header_metadata_storage_and_name_in_one_allocation[function] — test source atlib/choir/src/core/interfaces/ops.zig:1743in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_multiple_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:2061in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInherentAttributeName[function] — test source atlib/choir/src/core/interfaces/ops.zig:2024in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2004in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerOperation_merges_traits[function] — test source atlib/choir/src/core/interfaces/ops.zig:1987in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerOrReplaceInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2042in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/ops.zig:2089in nearest public ownerlib.choir.src.core.interfaces.ops
Complete caller list for ir.OperationRegistry.getOrCreate
18 direct callers.
tiny.choir.ir.OperationRegistry.registerInherentAttributeName[method] atlib/choir/src/core/interfaces/ops.zig:832tiny.choir.ir.OperationRegistry.registerInherentAttributeNames[method] atlib/choir/src/core/interfaces/ops.zig:850tiny.choir.ir.OperationRegistry.registerInterface[method] atlib/choir/src/core/interfaces/ops.zig:814tiny.choir.ir.OperationRegistry.registerOperandSegments[method] atlib/choir/src/core/interfaces/ops.zig:877tiny.choir.ir.OperationRegistry.registerOperandTypeConstraint[method] atlib/choir/src/core/interfaces/ops.zig:895tiny.choir.ir.OperationRegistry.registerOperation[method] atlib/choir/src/core/interfaces/ops.zig:795tiny.choir.ir.OperationRegistry.registerOrReplaceInterface[method] atlib/choir/src/core/interfaces/ops.zig:823tiny.choir.ir.OperationRegistry.registerPropertiesModel[method] atlib/choir/src/core/interfaces/ops.zig:859tiny.choir.ir.OperationRegistry.registerRequiredAttributeName[method] atlib/choir/src/core/interfaces/ops.zig:841tiny.choir.ir.OperationRegistry.registerResultSegments[method] atlib/choir/src/core/interfaces/ops.zig:886tiny.choir.ir.OperationRegistry.registerResultTypeConstraint[method] atlib/choir/src/core/interfaces/ops.zig:904tiny.choir.ir.OperationRegistry.registerShape[method] atlib/choir/src/core/interfaces/ops.zig:868tiny.choir.ir.OperationRegistry.registerTrait[method] atlib/choir/src/core/interfaces/ops.zig:805lib.choir.src.core.interfaces.ops.test_OperationRegistry_basic_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:1721in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_preserves_duplicate_and_existing_entry_semantics[function] — test source atlib/choir/src/core/interfaces/ops.zig:1924in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batches_exact_variable_entries_with_stable_mixed_ownership[function] — test source atlib/choir/src/core/interfaces/ops.zig:1840in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/ops.zig:1822in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/ops.zig:2089in nearest public ownerlib.choir.src.core.interfaces.ops
Complete caller list for ir.OperationRegistry.init
12 direct callers.
lib.choir.src.core.interfaces.ops.test_OperationRegistry_basic_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:1721in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_cleans_region_and_retries_every_outer_allocation_failure[function] — test source atlib/choir/src/core/interfaces/ops.zig:1953in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_preserves_duplicate_and_existing_entry_semantics[function] — test source atlib/choir/src/core/interfaces/ops.zig:1924in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batches_exact_variable_entries_with_stable_mixed_ownership[function] — test source atlib/choir/src/core/interfaces/ops.zig:1840in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/ops.zig:1822in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_co-owns_each_header_metadata_storage_and_name_in_one_allocation[function] — test source atlib/choir/src/core/interfaces/ops.zig:1743in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_multiple_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:2061in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInherentAttributeName[function] — test source atlib/choir/src/core/interfaces/ops.zig:2024in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2004in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerOperation_merges_traits[function] — test source atlib/choir/src/core/interfaces/ops.zig:1987in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerOrReplaceInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2042in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/ops.zig:2089in nearest public ownerlib.choir.src.core.interfaces.ops
Complete caller list for ir.OperationRegistry.lookup
8 direct callers.
lib.choir.src.core.interfaces.ops.test_OperationRegistry_basic_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:1721in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batch_preserves_duplicate_and_existing_entry_semantics[function] — test source atlib/choir/src/core/interfaces/ops.zig:1924in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_batches_exact_variable_entries_with_stable_mixed_ownership[function] — test source atlib/choir/src/core/interfaces/ops.zig:1840in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_multiple_operations[function] — test source atlib/choir/src/core/interfaces/ops.zig:2061in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInherentAttributeName[function] — test source atlib/choir/src/core/interfaces/ops.zig:2024in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2004in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_registerOrReplaceInterface[function] — test source atlib/choir/src/core/interfaces/ops.zig:2042in nearest public ownerlib.choir.src.core.interfaces.opslib.choir.src.core.interfaces.ops.test_OperationRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/ops.zig:2089in nearest public ownerlib.choir.src.core.interfaces.ops
Complete caller list for ir.TypeRegistry.deinit
8 direct callers.
lib.choir.src.core.interfaces.types.test_TypeRegistry_basic_usage[function] — test source atlib/choir/src/core/interfaces/types.zig:360in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/types.zig:539in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_co-owns_a_named_batch_in_one_exact_region[function] — test source atlib/choir/src/core/interfaces/types.zig:406in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_co-owns_each_header_and_name_in_one_allocation[function] — test source atlib/choir/src/core/interfaces/types.zig:379in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_named_batch_preserves_duplicate_registration_semantics[function] — test source atlib/choir/src/core/interfaces/types.zig:449in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_named_batch_preserves_state_across_allocation_failures[function] — test source atlib/choir/src/core/interfaces/types.zig:477in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_releases_a_batch_after_its_last_removal[function] — test source atlib/choir/src/core/interfaces/types.zig:506in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/types.zig:557in nearest public ownerlib.choir.src.core.interfaces.types
Complete caller list for ir.TypeRegistry.getOrCreate
7 direct callers.
tiny.choir.ir.TypeRegistry.registerInterface[method] atlib/choir/src/core/interfaces/types.zig:186tiny.choir.ir.TypeRegistry.registerOrReplaceInterface[method] atlib/choir/src/core/interfaces/types.zig:195tiny.choir.ir.TypeRegistry.registerType[method] atlib/choir/src/core/interfaces/types.zig:182lib.choir.src.core.interfaces.types.test_TypeRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/types.zig:539in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_co-owns_a_named_batch_in_one_exact_region[function] — test source atlib/choir/src/core/interfaces/types.zig:406in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_releases_a_batch_after_its_last_removal[function] — test source atlib/choir/src/core/interfaces/types.zig:506in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/types.zig:557in nearest public ownerlib.choir.src.core.interfaces.types
Complete caller list for ir.TypeRegistry.init
8 direct callers.
lib.choir.src.core.interfaces.types.test_TypeRegistry_basic_usage[function] — test source atlib/choir/src/core/interfaces/types.zig:360in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_cleans_a_shared_entry_when_map_growth_fails[function] — test source atlib/choir/src/core/interfaces/types.zig:539in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_co-owns_a_named_batch_in_one_exact_region[function] — test source atlib/choir/src/core/interfaces/types.zig:406in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_co-owns_each_header_and_name_in_one_allocation[function] — test source atlib/choir/src/core/interfaces/types.zig:379in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_named_batch_preserves_duplicate_registration_semantics[function] — test source atlib/choir/src/core/interfaces/types.zig:449in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_named_batch_preserves_state_across_allocation_failures[function] — test source atlib/choir/src/core/interfaces/types.zig:477in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_releases_a_batch_after_its_last_removal[function] — test source atlib/choir/src/core/interfaces/types.zig:506in nearest public ownerlib.choir.src.core.interfaces.typeslib.choir.src.core.interfaces.types.test_TypeRegistry_stable_pointers[function] — test source atlib/choir/src/core/interfaces/types.zig:557in nearest public ownerlib.choir.src.core.interfaces.types
Audit
| Definitions | 167 |
|---|---|
| Public names | 626 |
| Members | 117 |
| Version | 26.7.0 |
| Revision | daab053ee433 |