From 46432d2f8e22eb3a27e8a2ea1822167fdd6c34ab Mon Sep 17 00:00:00 2001 From: nub31 Date: Fri, 12 Sep 2025 23:36:10 +0200 Subject: [PATCH] Add todo --- compiler/NubLang/Generation/QBE/QBEGenerator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/NubLang/Generation/QBE/QBEGenerator.cs b/compiler/NubLang/Generation/QBE/QBEGenerator.cs index 0ea759f..184961d 100644 --- a/compiler/NubLang/Generation/QBE/QBEGenerator.cs +++ b/compiler/NubLang/Generation/QBE/QBEGenerator.cs @@ -95,7 +95,7 @@ public class QBEGenerator %size =l loadl %array ret %size } - + """); _writer.Comment("========== Referenced structs =========="); @@ -355,6 +355,8 @@ public class QBEGenerator private void EmitStructType(StructTypeNode structType) { + // todo(nub31): qbe expects structs to be declared in order. We must Check the dependencies of the struct to see if a type need to be declared before this one + // qbe allows multiple declarations of the same struct, but we should keep track and only emit an new one if necessary _writer.Write($"type {StructTypeName(structType.Module, structType.Name)} = {{ "); foreach (var field in structType.Fields)