Self-referential struct
All checks were successful
CI / ci (MinSizeRel, ubuntu-latest) (push) Successful in 1m4s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Successful in 1m4s
CI / ci (Release, ubuntu-latest) (push) Successful in 1m2s
CI / ci (Debug, ubuntu-latest) (push) Successful in 2m37s

This commit is contained in:
David Gonzalez Martin 2025-05-23 19:55:59 -06:00
parent 510f27e13f
commit 5de4ba76f5
2 changed files with 2 additions and 1 deletions

View File

@ -306,7 +306,7 @@ global_variable String names[] =
string_literal("noreturn_macro"),
string_literal("generic_pointer_array"),
// string_literal("self_referential_struct"), // TODO
string_literal("self_referential_struct"), // TODO
// string_literal("forward_declared_type"),
};

View File

@ -956,6 +956,7 @@ fn void resolve_type_in_place_debug(Module* module, Type* type)
{
LLVMDIFlags flags = {};
auto forward_declaration = LLVMDIBuilderCreateReplaceableCompositeType(module->llvm.di_builder, module->llvm.debug_tag, (char*)type->name.pointer, type->name.length, module->scope.llvm, module->llvm.file, type->structure.line, 0, type->structure.byte_size * 8, type->structure.byte_alignment * 8, flags, (char*)type->name.pointer, type->name.length);
type->llvm.debug = forward_declaration;
module->llvm.debug_tag += 1;
LLVMMetadataRef llvm_type_buffer[64];