From 821c22a38f8c172e3a6eca20e28027d86f854876 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 23 Jan 2023 22:44:25 +0100 Subject: [PATCH] LLVM: workaround to fix make all --- compiler/llvm/hlcgllvm.pas | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/llvm/hlcgllvm.pas b/compiler/llvm/hlcgllvm.pas index b3aa17aa5f..e9c7b8cb72 100644 --- a/compiler/llvm/hlcgllvm.pas +++ b/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