diff --git a/compiler/llvm/llvmdef.pas b/compiler/llvm/llvmdef.pas index e3aef53884..0281863ce4 100644 --- a/compiler/llvm/llvmdef.pas +++ b/compiler/llvm/llvmdef.pas @@ -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); diff --git a/compiler/llvm/nllvmutil.pas b/compiler/llvm/nllvmutil.pas index 3afedee6f3..bff02fbd39 100644 --- a/compiler/llvm/nllvmutil.pas +++ b/compiler/llvm/nllvmutil.pas @@ -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); diff --git a/compiler/symconst.pas b/compiler/symconst.pas index ea00460724..70ac911d65 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -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; diff --git a/compiler/utils/ppuutils/ppudump.pp b/compiler/utils/ppuutils/ppudump.pp index 5884584531..d7b59e984a 100644 --- a/compiler/utils/ppuutils/ppudump.pp +++ b/compiler/utils/ppuutils/ppudump.pp @@ -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'),