LLVM: don't use type names in ctor/dtor arrays

Workaround for https://github.com/llvm/llvm-project/issues/56809
This commit is contained in:
Jonas Maebe 2023-03-18 23:13:03 +01:00
parent 0e46041717
commit 839849085b
4 changed files with 8 additions and 3 deletions

View File

@ -502,7 +502,8 @@ implementation
recorddef :
begin
{ avoid endlessly recursive definitions }
if not(lef_typedecl in flags) then
if not(lef_typedecl in flags) and
not(df_llvm_no_typename in def.defoptions) then
encodedstr:=encodedstr+llvmtypeidentifier(def)
else
llvmaddencodedabstractrecordtype(trecorddef(def),encodedstr);

View File

@ -180,6 +180,7 @@ implementation
itemdef:=llvmgettemprecorddef(fields,C_alignment,
targetinfos[target_info.system]^.alignment.recordalignmin);
include(itemdef.defoptions,df_llvm_no_struct_packing);
include(itemdef.defoptions,df_llvm_no_typename);
tcb:=ctai_typedconstbuilder.create([tcalo_new_section]);
tllvmtai_typedconstbuilder(tcb).appendingdef:=true;
arraydef:=carraydef.getreusable(itemdef,procdefs.Count);

View File

@ -251,7 +251,9 @@ type
df_has_global_ref,
{ the def was derived with generic type or const fields so the size
of the def can not be determined }
df_has_generic_fields
df_has_generic_fields,
{ never use the typename for this type, always expand full definition }
df_llvm_no_typename
);
tdefoptions=set of tdefoption;

View File

@ -2800,7 +2800,8 @@ const
(mask:df_llvm_no_struct_packing; str:'LLVM unpacked struct'),
(mask:df_internal; str:'Internal'),
(mask:df_has_global_ref; str:'Has Global Ref'),
(mask:df_has_generic_fields; str:'Has generic fields')
(mask:df_has_generic_fields; str:'Has generic fields'),
(mask:df_llvm_no_typename; str:'LLVM no typename')
);
defstate : array[1..ord(high(tdefstate))] of tdefstateinfo=(
(mask:ds_vmt_written; str:'VMT Written'),