zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 1d4a7e123c8ea07d9cc5adcf0f51c640ccc2784a (tree)
parent be4ad235a79be25d022f672446054e2ed61b4e81
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Fri, 23 Feb 2024 03:23:30 +0100

llvm: revert bad cleanup

Diffstat:
Msrc/codegen/llvm.zig | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig @@ -1149,14 +1149,17 @@ pub const Object = struct { try self.genModuleLevelAssembly(); if (!self.builder.strip) { - for ( - self.debug_unresolved_namespace_scopes.keys(), - self.debug_unresolved_namespace_scopes.values(), - ) |namespace_index, fwd_ref| { - const namespace = self.module.namespacePtr(namespace_index); - const debug_type = try self.lowerDebugType(namespace.ty); - - self.builder.debugForwardReferenceSetType(fwd_ref, debug_type); + { + var i: usize = 0; + while (i < self.debug_unresolved_namespace_scopes.count()) : (i += 1) { + const namespace_index = self.debug_unresolved_namespace_scopes.keys()[i]; + const fwd_ref = self.debug_unresolved_namespace_scopes.values()[i]; + + const namespace = self.module.namespacePtr(namespace_index); + const debug_type = try self.lowerDebugType(namespace.ty); + + self.builder.debugForwardReferenceSetType(fwd_ref, debug_type); + } } self.builder.debugForwardReferenceSetType( @@ -1967,7 +1970,6 @@ pub const Object = struct { if (!ty.hasRuntimeBitsIgnoreComptime(mod)) { const debug_enum_type = try o.makeEmptyNamespaceDebugType(owner_decl_index); try o.debug_type_map.put(gpa, ty, debug_enum_type); - try o.debug_enums.append(gpa, debug_enum_type); return debug_enum_type; }