Bladeren bron

LLVM: workaround to fix make all

Jonas Maebe 2 jaren geleden
bovenliggende
commit
821c22a38f
1 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  1. 11 0
      compiler/llvm/hlcgllvm.pas

+ 11 - 0
compiler/llvm/hlcgllvm.pas

@@ -1687,6 +1687,11 @@ implementation
       implicitpointer: boolean;
     begin
       implicitpointer:=is_implicit_pointer_object_type(recdef);
+      (*
+         This doesn't work with the way anonymous functions migrate symbols,
+         TBD on how to fix it or whether to permanently disable it (even if it's
+         the clean way to do it at the IR level)
+
       currentstructdef:=recdef;
       { in case the field is part of a parent of the current object,
         index into the parents until we're at the parent containing the
@@ -1713,6 +1718,12 @@ implementation
           { go to the parent }
           currentstructdef:=parentdef;
         end;
+      *)
+      currentstructdef:=tdef(field.owner.defowner);
+      if implicitpointer then
+        g_ptrtypecast_ref(list,recdef,currentstructdef,recref)
+      else
+        g_ptrtypecast_ref(list,cpointerdef.getreusable(recdef),cpointerdef.getreusable(currentstructdef),recref);
       { get the corresponding field in the llvm shadow symtable }
       llvmfield:=tabstractrecordsymtable(tabstractrecorddef(currentstructdef).symtable).llvmst[field];
       if implicitpointer then